Spend credits
Takes the credits that expire first, never the ones a hold set aside. With too few available credits nothing is taken and the answer is 409 `billing.credits.insufficient`. An `idempotency_key` (or the `Idempotency-Key` header) is required: a retried call returns the first result with `replayed: true` instead of charging twice.
Loading the operation...
Connect a customer and get the link to their customer page PUT
The one call a sign-in needs. `external_id` is your own id of the customer: a person's user id, or for an organisation your organisation id with the signed-in user as `member`. The customer is created when it does not exist, and its name, e-mail and language are updated when they changed (unchanged values write nothing). A `member` is added or updated; the first member of an organisation becomes its billing owner and every member uses the service. The link to the customer page is made for the billing owner only (for anybody else `url` is null and `billing_owner` false); it works for `expires_in_days` (default 1). With `plan_code` and no running subscription, the page opens with that plan chosen. A new organisation without `email` takes its first member's e-mail as its billing contact.
Record that the customer withdrew from a contract POST
The seller decides and refunds; this keeps the statement, when it arrived and who decided what. Sends the webhook event contract.withdrawal_requested. The refund follows the seller's decision, never the statement: see setContractWithdrawalStatus and requestContractWithdrawalRefund. Needs customers:write.