Guides
Accept a card-present payment in five calls
Create a merchant and a simulated terminal, push a payment, choose the outcome, and read the result, with no hardware.
Everything below runs with a zp_test_ key and never moves money. $B is the base URL and $KEY your key. Every POST that creates something needs an Idempotency-Key header (any unique string).
1. Create a merchant
Response 201:
{"object":"merchant","id":"mch_01j...","created":1757100000,"livemode":false,"display_name":"Corner Gym","state":"active","processor_connected":true,"metadata":{}}2. Create a simulated terminal
Response 201 includes "status":"online" and "sim_behavior":"manual". Use "sim_behavior":"auto_approve" if you want the terminal to answer by itself after sim_delay_s seconds, which is closer to how a real terminal behaves.
3. Create the payment
Response 202:
{"object":"payment","id":"pay_01j...","state":"pending","expires":1757100180,"terminal_id":"term_01j...","amount_cents":1250,"failure_code":null,"receipt_url":null, "...": "..."}platform_reference is your own order id and must be unique per merchant. Reusing one returns 409 platform_reference_in_use with the existing payment id, which is exactly what you want after a crash.
4. Be the customer (sandbox only)
outcome is approve, decline, cancel, or timeout. The response is the payment in its new state. The same payment.processing and payment.succeeded events fire as with a real terminal, so your webhook code sees the real thing. This endpoint does not take an Idempotency-Key: it is meant to be called once per outcome you want to try, not replayed.
5. Read the result
state is succeeded, card_last4 is 4242, and receipt_url points at a hosted receipt you can show the customer. If you registered a webhook, you already received payment.succeeded with the same object under data.object.
What to do with each state
pending and processing mean keep waiting (poll or wait for the webhook). Before fulfilling a succeeded payment, match its merchant, reference, currency and amount to the trusted order and inspect its refunded balance. A failed local state is not always proof of no charge: processor_unverified, amount_mismatch, unknown failure codes and attention events require review. Cancellation and expiry still need late-authorization handling. The handle-every-payment-state guide has the full table. To request stopping a pending or processing terminal payment, use the separately authorized POST /v1/payments/{payment_id}/cancel operation.
With a physical terminal
The same five calls, with the customer instead of the simulate endpoint. Nothing is installed on the device: the sale is pushed to the terminal's built-in payment bridge over the processor's cloud.
POST /v1/merchants/{merchant_id}/terminals/discoverlists the activated card readers on the merchant's processor account (device_id,serial,store_name).POST /v1/merchants/{merchant_id}/terminalswith{"kind":"physical","device_id":"urn:tid:...","label":"Counter"}registers one. The terminal object carriesstore_id.POST /v1/paymentsas above, plus"terminal_options": {"tip": true, "receipt_screen": false}if the customer may tip or should see the device's receipt screen (both default false). Response202withstate: pendingandexpiresthree minutes out. The screen shows the amount at once.- The customer taps, inserts, or swipes. About a minute later the payment is
succeeded(withcard_last4,card_brand,tip_cents,receipt_url),failed(card_declined), orcanceled(canceled_on_terminal). PollGET /v1/payments/{payment_id}or take the webhook. POST /v1/payments/{payment_id}/cancelclears the screen and ends the paymentcanceled_by_platform. A payment nobody answers clears the screen atexpiresand endsexpired.
One payment at a time per physical terminal: a second POST /v1/payments on a busy terminal answers 409 terminal_busy and names the payment in flight. If the processor refuses the push, the answer is 502 processor_unavailable and the payment stays pending: retry the same request (same platform_reference, same amount) and it resumes. That retry pushes the sale to the device again, so retry only after a 502, never as a way to poll: to follow a payment that is already on the screen, use GET /v1/payments/{payment_id} or the webhook.
We never trust the terminal's report alone: every result is re-read from the processor and its reference, currency, and amounts must match what you asked for. An authorization that does not match, or arrives after a failed, canceled or expired payment, triggers an automatic void attempt (failure_code: amount_mismatch, or the payment.reversed_late event). An additional authorization on an already succeeded payment is left standing and raises payment.needs_attention with reason additional_authorization; it requires operator review. A partial approval (the card approved only part of the amount) is never accepted: it is voided the same way and the payment ends failed / partial_approval, not amount_mismatch; ask for another card. A tip the terminal added and the payment allowed is never read as a partial approval. On a terminal sale with an on-screen tip the processor reports the approved amount as order plus tip (VERIFIED on the sandbox 11/17/2026: a 1.00 order tipped 0.18 read approvedAmount 118, amounts.orderAmount 100, tipAmount 18, transactionAmount 118, statusCode "1", partiallyApproved false; with no tip, 100 and 100); the shape of a real terminal partial approval is not yet verified. For an amount mismatch, if the processor refuses the void, the authorization stays standing while the payment ends failed / amount_mismatch. A refused late void preserves the existing failed, canceled or expired state. We log and reconcile these cases; neither local failure nor cancellation is proof that nothing was charged.
Test mode shares a sandbox processor account, so physical terminals are reserved for approved platforms: otherwise registration answers 400 physical_terminal_unavailable. Start with simulated terminals; physical device behavior requires a separately authorized hardware trial. Live merchant onboarding, live terminal registration and live payment writes are not available in this release.
Next
Register a webhook (guide: webhooks), refund the payment (guide: refunds-and-voids), then run the integration_checklist tool.