v1
latestOpenAPI 3.0.02026-07-24161215397.4 KBPayments
Create a new allocation for credit note/overpayment
Create a new allocation for a credit note/overpayment. The paymentId used here is the _id of the credit note/overpayment, while the request body contains the _id of the target invoice.
Required scopes: flex.billing.payments.allocations.create
post/api/v2/organizations/{orgSlug}/payments/{paymentId}/allocations
Path parameters
paymentIdstring required
overpayment/credit note id
orgSlugstring required
organization slug
Request body
Example request
{
"target": "6780f1ba3a4b5c6d7e8f9a0b",
"amount": 60,
"accounting": {
"provider": "xero",
"providerId": "123456789",
"externalOrgId": "987654321",
"deepLink": "https://quickbooks.com/123456789",
"lastSync": "2025-01-01T00:00:00.000Z",
"error": "An error occurred while syncing with Xero"
}
}Response
Example response
{
"properties": {
"customProperty1": "value1",
"customProperty2": "value2"
},
"_id": "6780f1ba1a2b3c4d5e6f7a8b",
"number": "INV-123",
"date": "2025-01-01T00:00:00.000Z",
"dueDate": "2025-01-01T00:00:00.000Z",
"company": "6780f1ba3c4d5e6f7a8b9c0d",
"member": "6780f1ba2b3c4d5e6f7a8b9c",
"location": "6780f1ba4d5e6f7a8b9c0d1e",
"reference": "Payment for the membership fee.",
"allocations": [],
"lines": [
{
"description": "Membership fee",
"quantity": 2,
"account": "6780f1ba5e6f7a8b9c0d1e2f",
"plan": "6780f1ba6f7a8b9c0d1e2f3a",
"fee": "6780f1ba7a8b9c0d1e2f3a4b",
"membership": "6780f1ba9c0d1e2f3a4b5c6d",
"location": "6780f1ba4d5e6f7a8b9c0d1e",
"taxRate": "6780f1ba1e2f3a4b5c6d7e8f",
"taxPercent": 25,
"taxAmount": 25.7,
"discountAmount": 10,
"price": 60,
"unitPrice": 30,
"unitDiscount": 5,
"subTotal": 60,
"baseUnitPrice": 70,
"baseTotal": 60,
"total": 60,
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-01-01T00:00:00.000Z",
"convertedAmounts": {
"price": 60,
"discountAmount": 10,
"baseUnitPrice": 70,
"subTotal": 60,
"unitPrice": 30,
"taxAmount": 12,
"taxPercent": 15,
"baseTotal": 60,
"total": 60
},
"addons": [
{
"name": "Addon 1",
"unitPrice": 10,
"description": "Addon description"
},
{
"name": "Addon 2",
"unitPrice": 20,
"description": "Addon description"
}
],
"fees": [
"6780f1ba7a8b9c0d1e2f3a4b",
"6780f1ba8b9c0d1e2f3a4b5c"
],
"memberships": [
"6780f1ba9c0d1e2f3a4b5c6d"
]
}
],
"processingFeeLine": {
"taxPercent": 12,
"taxAmount": 15,
"price": 60,
"discountAmount": 10,
"unitPrice": 30,
"baseUnitPrice": 70,
"subTotal": 60,
"baseTotal": 60,
"total": 60,
"convertedAmounts": {
"taxPercent": 12,
"taxAmount": 15,
"price": 60,
"discountAmount": 10,
"unitPrice": 30,
"baseUnitPrice": 70,
"subTotal": 60,
"baseTotal": 60,
"total": 60
},
"description": "Membership fee",
"account": "6780f1ba5e6f7a8b9c0d1e2f",
"plan": "6780f1ba6f7a8b9c0d1e2f3a",
"fee": "6780f1ba7a8b9c0d1e2f3a4b",
"location": "6780f1ba4d5e6f7a8b9c0d1e",
"membership": "6780f1ba9c0d1e2f3a4b5c6d",
"taxRate": "6780f1ba1e2f3a4b5c6d7e8f",
"discount": 10,
"unitDiscount": 5,
"quantity": 2,
"startDate": "2023-01-01T00:00:00.000Z",
"endDate": "2023-01-01T00:00:00.000Z",
"addOns": {
"name": "Basic addon",
"unitPrice": 10,
"description": "Addon description"
},
"fees": [
"6780f1ba7a8b9c0d1e2f3a4b",
"6780f1ba8b9c0d1e2f3a4b5c"
],
"memberships": [
"6780f1ba9c0d1e2f3a4b5c6d",
"6780f1ba0d1e2f3a4b5c6d7e"
]
},
"taxAmounts": [
{
"percent": 25,
"total": 25.7,
"taxRate": "6780f1ba1e2f3a4b5c6d7e8f"
}
],
"subTotal": 60,
"amount": 60,
"payableAmount": 60,
"accounting": {
"provider": "xero",
"providerId": "123456789",
"externalOrgId": "987654321",
"deepLink": "https://quickbooks.com/123456789",
"lastSync": "2025-01-01T00:00:00.000Z",
"error": "An error occurred while syncing with Xero"
},
"baseTotal": 60,
"total": 80,
"paidAmount": 40,
"pendingAmount": 40,
"allocatedAmount": 40,
"currency": "USD",
"currencyConversionRate": 0.98567,
"isPaid": true,
"chargeMethod": "Credit Card",
"createdAt": "2025-01-01T00:00:00.000Z",
"createdBy": "6780f1ba4b5c6d7e8f9a0b1c",
"modifiedAt": "2025-01-01T00:00:00.000Z",
"modifiedBy": "6780f1ba4b5c6d7e8f9a0b1c"
}