Creating payment allocation plans
Use the following endpoint to create a payment allocation plan:
- POST
/admin/v1/payment-allocation-plans
Minimum creation criteria
When you create a payment allocation plan, you must specify a name and an effective date. For example, the following payload is the minimum required to create a payment allocation plan:
POST /admin/v1/payment-allocation-plans
{
"data": {
"attributes": {
"name": "Cloud API Default Payment Allocation Plan",
"effectiveDate": "2020-01-01"
}
}
}
If you do not specify any distribution criteria, BillingCenter adds the following criteria by default:
- Billed or Due
- Invoice
- Policy Period
- Positive
If you do not specify any invoice item ordering criteria, BillingCenter adds the following criteria by default:
- Recapture charges
- Event date
- Charge pattern
Thus, the payment allocation plan created above has the following attributes:
- Name: Cloud API Default Payment Allocation Plan
- Effective Date: January 1, 2020
- Distribution criteria:
- Billed or Due
- Invoice
- Policy Period
- Positive
- Invoice item ordering criteria:
- Recapture charges
- Event date
- Charge pattern
Specifying distribution and invoice item ordering criteria
To specify distribution criteria, use the following syntax:
"distributionCriteria": [
{
"code": "<typecode-from-DistributionFilterType-typelist>"
},
{
"code": "<typecode-from-DistributionFilterType-typelist>"
},
...
]
Distribution criteria are additive. You can declare them in any order.
To specify invoice item ordering criteria, use the following syntax:
"invoiceItemOrderings": [
{
"invoiceItemOrderingType": {
"code": "<typecode-from-InvoiceItemOrderingType-typelist>"
}
},
{
"invoiceItemOrderingType": {
"code": "<typecode-from-InvoiceItemOrderingType-typelist>"
}
}
]
Invoice item ordering criteria are ordered. When POSTing a new payment allocation plan, the first criteria in the payload is given a priority of 1 (it is executed first), the second is given a priority of 2 (it is executed second), and so on.
Example of creating a payment allocation plan with non-default criteria
For example, the following payload creates a payment allocation plan with the following criteria:
- Distribution criteria of "Positive" and "Billed or Due"
- Invoice item ordering criteria of "Charge pattern" (priority 1) and then "Event date" (priority 2)
POST /admin/v1/payment-allocation-plans
{
"data": {
"attributes": {
"name": "Cloud API Specified Criteria Payment Allocation Plan",
"effectiveDate": "2020-02-02"
"distributionCriteria": [
{
"code": "Positive"
},
{
"code": "BilledOrDue"
}
],
"invoiceItemOrderings": [
{
"invoiceItemOrderingType": {
"code": "ChargePattern"
}
},
{
"invoiceItemOrderingType": {
"code": "EventDate"
}
}
]
}
}
}