Skip to navigation

Create a payment allocation

Applies a succeeded payment to a finalized invoice of the same customer, in the payment’s currency. Leave out amount to pay what the invoice still owes, up to what’s left of the payment. Paid spreads it across the invoice’s open lines, and an invoice paid in full becomes paid.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Headers

Paid-BetaenumRequired

This endpoint is in the payments=v1 beta. Send this header to use it.

Allowed values:

Request

Body
invoicestringRequired1-255 characters

The inv_ to pay. It must be finalized.

paymentstringRequired1-255 characters

The pay_ to apply. It must have succeeded.

amountintegerOptional<=9007199254740991
Minor units of the payment's currency. Leave it out to pay what the invoice still owes, up to what's left of the payment.
metadatamap from strings to stringsOptional

String key-value pairs of your own, up to 500 characters per value. Always updatable.

Response

201
idstring
The payment allocation's ID.
objectenum

The type of object. Always paymentAllocation.

Allowed values:
createdAtdatetime
When the object was created.
amountinteger

Minor units of currency.

currencystring

Lowercase ISO 4217 currency code, e.g. usd.

invoicestring1-255 characters

The inv_ it pays.

livemodeboolean

true for an object on a live account, false on a test account.

metadatamap from strings to strings

String key-value pairs of your own, up to 500 characters per value. Always updatable.

paymentstring or object

The pay_ whose money it applies. Expandable: expand=payment returns the payment. The full payment object when the request expands payment.

statusenum

active while the money is applied to the invoice, voided once void reverses it, which is final. Expect new values.

Allowed values:
updatedAtdatetime
When the object was last changed.
voidedAtdatetime or null

When the allocation was voided, or null.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error