Get Payments by API Key

Retrieve a filtered list of payments associated with the provided API key.

Endpoint

GET /api/paiements/api-key

Query Parameters

pagenumber
Page number (starts from 0)
sizenumber
Number of items per page
transaction_typestring
Transaction type filterAllowed values:
  • PAYMENT
  • DIRECT_PAYMENT
  • TRANSFERT
  • RECHARGE
statusstring
Payment status filterAllowed values:
  • INIT
  • PENDING
  • COMPLETE
  • FAILED
  • TIMEOUT
dateFromnumber
Start date timestamp (Unix timestamp)
dateTonumber
End date timestamp (Unix timestamp)

Example Request

GET /api/paiements/api-key?page=0&size=20&transaction_type=PAYMENT&status=COMPLETE&dateFrom=1704067200&dateTo=1706745600
X-API-Key: sk_test_your_api_key_here

Response

Response Body Example

[
  {
    "id": "payment_456",
    "reference": "API_PAY_REF_123456789",
    "amount": 2500,
    "description": "API payment for subscription",
    "status": "PENDING",
    "transaction_type": "PAYMENT",
    "phone": null,
    "service_mobile_code": null,
    "extra_data": {
      "subscription_id": "sub_789",
      "plan": "premium"
    },
    "createdAt": "2024-01-16T14:20:00Z",
    "updatedAt": "2024-01-16T14:20:00Z",
    "organization_id": "org_123",
    "api_key_id": "key_456"
  },
  {
    "id": "payment_457",
    "reference": "API_DIRECT_REF_987654321",
    "amount": 1500,
    "description": "API direct payment",
    "status": "COMPLETE",
    "transaction_type": "DIRECT_PAYMENT",
    "phone": "+2250506070809",
    "service_mobile_code": "MTN_CI",
    "extra_data": {
      "merchant_ref": "MERCH_001"
    },
    "createdAt": "2024-01-16T15:30:00Z",
    "updatedAt": "2024-01-16T15:35:00Z",
    "organization_id": "org_123",
    "api_key_id": "key_456"
  }
]

Pagination Metadata

{
  "data": [], // Array of payments
  "total": 75,
  "page": 0,
  "size": 20,
  "totalPages": 4
}

Error Responses

401 Error Example

{
  "statusCode": 401,
  "message": "Invalid API key",
  "error": "Unauthorized"
}

403 Error Example

{
  "statusCode": 403,
  "message": "API key does not have permission to access payments",
  "error": "Forbidden"
}