Record closings with the API
Mark a Sales Router chat as a sale from your payment system, invoice tool or CRM by sending its Ref code and value to the API.
Updated October 12, 2026
Every chat Sales Router sends can carry a Ref code such as Ref: IB-7F3A09C2D1 at the end of the first WhatsApp message. When the sale is paid, your own system can record the closing with that code, instead of an agent doing it by hand. It needs a Read & write key and Pro or a higher plan.
The request
Send POST /api/v1/closings with a JSON body such as {"referenceToken": "IB-7F3A09C2D1", "value": 250000}.
| Field | Required | Notes |
|---|---|---|
| referenceToken | Yes | The Ref code. Case doesn’t matter, and text around the code is ignored, so a whole message works too. |
| value | Yes | The sale value as a number, 0 or more. IDR values are whole numbers; other currencies allow their usual decimals. |
| currency | No | A 3-letter code. If you send it, it must match the team’s closing currency. |
| replace | No | true to change the value of a chat that already has a closing. |
What you get back
| Status | Code | Meaning |
|---|---|---|
| 201 | Closing recorded. | |
| 200 | Existing closing replaced (with replace: true). | |
| 409 | already_closed | The chat already has a closing. The current one is in details. Send replace: true to change it. |
| 409 | currency_mismatch | The team records sales in another currency. Send that currency, or leave currency out. |
| 404 | reference_not_found | No routed chat with this Ref in this workspace. |
| 400 | invalid_reference | The text doesn’t contain a Ref code (IB- followed by letters and numbers). |
About the currency
Each Sales Team records closings in one currency, set under Closing tracking on the team. A value from the API is always stored in that currency. Leaving currency out is the simplest option; sending it is a safety check that catches a team whose currency was changed.
Good to know
- A recorded or changed closing also fires the Closing recorded webhook event.
- GET /api/v1/closings lists closings with totals per currency, and works with a Read only key.
- The Ref only appears when Source reference (Ref) in the WhatsApp message is on for the team.
Examples and every field are in the API reference.
Full tutorialHow to track which WhatsApp chats turn into salesRead the guideRelated articles
- Record a sale (closing) from a WhatsApp chatMark a routed chat as a sale with its value: find it by its Ref code, click Mark sale and enter the amount. Agents can do it on their own page, and your systems through the API.
- Choose the currency for a team’s salesEach Sales Team records closings in one currency, chosen from 22. Pick it when you create the team and change it anytime under Closing tracking; past closings keep their own currency.
- Create an API keyCreate a key on the Developer page to use the iBuat.Link API from your own apps or tools like n8n. Choose Read only or Read & write. Pro and higher plans.
- Webhook events and what they containThe 10 events a webhook can send, when each one fires, what the JSON body looks like and how the Sales Team filter works.
Still need help?
Send us a ticket from your dashboard: the headset button at the top right, then Contact support. We reply there and by email.