Skip to content

Quickstart

You need a sandbox key (it starts with gok_test_). If you do not have one yet, see Getting access.

  1. Set your key

    Terminal window
    export GOORDER_API_KEY="gok_test_xxxxxxxxxxxxxxxxxxxxxxxx"
  2. Check the connection

    Terminal window
    curl https://back.goorder.com/api/partner/v1/ping \
    -H "Authorization: Bearer $GOORDER_API_KEY"

    You should see "environment": "sandbox" and the scopes of your key.

  3. Find an open store near your customer

    Terminal window
    curl "https://back.goorder.com/api/partner/v1/stores?lat=25.2048&lng=55.2708&status=open&limit=5" \
    -H "Authorization: Bearer $GOORDER_API_KEY"

    Copy a store id. Only stores that deliver to that point are returned, nearest first.

  4. Read its menu

    Terminal window
    curl https://back.goorder.com/api/partner/v1/stores/STORE_ID/menu \
    -H "Authorization: Bearer $GOORDER_API_KEY"

    Copy an item id (look for "available": true).

  5. Create an order

    Terminal window
    curl -X POST https://back.goorder.com/api/partner/v1/orders \
    -H "Authorization: Bearer $GOORDER_API_KEY" \
    -H "Idempotency-Key: my-first-order-001" \
    -H "Content-Type: application/json" \
    -d '{
    "store_id": "STORE_ID",
    "fulfilment": "delivery",
    "items": [{ "item_id": "ITEM_ID", "quantity": 1 }],
    "customer": { "name": "Test Customer", "phone": "+971501234567" },
    "delivery_address": {
    "line1": "Marina Tower", "floor": "12", "apartment": "1204", "area": "Dubai Marina",
    "location": { "lat": 25.2048, "lng": 55.2708 }
    },
    "payment_method": "cash"
    }'

    The response is a 201 with an Order whose id starts with sbx_ and whose status is placed. Run the same request again with the same Idempotency-Key and you get the same order back instead of a second one.

  6. Move it through the lifecycle

    There is no restaurant in the sandbox, so you play it:

    Terminal window
    curl -X POST https://back.goorder.com/api/partner/v1/sandbox/orders/ORDER_ID/advance \
    -H "Authorization: Bearer $GOORDER_API_KEY" \
    -H "Content-Type: application/json" -d '{}'

    Each call moves to the next status (confirmed → preparing → ready → out_for_delivery → delivered) and fires the matching webhook.

  7. Read it back

    Terminal window
    curl https://back.goorder.com/api/partner/v1/orders/ORDER_ID/tracking \
    -H "Authorization: Bearer $GOORDER_API_KEY"