post
https://connect.agendapro.com/v3/carts//transactions
Records a payment that you already collected outside AgendaPro (for example, on your own card terminal) against a cart. AgendaPro creates the sale, or updates it for a partial payment, as for a payment at the front desk. The response is the recorded transaction, the same object GET /v3/sales/{id} lists in transactions[].
Important Notes
- Requires
carts:writescope. - Not processed by AgendaPro. The payment does not go through the AgendaPro checkout: there is no fee and no settlement.
payment_methodis{ id, type }, copied from an element ofGET /v3/payment_methods. It is the same shape aspayment_methodinGET /v3/sales/{id}. Ids differ between companies and between environments (staging and production): always read them fromGET /v3/payment_methods, never write them into your code.external_referenceis required. Send the reference of the payment in your system. Sending the sameexternal_referenceagain for the same cart, with the same amount, tip and payment method, returns the payment already recorded with200and creates nothing.- Retry after a timeout. If you get
502 upstream_unavailable, the payment may still have been recorded. Retry with the sameexternal_reference: you get either the recorded payment (200) or a new one (201), never a duplicate. - Partial payments. An
amountbelow the pending amount leaves the salepartially_paid. Another call pays the rest, with any payment method. paid_atis optional and defaults to now. It must be an ISO 8601 timestamp with a time zone (Zor±hh:mm).- Pending online payment. If the cart has a pending payment request (for example, an online checkout from
POST /v3/carts/{id}/payment_requests), this call returns409 pending_payment_request, because the customer could be paying it. Cancel it first withPATCH /v3/payment_requests/{id}/cancel. - On-demand bookings. Your terminal collects the payment before this call, so if a cart item books a service on the fly (
reference_id: null), its time slot could be taken by then. To avoid that, create the booking first withPOST /v3/bookingsand add it to the cart byreference_id. - Business errors proxied from platform-sales use legacy single-key codes (for example
cart_not_found,amount_exceeds_pending), not the{error, detail}shape. - No webhook is sent for these payments: the response of this call is the confirmation.
Errors Dictionary
| Status | Error | Detail | Description |
|---|---|---|---|
| 400 | invalid_body | expected_object | Request body is not a JSON object. |
| 400 | missing_external_reference | external_reference is missing or blank. | |
| 400 | payment_request_invalid_amount | amount is missing. | |
| 400 | missing_payment_method | payment_method is missing. | |
| 400 | invalid_payment_method | payment_method is not an object with a numeric id and a type. | |
| 400 | invalid_paid_at | paid_at is not an ISO 8601 timestamp with a time zone. | |
| 400 | invalid_amount | amount is not a decimal number (for example "12abc"). | |
| 400 | invalid_tip | tip is not a decimal number. | |
| 401 | unauthorized | invalid_api_key | Missing or invalid Bearer token. |
| 401 | unauthorized | api_config_inactive | API access is inactive for this company. |
| 403 | forbidden | scope_denied | API key lacks carts:write scope. |
| 404 | cart_not_found | Cart not found for this company. | |
| 404 | payment_method_not_found | payment_method is not an element of GET /v3/payment_methods. | |
| 409 | pending_payment_request | The cart has a pending payment request. Cancel it first. | |
| 422 | external_reference_taken | The external_reference was already used on this cart with another amount, tip or payment method. | |
| 422 | invalid_amount | The amount is zero or negative. | |
| 422 | invalid_tip | The tip is negative. | |
| 422 | amount_exceeds_pending | The amount is above the cart's pending amount. | |
| 422 | cart_paid | The cart is already paid. | |
| 422 | cart_expired | The cart has expired (older than 24 hours). | |
| 429 | rate_limited | burst_limit_exceeded | Per-minute request limit exceeded. |
| 429 | rate_limited | daily_quota_exceeded | Daily request quota exceeded. |
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
