Introducing the Chargebee CLI

Create a collections payment promise

Creates a collections payment promise that records a customer's commitment to pay by promised_on. The response is a list with one promise for each covered invoice.

To cover one invoice, pass invoice_id and an amount equal to that invoice's amount due. That invoice must not already have an active promise. Without invoice_id, open invoices are covered oldest due date first, and invoices that already have an active promise are skipped. amount must equal the combined amount due of the invoices covered in that order. Any other amount is rejected. If open invoices span more than one currency, pass currency_code.

Each covered invoice's active reminder sequence is paused until you resume it. It does not resume when the promise ends. Without invoice_id, the request is rejected when the customer has more than 200 open invoices or active promises.

Sample Request

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/collections_payment_promises

Input Parameters

customer_id
required, string, max chars=100

Customer making the promise. This field is required.

invoice_id
optional, string, max chars=100

Invoice to cover. Leave out to cover the customer's open invoices, oldest due date first.

amount
required, long

Amount the customer promises to pay, in the currency's smallest unit (for example, cents). With invoice_id, it must equal that invoice's amount due. Without invoice_id, it must equal the combined amount due of whole open invoices, taken oldest due date first. Any other amount is rejected.

currency_code
optional, string, max chars=3

ISO 4217 currency code. Without invoice_id, only open invoices in this currency are covered, and currency_code is required when the customer's open invoices are in more than one currency. Ignored when invoice_id is passed.

promised_on
required, timestamp(UTC) in seconds

Timestamp in UTC seconds for the date on which the customer promised payment. This field is required.

reason
optional, string, max chars=500

Optional context about why or how this promise was recorded.

promised_by
optional, string, max chars=254

Name or identifier of the user or agent who captured this promise.

Returns

One collections_payment_promise resource for each covered invoice.