Skip to content

Retrieve a payment

GET/v1/payments/{id}

Retrieves the full details of a payment, including customer information and metadata.

Path parameters

ParameterTypeDescription
idstringTransaction UUID

Headers

HeaderRequiredDescription
AuthorizationYesBearer zyn_test_... or Bearer zyn_live_...

Example

bash
curl https://backend.zayono.com/api/v1/payments/9e5f6a7b-8c9d-4e3f-a1b2-c3d4e5f6a7b8 \
  -H "Authorization: Bearer zyn_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
javascript
const response = await fetch(
  'https://backend.zayono.com/api/v1/payments/9e5f6a7b-8c9d-4e3f-a1b2-c3d4e5f6a7b8',
  {
    headers: {
      'Authorization': 'Bearer zyn_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    },
  }
)

const data = await response.json()
php
$response = Http::withToken('zyn_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
    ->get('https://backend.zayono.com/api/v1/payments/9e5f6a7b-8c9d-4e3f-a1b2-c3d4e5f6a7b8');

Response — 200 OK

json
{
  "message": "Payment details retrieved.",
  "data": {
    "id": "9e5f6a7b-8c9d-4e3f-a1b2-c3d4e5f6a7b8",
    "type": "payment",
    "status": "success",
    "amount": 5000,
    "amount_charged": 5100,
    "currency": "XOF",
    "operator": "mtn_bj",
    "country": "BJ",
    "description": "Premium subscription - March 2025",
    "checkout_url": null,
    "return_url": "https://your-site.com/payment/return",
    "failure_reason": null,
    "metadata": {
      "order_id": "ORD-2025-001",
      "plan": "premium"
    },
    "customer": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "email": "jean.dupont@example.com",
      "first_name": "Jean",
      "last_name": "Dupont",
      "phone": "+22990123456"
    },
    "environment": "sandbox",
    "processed_at": "2025-05-15T10:31:00+00:00",
    "created_at": "2025-05-15T10:30:00+00:00",
    "updated_at": "2025-05-15T10:31:00+00:00"
  },
  "errors": null
}

Response fields

FieldTypeDescription
idstringUnique identifier (UUID)
typestringTransaction type (payment)
statusstringCurrent status
amountnumberRequested amount (net received by the merchant)
amount_chargednumber | nullAmount actually charged to the customer, fees included. Equal to amount if no fee is configured on the method.
currencystringCurrency code
operatorstring | nullOperator code used
countrystring | nullCountry code
descriptionstring | nullPayment description
checkout_urlstring | nullCheckout URL (if checkout mode)
return_urlstring | nullRedirect URL
failure_reasonstring | nullFailure reason (if failed)
metadataobject | nullCustom data
customerobject | nullCustomer information
environmentstringsandbox or live
processed_atstring | nullProcessing date (ISO 8601)
created_atstringCreation date (ISO 8601)
updated_atstringLast update date (ISO 8601)

Official Zayono API documentation