DOC
/docs
Payment endpoints
POST
/payment
Create a payment

Forwards a payment request to the configured payment service and stores a pending order row.

Request

POST /payment
X-Tenant-ID: tenant-uuid

{
  "orderId": "ORDER-94",
  "amount": 10000,
  "currency": "ZAR",
  "userId": "41",
  "customer": { "email": "user@example.com" }
}

Response

{
  "data": {
    "paymentId": 87,
    "status": "pending"
  }
}
  • Register the webhook URL as /payment/webhook.
POST
/payment/webhook
Payment webhook

Receives provider status changes and updates the matching order row to succeeded or failed.

Request

POST /payment/webhook

{
  "event": "charge.success",
  "data": {
    "status": "success",
    "metadata": { "orderId": "ORDER-94", "paymentId": "87" }
  }
}

Response

{
  "received": true
}