Payments
An order has one payment_method:
| Value | What happens |
|---|---|
cash | Collected by the rider (delivery) or at the counter (pickup). payment.status stays pending until the restaurant records it. |
card | The order is held until the customer pays on GoOrder’s hosted payment page. |
Card payments
Section titled “Card payments”You never handle card numbers. GoOrder’s payment provider hosts the page, so your integration stays out of PCI scope.
-
Create the order with
payment_method: "card". It is created asplacedwithpayment.status: "pending", and is not sent to the restaurant until it is paid. -
Request a payment link:
Terminal window curl -X POST https://back.goorder.com/api/partner/v1/orders/ORDER_ID/payment \-H "Authorization: Bearer $GOORDER_API_KEY" -H "Content-Type: application/json" -d '{}'{ "data": { "order_id": "66f1…", "payment_url": "https://…", "environment": "live" } } -
Send the customer to
payment_url(redirect, or open in an in-app browser). -
Wait for the result. GoOrder confirms payment server-to-server; you receive
order.payment_updatedwithpayment.status: "paid"and, a moment later, the restaurant starts receiving the order.
Rules to know
Section titled “Rules to know”- The link is single-use. If the customer comes back later, call the endpoint again for a fresh link.
- Do not rely on the customer returning to your site — they may close the tab. The webhook (or polling
GET /orders/{id}) is the source of truth. - A card order that is never paid is cancelled automatically after a period without payment. Treat
cancelledas final. - Calling the endpoint for an already-paid order returns
409 already_paid; for a cash order,409 invalid_payment_method.
Reading payment state
Section titled “Reading payment state”payment on every order:
{ "method": "card", "status": "paid", "amount": 67.0, "refunded_amount": 0, "currency": "AED" }status | Meaning |
|---|---|
pending | Not paid yet |
paid | Captured (card) |
failed | The payment attempt failed — request a new link |
partially_refunded | Part returned (refunded_amount > 0) |
refunded | All returned |
Refunds
Section titled “Refunds”Refunds are decided and executed by GoOrder (support or the restaurant) — there is no refund endpoint. You are told through order.refunded and by the order’s payment fields. A refund of a card payment returns to the customer’s card or their GoOrder wallet; a small payment-processing fee may be withheld by the processor.
Testing
Section titled “Testing”In the sandbox, POST /sandbox/orders/{id}/advance with {"payment":"paid"} or {"payment":"failed"} simulates the customer’s result and fires order.payment_updated. The sandbox payment_url is a placeholder; no real page is involved.