Payments
List payment links
Return customer payment links with their amount and settlement status.
Returns payment links raised for customers, newest first, with the amount, provider and whether they have been paid, expired or cancelled. Use it to check whether a customer has already paid before chasing them, or before raising a second link. Read-only. Paginated: follow meta.pagination.nextCursor until hasMore is false.
query Parameters
limitRows to return, 1-100. Defaults to 25.
Rows to return, 1-100. Defaults to 25.
cursorThe meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
The meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
customerIdOnly this customer, id from customers.list.
Only this customer, id from customers.list.
conversationIdOnly this conversation, id from conversations.list.
Only this conversation, id from conversations.list.
statusPayment status, e.g. PENDING, PAID, EXPIRED or CANCELLED.
Payment status, e.g. PENDING, PAID, EXPIRED or CANCELLED.
List payment links › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successCreate a payment link
Raise a payment link for a customer and send it to them.
Creates a payment link at the configured provider and returns it (paymentUrl). It does not message the customer: send the link yourself with messages.send. It asks a real person for real money and cannot be recalled once the customer has it — cancelling invalidates the link but does not unsend a message that carries it. Use it only for an amount the workspace owner has confirmed, and check payments.list first so you do not raise a second link for something already paid. Requires the separate payments:write scope and is limited to 5 calls per minute. Send an Idempotency-Key header (1-255 characters, e.g. a UUID) and reuse it when you retry: the same key and body return the link the first call created instead of raising a second one, 409 PaymentIntentInProgress means the first call is still waiting on the gateway, and 422 IdempotencyKeyReused means the key was used for a different body. A 504/502 PaymentGatewayUnavailable with retryable: true created no link and is safe to retry. Use payments.providers to see which provider ids and paymentMethod codes exist.
Create a payment link › Request Body
customerIdCustomer id from customers.list.
amountAmount in whole units of the currency (whole rupiah for IDR), no decimals.
descriptionWhat the customer is paying for. They will see this.
conversationIdAttach the payment to a conversation from conversations.list.
channelTypeChannel of the conversation the payment belongs to.
channelAccountIdChannel account the conversation runs on, e.g. a phone number id.
currencyThree-letter currency code. Defaults to IDR.
providerPayment provider id from payments.providers. Defaults to midtrans.
expiryMinutesMinutes until the link expires, at least 5. Defaults to the provider setting.
paymentMethodProvider-specific payment method code from payments.providers. The provider rejects a code it does not declare.
Create a payment link › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successList payment providers
Return the payment providers the platform supports and their method codes.
Returns every provider the platform can raise a link with, with its id and the payment method codes it declares. Use it to pick valid provider and paymentMethod values for payments.create. It lists what the platform supports, not what this workspace has connected, and never includes credentials. Read-only.
List payment providers › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRead one payment link
Fetch a single payment link with its amount, expiry and settlement state.
Returns one payment intent: the customer, the amount, the provider, the link, when it expires and whether it settled. Use it to confirm a payment before delivering whatever it paid for. Read-only. Provider credentials are never included.
path Parameters
idPayment intent id from payments.list.
Payment intent id from payments.list.
Read one payment link › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successCancel a payment link
Invalidate an unpaid payment link so it can no longer be used.
Voids a payment link that has not been paid. A payment that already settled cannot be reversed here — refund it in the provider's dashboard. The customer keeps the message containing the dead link, so tell them yourself with messages.send. Requires payments:write and is limited to 5 calls per minute.
path Parameters
idPayment intent id from payments.list. A PAID intent cannot be cancelled.
Payment intent id from payments.list. A PAID intent cannot be cancelled.
Cancel a payment link › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRe-check a payment with the provider
Ask the payment provider for the real status and update the payment link.
Calls the provider to reconcile one payment, for when a settlement callback was missed and payments.get still says PENDING. It records the check and, if the provider reports a new status, updates the payment: a payment that turns out PAID also queues the workspace payment-received message to the customer, which cannot be recalled. Calls the provider on every use, so use it for one payment you have a reason to doubt, not in a loop. A provider amount that differs from the link is refused. Requires payments:write.
path Parameters
idPayment intent id from payments.list.
Payment intent id from payments.list.
Re-check a payment with the provider › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRead a customer ERP invoices
Return the invoices the connected ERP holds for a customer.
Asks the workspace ERP for the invoice history of one customer. The answer carries a status: ok with invoices, unlinked when this customer was never matched to an ERP patient, or an error when the ERP is unavailable (502 erp_unavailable). Do not read unlinked as "no transactions". Calls an external system, so use it for one customer at a time. Read-only.
path Parameters
customerIdCustomer id from customers.list.
Customer id from customers.list.
Read a customer ERP invoices › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRead the payments on an ERP invoice
Return the payment lines the ERP recorded against one invoice of a customer.
Returns the payments recorded on one invoice. The invoice must belong to the customer in the path (take invoiceId from customerPayments.erpTransactions); otherwise it answers 404. Calls an external system, so use it for one invoice at a time. Read-only.
path Parameters
customerIdCustomer id from customers.list.
Customer id from customers.list.
invoiceIdInvoice id from customerPayments.erpTransactions.
Invoice id from customerPayments.erpTransactions.
Read the payments on an ERP invoice › Responses
The API key is missing, malformed, expired, or its owner is inactive.
success