Skip to main content
POST
Initiate a payment (deprecated)

Headers

Authorization
string
default:NONE
required

Bearer JWT for user-facing flows (Bearer eyJraWQ...), or the literal string NONE when authenticating via API key.

Example:

"Bearer eyJraWQ..."

X-Api-Key
string
default:NONE
required

API key for server-to-server flows, or the literal string NONE when authenticating via JWT.

Example:

"pcx_abc123_xxxx"

Body

application/json

Same as PaymentInitiationRequest but org_id and user_id are injected from the authenticated API key — do not include them. Only same-currency flows are supported on this endpoint.

amount
number<float>
required
target_amount
number<float>
required

Must equal amount (same-currency only).

currency
string
required
Example:

"KES"

target_currency
string
required

Must equal currency.

Example:

"KES"

country
string
required
Example:

"KE"

payment_method
enum<string>
required
Available options:
mobile_money,
bank_transfer,
card
direction
enum<string>
Available options:
payin,
payout
client_reference
string | null
description
string | null
payer_details
object
mobile_money_details
object | null
bank_details
object | null
bank_account
object | null
beneficiary_id
string | null
return_url
string<uri> | null

URL the customer is redirected back to after completing payment. When next_action is redirect, the hosted checkout carries this URL through the flow and sends the customer to it once checkout finishes. PCX appends status (completed or failed) and reference (your client_reference, or a payment ID prefix) query parameters to this URL on the return redirect.

metadata
object | null

Response

Payment initiated

statusCode
integer
Example:

200

response
object

When the provider returns funding instructions (for example a bank transfer flow), the instruction fields are merged into this object at the top level alongside the fields below.