Skip to content

Creating a Transaction

Transactions Write

Create a new payment transaction for a booking. Transactions record payment intent and prepare the booking for payment confirmation. This is typically the first step in the payment flow.

Multiple Providers
Payment Options
Auto-Invoice
Generation
Reference ID
Tracking

Endpoint

POST {{base_url}}/transactions/

Headers

Header Value Description
Content-Type application/json Specifies the media type
Authorization Bearer {{ token }} Authentication token

Body Parameters

Parameter Type Required Description
booking integer Yes The booking ID associated with the transaction
provider string Yes Payment provider code (e.g., OPY, FLW, PSK)
payment_method string Yes Payment method: CASH, CARD, TRANSFER, WALLET
customer_name string Yes Name of the customer making the payment
description string Yes Brief description of the transaction
name string Yes Transaction name/title
phone_number string Yes Customer's phone number with country code
bill_to integer Yes Bill ID associated with the transaction

Sample Request

{
  "booking": 838,
  "provider": "OPY",
  "payment_method": "CASH",
  "customer_name": "John Doe",
  "description": "Payment for Lagos to Abuja express shipment",
  "name": "payment for multi piece booking",
  "phone_number": "+2348101020304",
  "bill_to": 89
}

Response

{
  "message": "success!",
  "status_code": 200,
  "payload": {
    "provider": "OPY",
    "amount": {
      "total": 10893.0,
      "currency": "NGN"
    },
    "customer_name": "John Doe",
    "status": 1,
    "booking": 838,
    "invoice": 353,
    "reference_number": "c106e7ea-dff1-4e9d-b973",
    "date_time": "2024-11-04T03:37:18.681328+01:00"
  }
}

Response Fields

Field Type Description
message string Success or error message
status_code integer HTTP status code
payload object Transaction details object
payload.provider string Payment provider code
payload.amount object Amount details with total and currency
payload.amount.total number Total transaction amount
payload.amount.currency string Currency code (NGN, USD, etc.)
payload.customer_name string Name of the customer
payload.status integer Transaction status (1 = pending, 2 = confirmed)
payload.booking integer Associated booking ID
payload.invoice integer Auto-generated invoice ID
payload.reference_number string Unique transaction reference for tracking
payload.date_time string Transaction creation timestamp (ISO 8601)

Payment Providers

Code Provider Description
OPY Opay Nigerian fintech payment gateway
FLW Flutterwave Pan-African payment gateway
PSK Paystack African payment infrastructure

Payment Methods

Method Description
CASH Cash payment at branch location
CARD Credit/debit card payment
TRANSFER Bank transfer
WALLET Digital wallet payment

Next Step

After creating a transaction, use the Confirming Payment endpoint to finalize the payment and update the booking status.