Credit Distribution API
Credit Distributions are used to apply customer credits from a Credit Balance to invoices or for disbursements.
Endpoint Index
| Action | Endpoint |
|---|---|
| Fetch Credit Distribution | GET /billing/{tenantLocator}/creditDistributions/{locator} |
| Fetch Credit Distributions for an Invoice | GET /billing/{tenantLocator}/invoices/{locator}/creditDistributions/list |
| Fetch Multiple Credit Distributions | GET /billing/{tenantLocator}/creditDistributions/list |
| Create Credit Distribution | POST /billing/{tenantLocator}/creditDistributions |
| Update Credit Distribution | PATCH /billing/{tenantLocator}/creditDistributions/{locator} |
| Create Or Replace Credit Distribution | PUT /billing/{tenantLocator}/creditDistributions/{locator} |
| Validate Credit Distribution | PATCH /billing/{tenantLocator}/creditDistributions/{locator}/validate |
| Execute Credit Distribution | PATCH /billing/{tenantLocator}/creditDistributions/{locator}/execute |
| Reverse Credit Distribution | PATCH /billing/{tenantLocator}/creditDistributions/{locator}/reverse |
| Reset Credit Distribution | PATCH /billing/{tenantLocator}/creditDistributions/{locator}/reset |
| Discard Credit Distribution | PATCH /billing/{tenantLocator}/creditDistributions/{locator}/discard |
| Fetch Invoices Targeted By a Credit Distribution | GET /billing/{tenantLocator}/creditDistributions/{locator}/invoices/list |
Fetch
GET /billing/{tenantLocator}/creditDistributions/{locator}Request Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
Response:CreditDistributionResponse
Security Group:credit-distributions  Permission:read
GET /billing/{tenantLocator}/invoices/{locator}/creditDistributions/listRequest Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
| includeReversed | query | boolean? | optional |
| offset | query | int? | optional |
| count | query | int? | optional |
| extended | query | boolean? | optional |
Response:CreditDistributionListResponse
Security Group:invoices  Permissions:read,list
GET /billing/{tenantLocator}/creditDistributions/listRequest Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| offset | query | int? | optional |
| count | query | int? | optional |
| accountLocator | query | string? | optional |
| extended | query | boolean? | optional |
Response:CreditDistributionListResponse
Security Group:credit-distributions  Permissions:read,list
CreditDistributionListResponse
¶requiredlistCompleted booleanitems CreditDistributionResponse[]
CreditDistributionResponse
¶requiredlocator stringcurrency stringcreditDistributionState Enum draft | validated | executed | reversed | discardedamount numbercreatedAt datetimecreatedBy uuidshortfallCreditLocators string[]sources CreditItem[]targets CreditItem[]optionalaccountLocator string?executedAt datetime?reversalReason string?reversedAt datetime?validationResult ValidationResult?
Creation and Update
POST /billing/{tenantLocator}/creditDistributionsRequest Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
Request:CreditDistributionCreateRequest
Response:CreditDistributionResponse
Security Group:credit-distributions  Permission:write
CreditDistributionCreateRequest
¶requiredamount numbersources CreditItem[]targets CreditItem[]optionalaccountLocator string?currency string?
PATCH /billing/{tenantLocator}/creditDistributions/{locator}Request Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
Request:CreditDistributionUpdateRequest
Response:CreditDistributionResponse
Security Group:credit-distributions  Permission:write
CreditDistributionUpdateRequest
¶requiredaddSources CreditItem[]addTargets CreditItem[]removeSources string[]removeTargets string[]optionalaccountLocator string?currency string?amount number?
PUT /billing/{tenantLocator}/creditDistributions/{locator}Request Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
Request:CreditDistributionPutRequest
Response:CreditDistributionResponse
Security Group:credit-distributions  Permission:write
CreditDistributionPutRequest
¶requiredamount numbersources CreditItem[]targets CreditItem[]optionalaccountLocator string?currency string?
Execution
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/validateRequest Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
Response:CreditDistributionResponse
Security Group:credit-distributions  Permission:write
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/executeRequest Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
Response:CreditDistributionResponse
Security Group:credit-distributions  Permission:write
Reversal
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/reverseRequest Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
Request:CreditDistributionReverseRequest
Response:CreditDistributionResponse
Security Group:credit-distributions  Permission:write
CreditDistributionReverseRequest
¶requiredreversalType string
Reset and Discard
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/resetRequest Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
Response:CreditDistributionResponse
Security Group:credit-distributions  Permission:write
PATCH /billing/{tenantLocator}/creditDistributions/{locator}/discardRequest Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
Response:CreditDistributionResponse
Security Group:credit-distributions  Permission:write
Invoices
GET /billing/{tenantLocator}/creditDistributions/{locator}/invoices/listRequest Parameters:
| Name | Position | Type | Required |
|---|---|---|---|
| tenantLocator | path | uuid | required |
| locator | path | string | required |
| offset | query | int? | optional |
| count | query | int? | optional |
| extended | query | boolean? | optional |
Response:InvoiceListResponse
Security Group:credit-distributions  Permissions:read,list