Prerequisites
Before you begin, make sure you have:
- An Orafi account — sign up here
- A completed business profile (onboarding)
- Your test API key from the dashboard
Both test and live environments use the same base URL: https://api.orafi.app. Your API key determines which mode you’re operating in.
Step 1 — Create a payment
Use the hosted checkout flow to create a payment. Orafi returns a checkoutUrl that you redirect your customer to.
curl -X POST https://api.orafi.app/transactions/payment/create \
-H "Content-Type: application/json" \
-H "x-api-key: ora_test_your_api_key" \
-d '{
"amount": 10000,
"customer": {
"fullname": "John Doe",
"email": "john@example.com"
},
"txRef": "order_12345",
"redirectUrl": "https://yourapp.com/payment/success"
}'
Response:
{
"success": true,
"message": "Payment created successfully",
"data": {
"payment": {
"id": "cmjw65j510001v81cilq0u13v",
"depositAddress": "0x02c362...82f66",
"amount": 10000,
"amountInUSDC": 6.92,
"redirectUrl": "https://yourapp.com/payment/success"
},
"checkoutUrl": "https://checkout.orafi.app/cmjw65j4z0000v81c16vtqj14"
}
}
Redirect your customer to the checkoutUrl. They’ll complete the payment there, then be sent back to your redirectUrl.
Step 2 — Verify the payment
Once the customer is redirected back, verify the payment status server-side.
curl -X POST https://api.orafi.app/transactions/payment/verify \
-H "Content-Type: application/json" \
-d '{
"paymentId": "cmjw65j510001v81cilq0u13v"
}'
Response:
{
"success": true,
"message": "Payment verification completed",
"data": {
"status": "completed",
"paymentId": "cmjw65j510001v81cilq0u13v"
}
}
Step 3 — Listen for webhooks (recommended)
Instead of polling, register a webhook to get notified in real-time when payments complete or fail.
curl -X POST https://api.orafi.app/v1/webhook/register \
-H "Content-Type: application/json" \
-H "x-api-key: ora_test_your_api_key" \
-d '{
"url": "https://yourapp.com/webhooks/orafi"
}'
Then subscribe to events:
curl -X POST https://api.orafi.app/webhook/subscribe \
-H "Content-Type: application/json" \
-H "x-api-key: ora_test_your_api_key" \
-d '{
"event": "payment.success"
}'
See the Webhooks guide for full setup details.
Next steps