Create a purchase
const url = 'https://app.mondochat.io/v1/purchases';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"conversation_id":"0199d6a0-2000-7000-8000-000000000001","item_id":"private-show"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.mondochat.io/v1/purchases \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "conversation_id": "0199d6a0-2000-7000-8000-000000000001", "item_id": "private-show" }'Starts a purchase in a conversation. Send exactly one of item_id, offer_message_id or amount_minor (a custom amount, where commerce.custom_amount is on). Takes a session token and an Idempotency-Key header. The purchase is created pending and follows commerce.payment_mode. server_charge calls your charge callout: paid marks it paid, insufficient answers next as a redirect to topup_url or commerce.topup_url_template, failed marks it failed, and pending is checked again after 30 seconds, 2 minutes, 10 minutes and 1 hour. page_callback answers next as page_callback: the host page pays and your server confirms. checkout_url answers a redirect to commerce.checkout_url_template filled in, and your server confirms. See https://docs.mondochat.io/guides/commerce/.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Successful Response
A purchase and what to do next.
object
The buyer’s id.
When the purchase was created.
ISO 4217 currency of the price.
The purchase’s id.
How it is paid: the app’s commerce.payment_mode, or external for a purchase recorded from your server.
The price in minor units.
The seller’s id.
pending until paid; insufficient when the balance was short.
Example
{ "buyer_id": "0199d6a0-1000-7000-8000-000000000002", "conversation_id": "0199d6a0-2000-7000-8000-000000000001", "created_at": "2026-11-01T09:30:00Z", "currency": "EUR", "external_ref": "order-1042", "id": "0199d6a0-7000-7000-8000-000000000001", "item": { "id": "private-show", "kind": "show", "title": "Private show" }, "mode": "server_charge", "next": { "type": "done" }, "price_minor": 1500, "seller_id": "0199d6a0-1000-7000-8000-000000000001", "status": "paid"}Problem
An RFC 9457 problem: the body of every error answer.
object
The stable error code to branch on, such as policy_denied.
What went wrong this time, when there is more to say.
For validation, one entry per invalid field.
One invalid field.
object
The path to the field.
What is wrong with it.
The path of the request.
For policy_denied and limit_reached, the rule or limit that refused the request; for forbidden, a short cause such as you_blocked; for banned, temporary when the ban expires.
The HTTP status code.
A short summary of the problem.
A URL that names the problem, https://app.mondochat.io/problems/<code>.
Example
{ "code": "policy_denied", "detail": null, "instance": "/v1/conversations/0199d6a0-2000-7000-8000-000000000001", "reason": "pins", "status": 403, "title": "Policy denied", "type": "https://app.mondochat.io/problems/policy_denied"}