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
    locatorpathstringrequired
    Security Group:credit-distributions   Permission:read
Fetch Credit Distributions for an Invoice
fetchCreditDistributionsForAnInvoice
GET /billing/{tenantLocator}/invoices/{locator}/creditDistributions/list
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathstringrequired
    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
    accountLocatorquerystring?optional
    extendedqueryboolean?optional
    Security Group:credit-distributions   Permissions:read,list
CreditDistributionListResponse
required
listCompleted boolean
CreditDistributionResponse
required
locator string
currency string
creditDistributionState Enum draft | validated | executed | reversed | discarded
amount number
createdAt datetime
createdBy uuid
shortfallCreditLocators string[]
sources CreditItem[]
targets CreditItem[]

optional
accountLocator string?
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 string?
currency string?
Update Credit Distribution
updateCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}
CreditDistributionUpdateRequest
required
addSources CreditItem[]
addTargets CreditItem[]
removeSources string[]
removeTargets string[]

optional
accountLocator string?
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 string?
currency string?

Execution

Validate Credit Distribution
validateCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/validate
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathstringrequired
    Security Group:credit-distributions   Permission:write
Execute Credit Distribution
executeCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/execute
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathstringrequired
    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
    locatorpathstringrequired
    Security Group:credit-distributions   Permission:write
Discard Credit Distribution
discardCreditDistribution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/discard
    Request Parameters:
    NamePositionTypeRequired
    tenantLocatorpathuuidrequired
    locatorpathstringrequired
    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
    locatorpathstringrequired
    offsetqueryint?optional
    countqueryint?optional
    extendedqueryboolean?optional
    Security Group:credit-distributions   Permissions:read,list