Skip to main content

1. Get your API key

Create a secret key (sk_...) from the Orqex dashboard. Keep it server-side.

2. Create a payment intent

curl https://api.orqex.com/v1/payment/intents \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50,
    "currency": "XOF",
    "description": "Order #1024",
    "customer": { "email": "[email protected]", "first_name": "Ama", "last_name": "Mensah" }
  }'

3. Start a payment attempt

Pick a method and country. For mobile money, include the payer’s phone.
PHP SDK
$intent = $orqex->paymentIntents()->attempt($intent->id, [
    'method_code' => 'momo_mtn',
    'country'     => 'CI',
    'phone'       => ['number' => '0700000000', 'country' => 'CI'],
]);

4. Resolve the next action

PHP SDK
$action = $intent->active_attempt?->next_action;

switch ($action?->type) {
    case 'redirect_to_url':  // send the customer to $action->url
    case 'collect_otp':      // collect an OTP, then confirm()
    case 'approve_on_phone': // ask the customer to approve on their phone
}
If the method needs an OTP, confirm it:
PHP SDK
$intent = $orqex->paymentIntents()->confirm($intent->id, ['otp' => '123456']);

5. Read the final status

PHP SDK
$intent = $orqex->paymentIntents()->retrieve($intent->id);

if ($intent->status === 'completed') {
    // fulfil the order
}

Next: Authentication

Secret keys, environments and idempotency.