Quickstart
This guide uses the sandbox, which has test merchants and can create test orders. You need your sandbox token URL, client ID and client secret from the Loops Partners portal (Applications). Request access if you don’t have them yet.
-
Get an access token
Exchange your client ID and secret for an access token. Tokens last 15 minutes; request a new one when it expires.
Terminal window curl -X POST $LOOPS_TOKEN_URL \-d grant_type=client_credentials \-d client_id=$LOOPS_CLIENT_ID \-d client_secret=$LOOPS_CLIENT_SECRET{ "access_token": "eyJhbGciOi…", "expires_in": 900, "token_type": "Bearer" } -
Check a merchant connection
Every request names the merchant in the
Loops-Merchant-Idheader. Your sandbox comes with a test merchant.Terminal window curl https://sandbox.partners.loops.sa/v1/connection \-H "Authorization: Bearer $TOKEN" \-H "Loops-Merchant-Id: mer_7Hq2Lw8Z"The response shows the scopes and locations that merchant granted you.
-
List the merchant’s locations
Terminal window curl https://sandbox.partners.loops.sa/v1/locations \-H "Authorization: Bearer $TOKEN" \-H "Loops-Merchant-Id: mer_7Hq2Lw8Z" -
Create a test order (sandbox only)
Terminal window curl -X POST https://sandbox.partners.loops.sa/v1/sandbox/orders \-H "Authorization: Bearer $TOKEN" \-H "Loops-Merchant-Id: mer_7Hq2Lw8Z" \-H "Content-Type: application/json" \-d '{ "location_id": "loc_2Xf9K" }' -
Read orders
Terminal window curl "https://sandbox.partners.loops.sa/v1/orders?location_id=loc_2Xf9K&limit=10" \-H "Authorization: Bearer $TOKEN" \-H "Loops-Merchant-Id: mer_7Hq2Lw8Z" -
Receive webhooks
Add an endpoint in the Loops Partners portal and subscribe to
order.*. Verify each request’s signature before trusting it:import { Webhook } from "standardwebhooks";const wh = new Webhook(process.env.LOOPS_WEBHOOK_SECRET);app.post("/loops/webhooks", express.raw({ type: "application/json" }), (req, res) => {const event = wh.verify(req.body, req.headers); // throws if invalidqueue.push(event); // acknowledge fast, process laterres.sendStatus(200);});from standardwebhooks.webhooks import Webhookwh = Webhook(os.environ["LOOPS_WEBHOOK_SECRET"])@app.post("/loops/webhooks")def loops_webhook(request):event = wh.verify(request.body, request.headers) # raises if invalidqueue.put(event) # acknowledge fast, process laterreturn "", 200
© 2026 Loops Technologies | شركة لووبز للتقنيات. All rights reserved.
