Initialize Payment

Create a new payment transaction.

Endpoint

POST /api/paiements/initialize

Request Body

amountrequirednumber
The payment amount
descriptionrequiredstring
Description of the payment
extra_dataobject
Optional JSON object with additional data

Example Request

POST /api/paiements/initialize
X-API-Key: sk_test_your_api_key_here
Content-Type: application/json
{
  "amount": 1000,
  "description": "Payment for order #123",
  "extra_data": {
    "order_id": "123",
    "customer_id": "456"
  }
}

Response

Success Response Example

{
  "amount": 1000,
  "payment_status": "INIT",
  "currency": "XOF",
  "when_created": "2024-01-15T10:30:00Z",
  "launch_url": "https://payment.fastpay.com/links/PAY_REF_123456789",
  "reference": "PAY_REF_123456789"
}

Error Responses

400 Error Example

{
  "statusCode": 400,
  "message": [
    "amount must be a positive number",
    "description should not be empty"
  ],
  "error": "Bad Request"
}

401 Error Example

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