Skip to main content

API Endpoints

EnvironmentBase URL
Sandboxhttps://api.sandbox.zafapay.com
Productionhttps://api.zafapay.com

Authentication

All API requests require Bearer token authentication.
Authorization: Bearer YOUR_ACCESS_TOKEN
For instructions on obtaining an access token, see Authentication.

Request Format

  • Content-Type: application/json
  • Character encoding: UTF-8

Response Format

All responses are returned in JSON format. Success (Create Payment):
{
  "success": true,
  "status": "pending",
  "transaction_id": "tx_abc123",
  "gateway_transaction_id": "pi_xxxxx",
  ...
}
Success (Get Payment):
{
  "id": "tx_abc123",
  "status": "completed",
  "amount": 1000,
  ...
}
Error:
{
  "error": {
    "type": "invalid_request_error",
    "code": "VALIDATION_ERROR",
    "message": "Error message",
    "request_id": "req_abc123xyz789"
  }
}
For error code details, see Error Codes.

Transaction Status

StatusDescription
pendingPayment created, awaiting customer action (redirect flow)
requires_actionAwaiting frontend action (card payment)
authorizedAuthorization complete (awaiting manual capture)
completedPayment completed
failedPayment failed
canceledPayment canceled
partially_refundedPartially refunded
refundedFully refunded