Overview
Orders represent the commerce lifecycle (placed/shipped/delivered/cancelled). Use these endpoints for merchant dashboards and operational tooling.Authentication
Requiresx-commerce-api-key.
Request
List merchant orders
Retrieve an order
Cancel an order
Devnet order simulation (devnet only)
Use this to advance a devnet order through its lifecycle for integration testing and to trigger the same webhook + event stream updates you will receive in production.How it works
- Requires a devnet commerce API key and only operates on orders created in
devnet. - Each simulation emits a
commerce.order.updatedmerchant webhook event and a matching event on the commerce WebSocket stream. - If the simulated transition changes the linked invoice state, corresponding
invoice.*events are emitted as well.
Suggested end-to-end test flow
- Create a devnet order + invoice via
commerce.checkout.createInvoice(saveorderIdandinvoiceId). - Configure webhooks or connect a WebSocket listener (examples below).
- Simulate the happy path sequence:
payment_confirmedpayment_settledplacedshipped(includetracking)delivery_confirmed
- Optionally test failure paths:
failed(only valid fromstatus=processing)cancelled(only valid fromstatus=placed)refunded(requires a valid BSC refund destination)
Webhook setup (merchant)
Configure webhooks in the dashboard (or via/api/v1/webhooks/*) to receive:
X-Pepay-Event: commerce.order.updateddata.object.idset to the orderId you simulated
WebSocket updates (commerce stream)
Response
Example merchant order snapshot (truncated):Errors
401missing/invalid commerce API key404order not found400missingIdempotency-Keyon cancel
Examples
- When building an order dashboard, combine:
- order snapshot (
orders.retrieve) - payment status (
payments.status) - invoice reconciliation (
merchantInvoices.status) Next: Payments
- order snapshot (

