Credit Distribution API

Credit Distributions are used to apply customer credits from a Credit Balance to invoices or for disbursements.

Fetch

Fetch Credit Distribution
fetchCreditDistribution
GET /billing/{tenantLocator}/creditDistributions/{locator}
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathlocatorrequired
    Security Group:credit-distributions   Permission:read
Fetch Credit Distributions for an Invoice
fetchCreditDistributionsForAnInvoice
GET /billing/{tenantLocator}/invoices/{locator}/creditDistributions/list
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathlocatorrequired
    includeReversedqueryboolean?optional
    offsetqueryint?optional
    countqueryint?optional
    extendedqueryboolean?optional
    Security Group:invoices   Permissions:read,list
Fetch Multiple Credit Distributions
fetchMultipleCreditDistributions
GET /billing/{tenantLocator}/creditDistributions/list
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    offsetqueryint?optional
    countqueryint?optional
    accountLocatorquerylocator?optional
    extendedqueryboolean?optional
    Security Group:credit-distributions   Permissions:read,list
CreditDistributionListResponse
required
listCompleted boolean
CreditDistributionResponse
required
locator locator
currency string
creditDistributionState Enum draft | validated | executed | reversed | discarded
amount number
createdAt datetime
createdBy uuid
shortfallCreditLocators locator[]
sources CreditItem[]
targets CreditItem[]

optional
accountLocator locator?
executedAt datetime?
reversalReason string?
reversedAt datetime?
validationResult ValidationResult?

Creation and Update

Create Credit Distribution
createCreditDistribution
POST /billing/{tenantLocator}/creditDistributions
CreditDistributionCreateRequest
required
amount number
sources CreditItem[]
targets CreditItem[]

optional
accountLocator locator?
currency string?
Update Credit Distribution
updateCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}
CreditDistributionUpdateRequest
required
addSources CreditItem[]
addTargets CreditItem[]
removeSources locator[]
removeTargets locator[]

optional
accountLocator locator?
currency string?
amount number?
Create Or Replace Credit Distribution
createOrReplaceCreditDistribution
PUT /billing/{tenantLocator}/creditDistributions/{locator}
CreditDistributionPutRequest
required
amount number
sources CreditItem[]
targets CreditItem[]

optional
accountLocator locator?
currency string?

Execution

Validate Credit Distribution
validateCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/validate
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathlocatorrequired
    Security Group:credit-distributions   Permission:write
Execute Credit Distribution
executeCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/execute
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathlocatorrequired
    Security Group:credit-distributions   Permission:write

Reversal

Reverse Credit Distribution
reverseCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/reverse
CreditDistributionReverseRequest
required
reversalType string

Reset and Discard

Reset Credit Distribution
resetCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/reset
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathlocatorrequired
    Security Group:credit-distributions   Permission:write
Discard Credit Distribution
discardCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/discard
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathlocatorrequired
    Security Group:credit-distributions   Permission:write

Invoices

Fetch Invoices Targeted By a Credit Distribution
fetchInvoicesTargetedByACreditDistribution
GET /billing/{tenantLocator}/creditDistributions/{locator}/invoices/list
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathlocatorrequired
    offsetqueryint?optional
    countqueryint?optional
    extendedqueryboolean?optional
    Security Group:credit-distributions   Permissions:read,list