# Integrating Veyqo Veyqo connects a merchant's existing payment provider accounts through one API. Public API base: https://api.veyqo.org/api/v1 Documentation: https://veyqo.org/docs Full integration context: https://veyqo.org/llms-full.txt - Use Authorization: Bearer $VEYQO_SECRET_KEY on your server only. - API keys, project assignments and outgoing webhooks belong to one project environment. - Provider credential accounts may be dedicated or shared across projects in the same organization and environment type. Switch assignments for new payments; keep existing payments and refunds tied to their original account. - Start in sandbox. Use provider test credentials with your sandbox key. - Amounts are integers in the smallest currency unit: 50000 NGN is NGN 500.00. - Calculate prices from trusted server-side order data, never browser input. - POST /payments creates a payment; data.checkout_url is its checkout URL. - POST /checkout/sessions creates hosted checkout; data.id is the session ID. - Persist an Idempotency-Key per logical POST operation. Reuse it with the same body on retries; use a new key for a different operation. - Use GET /payments/{id} or POST /payments/{id}/verify to check a payment. - Verify requires payments:read; create requires payments:write. - Webhooks use Veyqo-Signature and Veyqo-Timestamp headers. - Verify HMAC-SHA256(secret, timestamp + '.' + raw request body), compare in constant time, accept any matching comma-separated signature during rotation, and reject timestamps more than 300 seconds from now. - Deduplicate events by event ID and make fulfilment idempotent. - Fulfil only after trusted server confirmation of succeeded status and a match on the stored order reference, amount and currency. A redirect is not proof. - POST /payments/{id}/refunds supports full or partial refunds (refunds:write). - Responses use { success, data } or { success: false, error: { code, message, details } }. - Check response status and success before reading data. Respect Retry-After. - Never log API secrets, invent SDK packages, or assume an MCP server exists. - Direct payments return checkout_url; checkout sessions return url. Do not invent checkout.url. - Public API requests and responses use snake_case. Dashboard/admin internals are not the integration API. - Browser checkout uses /checkout/v1 with a publishable key or session ID; prefer trusted server-created sessions. - Checkout retries may suffix the original reference. Save and verify the session/payment association, not metadata alone. - Read https://veyqo.org/api-reference.json or https://veyqo.org/openapi.json for all fields, examples and errors. - Fetch individual endpoint guides from https://veyqo.org/llms.txt when the full context is too large. - Never infer Nomba/Stripe/Paystack-specific API fields for Veyqo; use the Veyqo contract. - SafeHaven NGN collections use the normal payment API; banking, bills, identity and USSD use documented /safehaven extensions with explicit scopes. - All SafeHaven service writes require a persisted Idempotency-Key. Reconcile uncertain writes through /safehaven/operations before creating another debit. - Moving an app that already calls SafeHaven directly: connecting a dedicated SafeHaven account imports its existing sub-accounts automatically (progress on the connection page; on a shared account press Import accounts). POST /safehaven/accounts/import adopts specific accounts. Repoint SafeHaven's webhook URL to Veyqo only after the import completes. Credit deposits from provider_service.updated events with service account-credit, direction credit and status Completed: find the customer by credit_account_number, skip is_reversed, and deduplicate on session_id. All amounts are kobo. - Service notifications use provider_service.updated, a different data shape from payment events. Never use merchant metadata to select a project. - Add tests for duplicate events, invalid signatures, amount mismatches and retries. # Build once. Connect every provider. Your payment providers, behind one API. Start with a sandbox payment and take the same integration live. ## How Veyqo works Veyqo is a payment orchestration layer. Connect your own provider accounts, create payments through one API, and receive normalized events. Your connected provider processes the payment. An organization contains projects. Every project has separate sandbox and live environments. Keys, payments, checkout sessions and outgoing webhook endpoints belong to one environment. Provider credential accounts can be dedicated or explicitly shared within that organization and environment type. 1. Connect a provider using the credentials from your own provider account. 2. Your server creates a payment or hosted checkout session with a Veyqo API key. 3. The customer completes checkout using the selected provider. 4. Veyqo verifies the provider result and sends a signed event to your server. ## Dedicated or shared provider accounts Connect a new provider account for separate credentials, or choose Use an existing account to reuse a shared or unassigned account. Sharing is optional and stays within the same organization; sandbox and live accounts remain separate. Each provider account has one incoming webhook URL. Veyqo identifies the payment and delivers its event only to the owning project’s outgoing webhook endpoints. Projects may use identical order references because Veyqo sends its own unique payment ID to the provider. Use Switch account to change the account for new payments. Existing payments, refunds and late events stay tied to their original assignment. Updating credentials rotates the keys for every project using the account; disconnecting detaches only the selected project. ## Choose your integration - [API integration](https://veyqo.org/docs/payments): Create a payment on your server and redirect to its checkout URL. - [Hosted checkout](https://veyqo.org/docs/checkout): Create a checkout session and open it with the browser checkout script. - [Build with an AI agent](https://veyqo.org/docs/ai-agents): Give Claude, Codex or another assistant the integration context. ## Before you start Create a Veyqo account, choose a project, switch to sandbox and connect a provider with test credentials. Then create an API key with the scopes your server needs. > Veyqo API keys authenticate your application to Veyqo. Provider credentials connect Veyqo to your payment provider. Keep both on the server. --- # Your first payment Go from a connected sandbox provider to a payment your server can verify. ## 1. Set up your sandbox 1. Create an account and a project in the dashboard. 2. Select the sandbox environment and connect a supported provider using its test credentials. 3. Create an API key with payments:write and payments:read. Store the secret in your server environment as VEYQO_SECRET_KEY. 4. Create and persist a payment-attempt key for your order. Use it as ORDER_PAYMENT_KEY in the request below. ## 2. Create a payment Run this request from your server. The example charges NGN 500.00. Use a fresh order reference for each new order and a stable idempotency key for retries of the same operation. ```bash curl https://api.veyqo.org/api/v1/payments \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Idempotency-Key: $ORDER_PAYMENT_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" }, "metadata": { "order_id": "1001" } }' ``` ## 3. Send the customer to checkout A successful response has success: true and a data object. Save data.id with your order, then redirect the customer to data.checkout_url. Check the HTTP status and success flag before using these fields. ``` { "success": true, "data": { "id": "pay_example", "reference": "ORDER-1001", "status": "pending", "amount": 50000, "currency": "NGN", "checkout_url": "https://checkout.example.com/session" } } ``` ## 4. Confirm the result on your server Configure a webhook endpoint in the same sandbox environment and subscribe to payment.succeeded. Verify each signature before reading the event, then match the confirmed payment to your stored order. Use the verify endpoint when you need to ask the provider for the latest result. ```bash curl -X POST https://api.veyqo.org/api/v1/payments/pay_example/verify \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" ``` > Fulfil only after trusted server confirmation of succeeded status, amount, currency and order reference. A browser redirect or callback is not proof of payment. --- # Libraries & plugins Official Node.js and PHP libraries and a WooCommerce plugin. Each wraps the same public API, retries safely with idempotency keys and verifies webhook signatures for you. ## Node.js The @veyqo/node package has no dependencies and runs on Node 18 or later. It ships with TypeScript types. Source: github.com/veyqo-hq/veyqo-node. It covers payments (including split payments), refunds, checkout sessions, plans and subscriptions (including changePlan), bank transfers (transfers.banks, resolve, create, list, retrieve and batches), balances, beneficiaries, virtual accounts, split recipients, events and webhook verification. ``` npm install @veyqo/node // server.js import { Veyqo } from '@veyqo/node' const veyqo = new Veyqo(process.env.VEYQO_SECRET_KEY) const payment = await veyqo.payments.create({ amount: 50000, // NGN 500.00, in kobo currency: 'NGN', reference: 'ORDER-1001', customer: { email: 'customer@example.com' }, callback_url: 'https://shop.example.com/thanks', }) // redirect the customer to payment.checkout_url ``` ## PHP veyqo/veyqo-php needs PHP 8.1 or later with the curl and json extensions, and nothing else. It works in Laravel, Symfony or plain PHP. Source: github.com/veyqo-hq/veyqo-php. It has the same coverage as the Node library: $veyqo->transfers->create([...]) sends a bank transfer, $veyqo->transfers->createBatch([...]) sends up to 200, $veyqo->virtualAccounts->create([...]) gives a customer their own account number, and $veyqo->subscriptions->changePlan($id, [...]) moves a subscriber to another plan. ``` composer require veyqo/veyqo-php payments->create([ 'amount' => 50000, 'currency' => 'NGN', 'reference' => 'ORDER-1001', 'customer' => ['email' => 'customer@example.com'], 'callback_url' => 'https://shop.example.com/thanks', ]); header('Location: '.$payment['checkout_url']); ``` ## Verifying webhooks with a library Both libraries check the Veyqo-Signature and Veyqo-Timestamp headers against the raw body and reject replays older than five minutes. Pass the body exactly as received, before any JSON parsing. ``` // Node (Express) app.post('/webhooks/veyqo', express.raw({ type: 'application/json' }), (req, res) => { const event = verifyWebhook(req.body, req.headers, process.env.VEYQO_WEBHOOK_SECRET) // throws VeyqoSignatureError if it is not genuine res.sendStatus(200) }) // PHP $event = Veyqo\Webhook::verify(file_get_contents('php://input'), getallheaders(), getenv('VEYQO_WEBHOOK_SECRET')); ``` ## WooCommerce 1. Download veyqo-woocommerce.zip from github.com/veyqo-hq/veyqo-woocommerce/releases. 2. In WordPress, open Plugins → Add New → Upload Plugin, choose the zip, then Install and Activate. 3. Open WooCommerce → Settings → Payments → Veyqo. Paste your test secret key and leave Test mode on. 4. In the Veyqo dashboard, add a webhook endpoint with the URL shown on that settings page, subscribed to payment.succeeded and payment.failed. Paste its signing secret into the plugin. 5. Place a test order. When it is marked Processing, add your live key and turn Test mode off. > The plugin marks an order paid only after Veyqo confirms the payment server-side and the amount and currency match the order. Refunds can be issued from the WooCommerce order screen. ## Other languages Any language with an HTTP client works: send Authorization: Bearer with your secret key, JSON bodies, and an Idempotency-Key on every POST. The API reference documents each request and response. --- # Subscriptions Charge your customers on a schedule through your own provider accounts. Veyqo saves the card after the first payment and renews it each period. ## 1. Create a plan A plan sets what a customer pays and how often: day, week, month or year, with an optional interval_count (for example, 3 with month for quarterly). Add trial_days for a free trial. Your API key needs subscriptions:write. ```bash curl -X POST https://api.veyqo.org/api/v1/plans \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: plan-pro-monthly" \ -d '{"name":"Pro monthly","amount":250000,"currency":"NGN","interval":"month"}' ``` ## 2. Start a subscription Starting a subscription creates its first payment. Redirect the customer to data.checkout_url. When they pay, the subscription becomes active and you receive subscription.activated. With a free trial (the plan’s trial_days, or trial_days in this request, where 0 skips it) the subscription starts as trialing and there is nothing to pay yet. When the trial ends you receive subscription.payment_required with a checkout_url for the first payment; once it is paid, the card is saved for renewals. To take the card before the trial, add trial_requires_card: true. The customer pays a small card check at checkout_url (₦50, or 50 cents or the like), which is refunded at once; the trial then starts, and the first period is charged to that card when it ends. ```bash curl -X POST https://api.veyqo.org/api/v1/subscriptions \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: sub-customer-42" \ -d '{"plan":"rplan_...","customer":{"email":"customer@example.com"},"reference":"SUB-42"}' ``` ## 3. Renewals 1. When a period ends, Veyqo charges the saved card through the same provider and sends subscription.renewed. 2. If the customer paid by bank transfer or USSD, there is no card to charge. You receive subscription.payment_required with a checkout_url to send them. 3. A failed charge sends subscription.payment_failed, marks the subscription past_due and retries daily. After three failed attempts it is cancelled and you receive subscription.cancelled. ## 4. Change plan Move a customer to another plan in the same currency. By default the new plan starts at the next renewal and nothing is charged now; it shows as pending_plan until then. Pass at_period_end: false to switch now. The customer pays the new plan’s price less what is left of the current period: on the saved card straight away, or at the checkout_url in the response. A new period starts once it is paid, and you receive subscription.plan_changed. A plan worth less than what is left can only change at the end of the period. ```bash curl -X POST https://api.veyqo.org/api/v1/subscriptions/SUB-42/plan \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{"plan":"rplan_business","at_period_end":false}' ``` ## 5. Cancel Cancelling stops renewal at the end of the period the customer has paid for. Pass at_period_end: false to end it immediately. Nothing is refunded, and the saved card is deleted. ```bash curl -X POST https://api.veyqo.org/api/v1/subscriptions/SUB-42/cancel \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{"at_period_end":true}' ``` --- # Transfers Send money to any Nigerian bank account from your own provider balance, through one API for SafeHaven, Paystack, Flutterwave, Nomba and PalmPay. ## 1. Pick the bank Every provider codes banks differently. Veyqo gives each bank one id, its NIBSS institution code (for example 000013 for GTBank, 090267 for Kuda), and translates it to the code of the provider that sends the transfer. GET /transfers/banks lists every bank and which of your providers can reach it. Add ?provider=paystack to see exactly the banks that provider accepts, with its own codes. A bank without a Veyqo id can still be paid with bank_code and provider. ```bash curl "https://api.veyqo.org/api/v1/transfers/banks?provider=paystack" \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" ``` ## 2. Check the account Name enquiry returns the account holder’s name as the bank has it. Show it to whoever approves the payout. ```bash curl -X POST https://api.veyqo.org/api/v1/transfers/resolve \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{"bank":"000013","account_number":"0123456789"}' ``` ## 3. Send it Amounts are in kobo. Veyqo checks the account again, then sends it once in the provider’s own format. Pass account_name to stop the transfer if the bank’s name for the account is different. Your API key needs transfers:write. ```bash curl -X POST https://api.veyqo.org/api/v1/transfers \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: payout-1001" \ -d '{"amount":500000,"bank":"000013","account_number":"0123456789","account_name":"Ada Lovelace","narration":"Vendor payout","reference":"PAYOUT-1001"}' ``` ## 4. Follow the result 1. status is successful, failed (nothing was sent, or the money came back) or pending. 2. A pending transfer settles by itself: at once when the provider notifies Veyqo (Veyqo then checks with the provider before believing it), otherwise within a few minutes. You receive transfer.successful or transfer.failed, and GET /transfers/{id} checks with the provider. 3. To pay many accounts at once, use Transfers → Bulk transfer in the dashboard: upload a CSV of bank, account_number, amount (naira) and optional account_name, narration and reference, up to 200 rows. Each row is checked and sent on its own, and you see how each one went. 4. If a provider does not answer, Veyqo never sends the transfer again: it asks the provider about the original by its reference until it knows. 5. Paystack: turn off OTP for transfers (Settings → Preferences), or transfers wait for an OTP and fail. --- # Keys & authentication Authenticate server requests and keep sandbox and live traffic separate. ## Use a server API key Create a key in Dashboard → API keys. The secret is shown once. Store it in a server environment variable and send it as a Bearer token on every public API request. The public API uses /api/v1. Dashboard session authentication is separate and is not used for merchant integrations. ``` GET https://api.veyqo.org/api/v1/payments Authorization: Bearer Content-Type: application/json ``` ## Grant the scopes you need Account, transfer, bill-payment and identity scopes must be granted by an organization owner or admin. Existing keys gain no new permissions automatically. See the SafeHaven guide for service-specific setup and operation reconciliation. | Operation | Required scope | | --- | --- | | Read accounts | accounts:read | | Manage accounts (includes accounts:read) | accounts:write | | Read transfers | transfers:read | | Manage transfers (includes transfers:read) | transfers:write | | Read bills | bills:read | | Manage bills (includes bills:read) | bills:write | | Read identity | identity:read | | Manage identity (includes identity:read) | identity:write | | Read payments | payments:read | | Create payments (includes payments:read) | payments:write | | Read refunds | refunds:read | | Issue refunds (includes refunds:read) | refunds:write | | Read events | events:read | | Read webhook endpoints | webhooks:read | | Manage webhook endpoints (includes webhooks:read) | webhooks:write | | Read plans and subscriptions | subscriptions:read | | Manage plans and subscriptions (includes subscriptions:read) | subscriptions:write | | Read cards | cards:read | | Issue and manage cards (includes cards:read) | cards:write | ## One key, one environment A sandbox key can access its sandbox resources; a live key can access its live resources. Connect the provider and configure webhooks separately for each environment. A key with the right scope still cannot cross the environment boundary. > Never place a secret API key in browser code, a public repository, a prompt, or client-side VITE_ variables. The checkout script’s publishable key is a different credential. ## Restrict a key to your servers In Dashboard → API keys → Allowed IPs & activity, list the IPv4 or IPv6 addresses or CIDR ranges your servers call from (for example 203.0.113.10, 203.0.113.0/24 or 2001:db8::/32). An empty list allows any address. A request from an address that is not on the list is refused with 403 IP_NOT_ALLOWED; error.details.ip is the address Veyqo saw. Owners and admins are emailed about blocked attempts, and about a key being used from an address it has not used before. ``` HTTP/1.1 403 Forbidden { "success": false, "error": { "code": "IP_NOT_ALLOWED", "message": "This API key cannot be used from 192.0.2.10.", "details": { "ip": "192.0.2.10" } } } ``` ## Expiry, rolling and a leaked key A key can be given an expiry date when you create it or later; owners and admins are emailed a week before, and requests with an expired key fail with 401 INVALID_API_KEY. Roll a key to replace it: the new key keeps the same name, scopes and allowed IPs, and the old one stops immediately or after a grace period of up to 24 hours so your deployment can switch. If a key may have leaked, roll it with no grace period (or revoke it), check its recent addresses in Allowed IPs & activity, and restrict it to your servers. --- # Create & verify payments Initialize a charge, direct the customer to checkout, and confirm what happened. ## Create on your server POST /payments starts a payment through a connected provider. The provider field selects a provider; its connection must belong to the key’s environment. Calculate the amount from trusted order data. ### cURL ``` curl https://api.veyqo.org/api/v1/payments \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Idempotency-Key: $ORDER_PAYMENT_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" }, "metadata": { "order_id": "1001" } }' ``` ### Node.js ``` // Server-side JavaScript (Node.js 18+). Values come from your order database. const response = await fetch('https://api.veyqo.org/api/v1/payments', { method: 'POST', headers: { Authorization: `Bearer ${process.env.VEYQO_SECRET_KEY}`, 'Content-Type': 'application/json', 'Idempotency-Key': order.paymentAttemptKey, // Persist before the request. }, body: JSON.stringify({ amount: order.totalMinor, currency: order.currency, reference: order.reference, provider: 'paystack', customer: { email: order.customerEmail }, }), }); const result = await response.json(); if (!response.ok || !result.success) { throw new Error(result.error?.code ?? 'PAYMENT_REQUEST_FAILED'); } // Persist result.data.id against the order before redirecting the customer. const checkoutUrl = result.data.checkout_url; ``` ## Payment request fields | Field | Meaning | | --- | --- | | amount | Required positive integer in the smallest currency unit. | | currency | Required three-letter currency code, supported by the provider. | | customer.email | Required customer email for the nested customer form. | | reference | Your order reference; if omitted, the payment ID becomes the reference. | | provider | Provider slug, such as paystack. | | callback_url | Optional HTTPS URL the provider can return the customer to. | | metadata | Optional application context, such as an internal order ID. | ## Itemise, ship and add tax Send line_items to show what is being bought on the checkout page; they must add up to amount, together with shipping.amount when you charge for delivery. shipping.amount is charged and taxed as shipping, not as a product. Set tax.automatic to have a provider that supports it (Stripe) add sales tax, VAT or GST at checkout from the shipping address. Once paid, amount is the total charged, with amount_subtotal and amount_tax apart. A payment asking for automatic tax is refused when no provider in its route can add tax, rather than charged without it. A paid payment also carries risk: the provider’s fraud assessment (level, score, review and card_country). When review is true, look at the order before you ship it. A failed payment says why in failure_code and failure_message, in the API and in the payment.failed webhook. To close a checkout for an order you cancelled, POST /payments/{id}/cancel; it is refused once the customer has paid. ```bash curl -X POST https://api.veyqo.org/api/v1/payments \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-1001" \ -d '{ "amount": 38400, "currency": "CAD", "provider": "stripe", "customer": { "email": "buyer@example.ca" }, "line_items": [ { "name": "Sole Pod", "unit_amount": 19900 }, { "name": "Re-Up", "unit_amount": 15000 } ], "shipping": { "amount": 3500, "label": "Standard shipping", "address": { "line1": "1 King St W", "city": "Toronto", "state": "ON", "postal_code": "M5H 1A1", "country": "CA" } }, "tax": { "automatic": true }, "callback_url": "https://shop.example.com/thanks" }' ``` ## Retry the same operation safely Send an Idempotency-Key on POST requests. Generate and persist it before the first attempt. If the request times out, retry with the same key and exactly the same body. A different body with the same key returns a conflict. Use a new key for a new logical operation. Your order reference and idempotency key serve different purposes: one identifies the order; the other identifies a request attempt across retries. ## Verify before fulfilment GET /payments/{id} retrieves the stored payment. POST /payments/{id}/verify queries the provider and updates the payment result. Both require payments:read. Pending is not a successful payment. Store the payment ID and reconcile webhooks against the order’s reference, expected amount and currency. Deduplicate fulfilment even if the same confirmation arrives more than once. ## Read the real payment response POST /payments returns HTTP 201 with a payment in data. Its checkout address is data.checkout_url. It is not data.checkout.url, and its initial status is usually pending. The provider URL in the example is illustrative. ```json { "success": true, "data": [ { "provider": "paystack", "available": true, "balances": [ { "currency": "NGN", "available": 12345600, "pending": null } ], "error": null, "checked_at": "2026-11-17T12:00:00+00:00" }, { "provider": "nomba", "available": false, "balances": [], "error": null, "checked_at": "2026-11-17T12:00:00+00:00" } ] } ``` ## Keep the payment ID and merchant reference Persist the Veyqo payment ID alongside your order before redirecting the customer. GET /payments/{id} and POST /payments/{id}/verify accept either that ID or your URL-encoded reference directly in the path. There is no ?reference= lookup on the single-payment endpoint. Use the Veyqo ID for unambiguous reconciliation, especially when order references are reused across sandbox and live. Cross-project resources stay not-found; a known payment in the other environment of the same project can produce ENVIRONMENT_MISMATCH. ## Payment states | Status | Meaning / action | | --- | --- | | created | Recorded by Veyqo before a provider result. Do not fulfil. | | pending | Waiting for the customer or provider. Do not fulfil. | | processing | Provider outcome is not settled yet. Verify later. | | succeeded | Payment confirmed. Compare amount, currency and order ownership before fulfilling once. | | failed | Payment failed. Inspect failure_code and failure_message. | | cancelled | Payment was cancelled. Do not fulfil. | | partially_refunded | Some captured funds have been refunded. Track amount_refunded. | | refunded | The captured payment has been fully refunded. | ## API failures and payment failures are different An error envelope with success:false describes a rejected or failed API operation. A 200 response can return a payment whose status is failed, and a 201 response can return a pending payment. Inspect both layers. Payment failure_code is not the same catalogue as error.code. gateway_declined means the provider rejected the payment; show an appropriate customer message and let the customer choose another method. amount_mismatch means the provider-reported amount failed reconciliation; do not fulfil, do not override it from browser data, and investigate the stored order and provider transaction. A creation failure can store the corresponding API error code on the payment. failure_message contains provider-specific detail and may be null; do not use its wording as a stable machine code. - [Create a payment](https://veyqo.org/docs/api-payments-create): POST /payments - [Verify a payment](https://veyqo.org/docs/api-payments-verify): POST /payments/{id}/verify --- # Hosted checkout Create checkout on your server, then open it from your website. ## Create a checkout session Use POST /checkout/sessions with a server key that has payments:write. The session fixes the amount on the server. Save the returned data.id against the order. ```bash curl https://api.veyqo.org/api/v1/checkout/sessions \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Idempotency-Key: $ORDER_PAYMENT_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" }, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart" }' ``` ## Open checkout in the browser Expose your own authenticated /create-checkout endpoint that looks up the order, creates the session and returns { id: result.data.id }. Check that the signed-in customer owns the order. ``` ``` > Use signed webhooks to fulfil orders. Treat the browser callback as a user experience signal and show a pending state until your server confirms payment. ## Choose the correct trust boundary Recommended: create the session on your server with a kc_test_ or kc_live_ secret key, save the returned cs_ ID against your order, then open data.url or call VeyqoCheckout.open({ session: id }). The server fixes the amount and currency. The publishable-key browser flow lets the page set amount, reference and customer data. Treat those as untrusted input. Compare the actual paid amount/currency and ownership against your server-side order before fulfilling. A publishable key is not a secret API key. ## Browser checkout script Load the Veyqo-hosted script directly. There is no claimed npm SDK or MCP server for this integration. The open call returns a Promise; catch request or setup errors. A blocked popup falls back to a redirect. Call it from a user click. ``` ``` ## Checkout script options and callbacks setup({ key, apiUrl, checkoutOrigin }) configures browser-created sessions. key is a pk_test_ or pk_live_ publishable key; apiUrl comes from the script’s deployment configuration; the production script targets https://api.veyqo.org. checkoutOrigin is the origin serving the script (https://veyqo.org in production). A server-created session does not require setup({ key }). open({ session, mode, onSuccess, onClose, onError }) opens a saved cs_ ID. mode defaults to popup; redirect navigates the current window. Its Promise resolves with { session } after checkout opens, not after payment completion. For browser-created sessions, omit session and supply amount, currency, email, name, reference, description, metadata, provider, successUrl and cancelUrl as needed. amount and currency are required. These camelCase SDK options map to the documented snake_case browser request. onSuccess receives { session, reference, status: success }. onClose receives { session, status }, including closed. onError receives an Error; open also rejects, so attach a catch handler. Callbacks work while the popup opener remains available; redirect mode requires your return page and server-side reconciliation. ## Advanced browser API The hosted page and checkout script use /checkout/v1, not /api/v1. Its session detail replaces the provider slug with a provider object and includes methods and next_action. These provider-dependent instructions are intentionally handled by the hosted client. Creating a browser session accepts Authorization: Bearer or X-Veyqo-Key. Success/cancel URL hosts must match the request Origin. Subsequent session calls use the session ID, without a secret key. - [Browser checkout reference](https://veyqo.org/docs/browser-checkout): All six browser session and payment-link endpoints, with exact requests and response shapes. ## Session lifecycle and payment attempts Sessions are open, completed or expired. Default lifetime: 60 minutes. A completed or expired session cannot be reused as a new order. One session may have several payment attempts as a customer tries another method. The first attempt uses the base reference; later attempts can have a numeric suffix. Store the session ID and reconcile its current payment ID against your server order, rather than assuming every attempt reference equals the original order reference. Payment metadata includes checkout_session, checkout_source and, when supplied, merchant_reference. Metadata alone is not proof of ownership: fetch the session/payment with the original project key and compare the stored session/payment relationship, amount and currency. Investigate ambiguous late outcomes before fulfilling. --- # Receive trusted payment events Verify the sender, reject replays, and handle duplicate deliveries safely. ## Register your endpoint In Dashboard → Webhooks, create a public HTTPS endpoint in the same environment as your payments and subscribe to payment.succeeded. Store its signing secret as VEYQO_WEBHOOK_SECRET on your server. The API key and webhook signing secret are different secrets. Verify incoming deliveries with the webhook endpoint’s signing secret. ## Verify the raw request body Veyqo-Signature is a hexadecimal HMAC-SHA256 digest of {timestamp}.{raw body}. Veyqo-Timestamp provides the timestamp. During secret rotation, the signature header contains comma-separated signatures; accept a match with your configured secret. Verify in constant time and reject timestamps outside a five-minute window. The following Express example shows signature verification and the boundary where you must add your own durable event persistence. It is not a complete order processing service. ``` import express from 'express'; import { createHmac, timingSafeEqual } from 'node:crypto'; const app = express(); // Register BEFORE app.use(express.json()); signatures need the original bytes. app.post('/webhooks/veyqo', express.raw({ type: 'application/json' }), async (req, res) => { const signature = req.get('Veyqo-Signature') ?? ''; const timestamp = req.get('Veyqo-Timestamp') ?? ''; const secret = process.env.VEYQO_WEBHOOK_SECRET; if (!secret) return res.sendStatus(503); if (!/^\d+$/.test(timestamp) || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300 || !signature) return res.sendStatus(401); const expected = createHmac('sha256', secret) .update(timestamp + '.').update(req.body).digest(); // During secret rotation, accept any matching comma-separated signature. const valid = signature.split(',').map(value => value.trim()).some(value => /^[a-f0-9]{64}$/i.test(value) && timingSafeEqual(expected, Buffer.from(value, 'hex')) ); if (!valid) { return res.sendStatus(401); } let event; try { event = JSON.parse(req.body.toString('utf8')); } catch { return res.sendStatus(400); } // Implement this with a durable queue/outbox and UNIQUE(event.id). // Acknowledge only after durable storage; retry storage failures with 5xx. try { await persistEventOnce(event); return res.sendStatus(200); } catch { return res.sendStatus(503); } }); // Your worker handles payment.succeeded. Resolve its payment_id via the API, // match status, reference, amount and currency to the stored order, then // atomically mark the order paid once. persistEventOnce is your app's function. ``` ## Process once, even when delivered again 1. Verify the signature and timestamp before trusting the payload. 2. Persist the event durably with a unique constraint on event.id. A duplicate delivery should receive 2xx without repeating work. 3. Acknowledge promptly after storage and process the order in a worker. 4. For payment.succeeded, resolve data.payment_id and verify the payment against your order’s reference, amount and currency. 5. Update the order atomically so repeated events cannot fulfil it twice. > Return a non-2xx response if you could not persist the event. Returning 200 before durable storage can lose an event if the process stops. ## Inspect and recover deliveries Use Events and Deliveries in the dashboard to investigate failures and retry a delivery. Veyqo retries failed deliveries with backoff. Your handler must tolerate duplicates and must not depend on event arrival order. The events API also lets your server read normalized events using events:read, so missed notifications can be reconciled. ## Delivered event example The signed HTTP body is the event object itself, without the API {success,data} wrapper. GET /events/{id} wraps that same event content in the API envelope. Stored event JSON may have different key order from delivered bytes; verify a delivery using its original raw body, not a reserialized events-API result. ```json { "id": "evt_01M6EB66SC61Q3RQYAN0693DGM", "type": "payment.succeeded", "created_at": "2026-11-02T12:00:00+00:00", "environment": "sandbox", "data": { "payment_id": "pay_01M6EB66SC61Q3RQYAN0693DGM", "reference": "ORDER-1001", "amount": 50000, "amount_refunded": 0, "currency": "NGN", "status": "succeeded", "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "provider": { "name": "paystack", "reference": "provider_reference_example" }, "metadata": { "order_id": "1001" } } } ``` ## Headers and secret rotation Veyqo-Signature is one or more comma-separated hexadecimal HMAC-SHA256 digests. It does not contain t= or v1= labels. Veyqo-Timestamp supplies the Unix timestamp separately. Veyqo-Event-Id matches body.id; Veyqo-Version identifies the schema version. Default schema version: 2026-09-01. Reject timestamps outside ±300 seconds. During signing-secret rotation, old and new digests are sent for 24 hours. Accept any digest matching an active secret. The webhook signing secret is separate from your Veyqo API secret and provider credentials. It is shown only when created or rotated; keep it in a server secret store. ``` Veyqo-Signature: <64-character-hex-digest>, Veyqo-Timestamp: 1793620800 Veyqo-Event-Id: evt_01M6EB66SC61Q3RQYAN0693DGM Veyqo-Version: 2026-09-01 ``` ## Supported event types | Event | Meaning | | --- | --- | | payment.created | A payment was initialized. | | payment.pending | Awaiting the customer. | | payment.processing | The provider is settling it. | | payment.succeeded | Funds were captured. | | payment.failed | The payment will not complete. | | refund.created | A refund was requested. | | refund.succeeded | The refund reached the customer. | | refund.failed | The provider rejected the refund. | | dispute.created | A customer's bank opened a chargeback on a payment. | | dispute.updated | A dispute changed status or its evidence deadline moved. | | dispute.closed | A dispute was decided: won or lost. | | provider_service.updated | A provider service resource was created or its verified status changed. | | subscription.activated | A customer paid the first period of a subscription. | | subscription.renewed | A subscription was paid for another period. | | subscription.payment_failed | A renewal charge failed. Veyqo retries daily before cancelling. | | subscription.payment_required | A renewal needs the customer to pay at the checkout_url (no saved card). | | subscription.cancelled | A subscription ended: cancelled, or unpaid after the last retry. | | subscription.plan_changed | A customer paid the prorated difference and their new plan started. | | transfer.successful | A bank transfer reached the beneficiary's bank. | | transfer.failed | A bank transfer did not go through; nothing left your balance, or it was returned. | | card.created | A card was issued and can be used. | | card.updated | A card was frozen, unfrozen, or its spending controls changed. | | card.terminated | A card was cancelled for good. | | card.authorization.approved | A card payment was approved in real time. | | card.authorization.declined | A card payment was declined, or the issuer declined one that had been approved. Release anything you held for it. | | card.transaction.created | An approved card payment was settled by the issuer. | | card.transaction.refunded | A card payment was refunded to the card. | | card_balance.topped_up | Money reached your card balance (Veyqo card programme). | | card_balance.low | Your card balance fell below the threshold you set. | > Do not subscribe to invented transfer.* or checkout.* event names. Checkout payments emit normalized payment events; refund events add refund_id, refund_amount, refund_status and reason. ## Delivery and retry policy A successful delivery is any 2xx response. Veyqo times out a delivery after 10 seconds. Return 2xx promptly after durable event storage; move fulfilment to a worker. Default delays between successive attempts, in seconds: 0, 60, 300, 900, 3600, 21600, 86400. Network failures, 5xx responses, 408 and 429 are retried. Other 4xx responses are treated as permanent refusals. Do not return 401 or 400 for a transient database outage; return 503 so delivery can retry. An endpoint is automatically disabled after 14 consecutive failures by default. A successful delivery clears that failure run. Inspect Deliveries, repair the handler, reactivate the endpoint if needed and retry/reconcile missed events. Delivery can be duplicated and out of order. Use event.id for durable deduplication, and an atomic unique order-paid/fulfilment record for business deduplication. Never rely on exact arrival order or on a single delivery attempt. ## Incoming provider webhooks versus your webhook The provider account URL is where Paystack, Flutterwave, Stripe or SafeHaven sends events to Veyqo. Copy that account-specific URL from the Providers dashboard into the provider settings. Your outgoing webhook URL is your own publicly reachable HTTPS handler, configured under Webhooks for the selected project environment. Veyqo signs deliveries to it with the endpoint secret. These two URLs and their secrets are different. - [Shared provider credentials](https://veyqo.org/docs/provider-accounts): How one provider account routes payments and outgoing deliveries to the right project. --- # Refund a payment Issue a full or partial refund through the provider that processed the payment. ## Create the refund Use a server key with refunds:write. Omit amount for the remaining refundable balance, or supply an integer in minor units for a partial refund. Persist a distinct idempotency key for the refund operation. Provider support and payment state determine whether the refund can be made. ```bash curl https://api.veyqo.org/api/v1/payments/pay_example/refunds \ -H "Authorization: Bearer $VEYQO_SECRET_KEY" \ -H "Idempotency-Key: $REFUND_ATTEMPT_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 25000, "reason": "requested_by_customer" }' ``` ## Track the result Save the returned refund ID and inspect its status. Retrieve it with GET /refunds/{id} using refunds:read. Do not tell the customer a refund is complete until its status confirms completion. ## Refund response and constraints A successful create response is HTTP 201. The returned refund may still be pending; track it with GET /refunds/{id} and refund events. Only succeeded, partially_refunded payments with a positive remaining amount can be refunded, and the provider must support refunds. Omit amount for the remaining balance. Do not send null; send a positive integer for a partial refund. A fully refunded payment returns PAYMENT_ALREADY_REFUNDED; an excessive or invalid amount is VALIDATION_FAILED. A refund remains tied to the provider account that took the original payment, even after the project switches or disconnects its current assignment. Keep that original external account and credentials valid until reconciliation is complete. ```json { "success": true, "data": { "id": "ref_01M6EB66SC61Q3RQYAN0693DGM", "object": "refund", "payment": "pay_01M6EB66SC61Q3RQYAN0693DGM", "amount": 25000, "currency": "NGN", "status": "pending", "reason": "requested_by_customer", "failure_message": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` --- # Build with your AI coding agent Give your assistant the API contract and payment rules before it writes the integration. ## Download agent-specific instructions Merge the templates into your application’s existing instruction files; do not overwrite existing repository rules. Download the full endpoint reference or fetch only the pages you need from llms.txt. The AI context contains documentation, not credentials or an authenticated MCP connection. Give your assistant sandbox environment-variable names, never pasted production secrets. - [Claude project template](/ai/CLAUDE.md): A short CLAUDE.md template linking to the integration reference. - [Codex repository template](/ai/AGENTS.md): An AGENTS.md template to merge into your application. - [Integration prompt](/ai/integration-prompt.txt): A stack-aware implementation brief with verification requirements. - [OpenAPI contract](/openapi.json): Machine-readable fields, responses, errors and security schemes. ## Give your agent the docs Use the downloadable integration context below with Claude Code, Codex or another coding assistant. For chat tools, attach the Markdown file or paste its contents. For tools that can read URLs, ask them to read /llms-full.txt first. These files provide documentation context. They do not install an SDK, enable an MCP server, or give an assistant access to your Veyqo account. - [Documentation index](/llms.txt): A small index of the guides for tools that consume llms.txt. - [Full integration context](/llms-full.txt): All integration guides in one plain-text Markdown document. ## Claude Code Merge the integration notes into your project’s CLAUDE.md, or save them in docs/veyqo.md and reference that file from CLAUDE.md. Keep your existing project instructions. Ask Claude to inspect the application before choosing where the integration belongs. ``` # Veyqo integration Read docs/veyqo.md before changing payment code. Keep API keys server-side. Calculate totals from stored order data. Verify signed webhooks and make order fulfilment idempotent. Run the project’s existing payment tests after changes. ``` [Claude Code project instructions](https://code.claude.com/docs/en/memory) ## Codex Merge the same notes into AGENTS.md in your project root, or point that file to docs/veyqo.md. Codex reads repository instructions before working. Add the test command and payment code locations used by your project. ``` # Payment integration instructions Before changing payments, read docs/veyqo.md. Use the Veyqo REST API; do not invent SDK package names. Keep credentials in server environment variables. Verify signatures using the raw request body. Test duplicate events, retries and amount mismatches. Run this repository’s existing checks before finishing. ``` [Codex repository instructions](https://learn.chatgpt.com/docs/agent-configuration/agents-md) ## Start with a concrete integration prompt This prompt also works with other coding assistants when you attach the integration context. Replace the application-specific details with your own stack and order model. ``` Read https://veyqo.org/llms-full.txt and inspect this application's stack. Integrate Veyqo hosted checkout using our existing server and order model. Create the checkout session server-side with a sandbox secret from the environment. Use the stored order total in minor units, currency and reference. Add a signed webhook handler with raw-body signature validation, a five-minute replay window, event deduplication and idempotent order fulfilment. Verify payment status, amount, currency and reference before fulfilling an order. Handle API errors and reuse a persisted idempotency key on retries. Keep secrets server-side and add meaningful tests. Tell me which dashboard settings and environment variables I need to configure. Do not deploy. ``` ## Reusable integration context Save this as docs/veyqo.md. Review the generated code and test it in sandbox before using live credentials. ``` # Integrating Veyqo Veyqo connects a merchant's existing payment provider accounts through one API. Public API base: https://api.veyqo.org/api/v1 Documentation: https://veyqo.org/docs Full integration context: https://veyqo.org/llms-full.txt - Use Authorization: Bearer $VEYQO_SECRET_KEY on your server only. - API keys, project assignments and outgoing webhooks belong to one project environment. - Provider credential accounts may be dedicated or shared across projects in the same organization and environment type. Switch assignments for new payments; keep existing payments and refunds tied to their original account. - Start in sandbox. Use provider test credentials with your sandbox key. - Amounts are integers in the smallest currency unit: 50000 NGN is NGN 500.00. - Calculate prices from trusted server-side order data, never browser input. - POST /payments creates a payment; data.checkout_url is its checkout URL. - POST /checkout/sessions creates hosted checkout; data.id is the session ID. - Persist an Idempotency-Key per logical POST operation. Reuse it with the same body on retries; use a new key for a different operation. - Use GET /payments/{id} or POST /payments/{id}/verify to check a payment. - Verify requires payments:read; create requires payments:write. - Webhooks use Veyqo-Signature and Veyqo-Timestamp headers. - Verify HMAC-SHA256(secret, timestamp + '.' + raw request body), compare in constant time, accept any matching comma-separated signature during rotation, and reject timestamps more than 300 seconds from now. - Deduplicate events by event ID and make fulfilment idempotent. - Fulfil only after trusted server confirmation of succeeded status and a match on the stored order reference, amount and currency. A redirect is not proof. - POST /payments/{id}/refunds supports full or partial refunds (refunds:write). - Responses use { success, data } or { success: false, error: { code, message, details } }. - Check response status and success before reading data. Respect Retry-After. - Never log API secrets, invent SDK packages, or assume an MCP server exists. - Direct payments return checkout_url; checkout sessions return url. Do not invent checkout.url. - Public API requests and responses use snake_case. Dashboard/admin internals are not the integration API. - Browser checkout uses /checkout/v1 with a publishable key or session ID; prefer trusted server-created sessions. - Checkout retries may suffix the original reference. Save and verify the session/payment association, not metadata alone. - Read https://veyqo.org/api-reference.json or https://veyqo.org/openapi.json for all fields, examples and errors. - Fetch individual endpoint guides from https://veyqo.org/llms.txt when the full context is too large. - Never infer Nomba/Stripe/Paystack-specific API fields for Veyqo; use the Veyqo contract. - SafeHaven NGN collections use the normal payment API; banking, bills, identity and USSD use documented /safehaven extensions with explicit scopes. - All SafeHaven service writes require a persisted Idempotency-Key. Reconcile uncertain writes through /safehaven/operations before creating another debit. - Moving an app that already calls SafeHaven directly: connecting a dedicated SafeHaven account imports its existing sub-accounts automatically (progress on the connection page; on a shared account press Import accounts). POST /safehaven/accounts/import adopts specific accounts. Repoint SafeHaven's webhook URL to Veyqo only after the import completes. Credit deposits from provider_service.updated events with service account-credit, direction credit and status Completed: find the customer by credit_account_number, skip is_reversed, and deduplicate on session_id. All amounts are kobo. - Service notifications use provider_service.updated, a different data shape from payment events. Never use merchant metadata to select a project. - Add tests for duplicate events, invalid signatures, amount mismatches and retries. ``` --- # Errors & retries Understand failures and retry requests without repeating a charge. ## Read both HTTP status and error.code Errors use success:false and an error object. code is stable; message text may change. details is optional, so do not assume it is always present. Field validation details contain arrays of messages keyed by the submitted field name. Every API response includes X-Request-Id; retain it when contacting support. ```json { "success": false, "error": { "code": "VALIDATION_FAILED", "message": "The given data was invalid.", "details": { "amount": [ "The amount must be a whole number in the smallest currency unit." ] } } } ``` ## Before retrying a payment A lost response does not prove no charge was created. First retrieve by the saved Veyqo ID/reference and verify an uncertain result. Never silently switch provider or generate a new idempotency key after an unknown outcome. Retry safe reads with bounded exponential backoff and jitter. Honor Retry-After on 429. For retried creates/refunds, preserve the original operation key and unchanged body. Correct validation, authentication, currency and permission errors before trying again. ## Complete error catalogue All codes below come from the backend ErrorCode enum. Surface labels distinguish public integration errors from dashboard/admin session errors and provider ingress failures. Your own webhook handler chooses its response status; Veyqo does not send an API error envelope as a webhook event. | Code | HTTP | Surface | Retry | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | all | No automatic retry. | | UNAUTHENTICATED | 401 | dashboard/admin | After authenticating. | | ORGANIZATION_REQUIRED | 400 | dashboard | After selecting context. | | SESSION_EXPIRED | 419 | dashboard/admin | After refreshing the session. | | INVALID_API_KEY | 401 | public/checkout | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | all | After permission changes. | | EMAIL_NOT_VERIFIED | 403 | dashboard | After verification. | | TWO_FACTOR_REQUIRED | 403 | dashboard/admin | After enrollment. | | REAUTHENTICATION_REQUIRED | 403 | dashboard | Immediately after confirming. | | TERMS_NOT_ACCEPTED | 403 | dashboard | After accepting. | | IP_NOT_ALLOWED | 403 | api | After the address is allowed. | | ENVIRONMENT_MISMATCH | 403 | public | After selecting the correct key. | | RESOURCE_NOT_FOUND | 404 | all | No blind retry. | | PAYMENT_NOT_FOUND | 404 | public | No blind retry. | | DUPLICATE_REFERENCE | 409 | public | Reconcile first. | | IDEMPOTENCY_KEY_REUSED | 409 | public | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | public | Back off with jitter; preserve key/body. | | PAYMENT_ALREADY_REFUNDED | 409 | public | No. | | PAYMENT_NOT_CANCELLABLE | 409 | public | No. | | INVALID_PROVIDER | 422 | public | After configuration or provider selection changes. | | PROVIDER_NOT_CONNECTED | 422 | public | After configuration changes. | | INVALID_CURRENCY | 422 | public | After correcting the request. | | PROVIDER_AUTHENTICATION_FAILED | 502 | public | After credential correction; reconcile existing payment first. | | PROVIDER_UNAVAILABLE | 503 | public/checkout | Conditional: reconcile unknown outcomes first. | | PROVIDER_REQUEST_FAILED | 422 | public | Only after resolving the cause. | | INVALID_WEBHOOK_SIGNATURE | 401 | provider ingress | Provider delivery may retry after secret correction. | | PLAN_LIMIT_REACHED | 402 | public/dashboard | After resolving plan/billing restrictions. | | RATE_LIMIT_EXCEEDED | 429 | all | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | all | After fixing the method. | | INTERNAL_ERROR | 500 | all | Safe reads: bounded backoff. Writes: reconcile first. | | CARDS_NOT_ENABLED | 403 | public | No. | | CARD_NOT_USABLE | 409 | public | No. | | INSUFFICIENT_CARD_BALANCE | 409 | public | After topping up. | ## VALIDATION_FAILED · 422 A field, amount, URL, payment state or capability is invalid. Recovery: Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. Retry: No automatic retry. Default message: The given data was invalid. ## UNAUTHENTICATED · 401 A dashboard/admin session or protected session action has no valid authentication. Recovery: Sign in to the relevant dashboard. Public server API requests should use a secret API key, not session cookies. Retry: After authenticating. Default message: This request requires authentication. ## ORGANIZATION_REQUIRED · 400 A dashboard request did not select an organization. Recovery: Select an organization or supply its required dashboard context. Public API keys already bind their organization. Retry: After selecting context. Default message: Name the organization this request acts within. ## SESSION_EXPIRED · 419 The dashboard/admin CSRF token or browser session expired. Recovery: Refresh the session and CSRF cookie, then retry the dashboard action. This is not a public API-key error. Retry: After refreshing the session. Default message: Your session expired. Refresh the page and try again. ## INVALID_API_KEY · 401 The key is absent, malformed, revoked or belongs to the wrong authentication surface. Recovery: Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. Retry: After fixing credentials. Default message: That API key is not valid. ## INSUFFICIENT_PERMISSION · 403 The key lacks an endpoint scope, or a signed-in role lacks permission. Recovery: Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. Retry: After permission changes. Default message: You do not have permission to do that. ## EMAIL_NOT_VERIFIED · 403 The dashboard user has not verified their email. Recovery: Complete email verification and refresh the session before managing live integration settings. Retry: After verification. Default message: Verify your email address to continue. ## TWO_FACTOR_REQUIRED · 403 The protected dashboard/admin operation requires two-factor enrollment. Recovery: Complete authenticator enrollment using the relevant account. Do not disable two-factor checks in an integration. Retry: After enrollment. Default message: Set up two-factor authentication to continue. ## REAUTHENTICATION_REQUIRED · 403 A sensitive dashboard change (provider keys, webhook endpoints) needs the member to confirm it is them within the last 10 minutes. error.details.method says how: two_factor or password. Recovery: POST /dashboard/me/confirm-identity with the code (or password), then repeat the request. The dashboard prompts for this automatically. Retry: Immediately after confirming. Default message: Confirm it is you to continue. ## TERMS_NOT_ACCEPTED · 403 The dashboard user has not accepted the current Terms of Service and Privacy Policy. error.details.version names the version. Recovery: POST /dashboard/me/terms with {"accept": true}, then repeat the request. The dashboard prompts for this automatically. Retry: After accepting. Default message: Accept the Terms of Service to continue. ## IP_NOT_ALLOWED · 403 The API key has an allowed-IP list and the request came from an address that is not on it. error.details.ip is the address Veyqo saw. Recovery: Call from an allowed server, or add the address (or its CIDR range) to the key's allowed IPs in the dashboard. Owners and admins are emailed about blocked attempts. Retry: After the address is allowed. Default message: This API key cannot be used from this IP address. ## ENVIRONMENT_MISMATCH · 403 A known resource is in the other environment of the same project. Recovery: Use the correct sandbox/live key. Resources outside the key’s project remain not-found instead of disclosing ownership. Retry: After selecting the correct key. Default message: That resource belongs to a different environment. ## RESOURCE_NOT_FOUND · 404 The resource does not exist, is inactive or is not visible to this environment. Recovery: Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. Retry: No blind retry. Default message: We could not find what you were looking for. ## PAYMENT_NOT_FOUND · 404 No visible payment matches the ID or reference. Recovery: Use the saved Veyqo payment ID or correctly URL-encoded merchant reference with the original project’s key. Retry: No blind retry. Default message: That payment could not be found. ## DUPLICATE_REFERENCE · 409 A payment already exists with this reference in the environment. Recovery: Retrieve that payment and reconcile its state. For a genuinely new attempt, use a new unique reference and operation key; do not create a second charge just because a response was lost. Retry: Reconcile first. Default message: That reference has already been used in this environment. ## IDEMPOTENCY_KEY_REUSED · 409 An environment already used this key for a different method/path/body. Recovery: Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. Retry: Do not retry a changed body with that key. Default message: That idempotency key was used with a different request body. ## IDEMPOTENCY_IN_PROGRESS · 409 Another request still holds this operation key. Recovery: Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. Retry: Back off with jitter; preserve key/body. Default message: A request with that idempotency key is still in progress. ## PAYMENT_ALREADY_REFUNDED · 409 The payment has no refundable amount remaining. Recovery: Read the payment and refunds, compare amount_refunded to amount, and avoid issuing a duplicate refund. Retry: No. Default message: That payment has already been fully refunded. ## PAYMENT_NOT_CANCELLABLE · 409 The payment was already paid (or is being paid), or its provider cannot close its payment page. Recovery: Read the payment: if it succeeded, refund it instead of cancelling. Retry: No. Default message: That payment can no longer be cancelled. ## INVALID_PROVIDER · 422 The provider slug is unknown, disabled, or lacks the requested capability. Recovery: Choose a supported connected provider. Refund/direct-checkout capabilities can differ from simple payment creation. Retry: After configuration or provider selection changes. Default message: That provider is not recognised. ## PROVIDER_NOT_CONNECTED · 422 No eligible provider is assigned to this project environment, or provider selection is ambiguous. Recovery: Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. Retry: After configuration changes. Default message: That provider is not connected in this environment. ## INVALID_CURRENCY · 422 The selected provider cannot process this currency. Recovery: Use a supported currency/provider pair. Do not silently convert amounts or currencies. Retry: After correcting the request. Default message: That currency is not supported by the selected provider. ## PROVIDER_AUTHENTICATION_FAILED · 502 Veyqo could not authenticate with the provider’s stored account credentials. Recovery: The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. Retry: After credential correction; reconcile existing payment first. Default message: Unable to authenticate with the selected provider. ## PROVIDER_UNAVAILABLE · 503 A provider timed out, was unreachable, or a checkout method is temporarily unavailable. Recovery: Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. Retry: Conditional: reconcile unknown outcomes first. Default message: The provider is not responding. Try again shortly. ## PROVIDER_REQUEST_FAILED · 422 The provider rejected an otherwise accepted Veyqo request. Recovery: Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. Retry: Only after resolving the cause. Default message: The provider refused the request. ## INVALID_WEBHOOK_SIGNATURE · 401 A provider ingress signature could not be verified. Recovery: Check the provider’s webhook secret and the exact incoming account URL. Your own webhook handler must independently validate Veyqo signatures. Retry: Provider delivery may retry after secret correction. Default message: The webhook signature could not be verified. ## PLAN_LIMIT_REACHED · 402 The organization’s plan does not permit the operation or limit reached. Recovery: Review the active plan, project/usage allowances and billing status with the organization owner. Retry: After resolving plan/billing restrictions. Default message: Your plan does not include that. Upgrade to continue. ## RATE_LIMIT_EXCEEDED · 429 The API key or address exceeded a rate limit. Recovery: Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. Retry: Yes, after Retry-After; preserve write idempotency. Default message: Too many requests. Please wait a moment and try again. ## METHOD_NOT_ALLOWED · 405 The path exists but does not accept that HTTP method. Recovery: Use the method documented for the endpoint, such as POST for verification and refunds. Retry: After fixing the method. Default message: That method is not allowed on this endpoint. ## INTERNAL_ERROR · 500 Veyqo encountered an unexpected server error. Recovery: Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. Retry: Safe reads: bounded backoff. Writes: reconcile first. Default message: Something went wrong on our end. ## CARDS_NOT_ENABLED · 403 Card issuing is off for this deployment or organization, no programme is set up in this environment, or both programmes are and none was named. Recovery: Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. Retry: No. Default message: Card issuing is not turned on for this account. ## CARD_NOT_USABLE · 409 The card or cardholder is not in a state that allows this (pending, failed or cancelled), or the Sudo card is already recorded. Recovery: Read the card's status. A cancelled card cannot be reused; issue a new one. Retry: No. Default message: That card cannot be changed in its current state. ## INSUFFICIENT_CARD_BALANCE · 409 The Veyqo programme card balance cannot cover it (a fee or a withdrawal). Recovery: Top up the card balance, then try again. Retry: After topping up. Default message: The card balance is too low for that. ## What to send support Include X-Request-Id, UTC time, endpoint, HTTP status, error.code and the affected payment/session/refund ID. Include a sanitized request with secrets and customer-sensitive data removed. For signature problems, compare the exact raw body, timestamp and digest format. Check the correct project environment and endpoint signing secret. For provider authentication failures, the merchant must correct provider credentials in their dashboard. --- # Take your integration live Move the tested integration into a separately configured live environment. ## Finish sandbox verification 1. Exercise successful, pending, failed and abandoned payment paths. 2. Confirm invalid webhook signatures are rejected. 3. Replay an event and confirm the order is fulfilled only once. 4. Test retries with the same idempotency key and order amount mismatches. 5. Check that API failures show a useful message without exposing secrets. ## Configure live independently 1. Verify your Veyqo account email and complete the provider’s own live activation requirements. 2. Select the live environment and connect your provider’s live credentials. 3. Create a live API key with only the scopes your server requires. 4. Create a live HTTPS webhook endpoint and configure its signing secret on your server. 5. Set the live server environment variables and confirm return URLs point to your production website. 6. Complete a small real payment and verify its webhook, stored payment and order status. ## Monitor after launch Track payment failures and webhook delivery failures in the dashboard. Keep order-to-payment IDs for reconciliation and retain request IDs for troubleshooting. Rotate credentials through your normal secret management process. --- # API reference Endpoint definitions published by the Veyqo API, shared with the dashboard console. ## Server API · /api/v1 Use your Veyqo secret key from a trusted server. These endpoint pages include every documented field, headers, query filters, request languages, success responses and endpoint-specific errors. - [List balances](https://veyqo.org/docs/api-balances-list): GET /balances - [List banks](https://veyqo.org/docs/api-transfers-banks): GET /transfers/banks - [Check whose account it is](https://veyqo.org/docs/api-transfers-resolve): POST /transfers/resolve - [Send a transfer](https://veyqo.org/docs/api-transfers-create): POST /transfers - [Send a batch of transfers](https://veyqo.org/docs/api-transfers-batches-create): POST /transfers/batches - [Retrieve a batch](https://veyqo.org/docs/api-transfers-batches-show): GET /transfers/batches/{id} - [List beneficiaries](https://veyqo.org/docs/api-beneficiaries-list): GET /beneficiaries - [Save a beneficiary](https://veyqo.org/docs/api-beneficiaries-create): POST /beneficiaries - [Delete a beneficiary](https://veyqo.org/docs/api-beneficiaries-delete): DELETE /beneficiaries/{id} - [List transfers](https://veyqo.org/docs/api-transfers-list): GET /transfers - [Retrieve a transfer](https://veyqo.org/docs/api-transfers-show): GET /transfers/{id} - [Create a split recipient](https://veyqo.org/docs/api-split_recipients-create): POST /split-recipients - [List split recipients](https://veyqo.org/docs/api-split_recipients-list): GET /split-recipients - [Retrieve a split recipient](https://veyqo.org/docs/api-split_recipients-show): GET /split-recipients/{id} - [Create a cardholder](https://veyqo.org/docs/api-cardholders-create): POST /cardholders - [List cardholders](https://veyqo.org/docs/api-cardholders-list): GET /cardholders - [Retrieve a cardholder](https://veyqo.org/docs/api-cardholders-show): GET /cardholders/{id} - [Issue a card](https://veyqo.org/docs/api-cards-create): POST /cards - [List cards](https://veyqo.org/docs/api-cards-list): GET /cards - [Retrieve a card](https://veyqo.org/docs/api-cards-show): GET /cards/{id} - [Freeze, unfreeze or change controls](https://veyqo.org/docs/api-cards-update): PATCH /cards/{id} - [Cancel a card](https://veyqo.org/docs/api-cards-cancel): POST /cards/{id}/cancel - [Get a card display token](https://veyqo.org/docs/api-cards-reveal_token): POST /cards/{id}/reveal-token - [List card authorizations](https://veyqo.org/docs/api-card_authorizations-list): GET /card-authorizations - [Retrieve a card authorization](https://veyqo.org/docs/api-card_authorizations-show): GET /card-authorizations/{id} - [List card transactions](https://veyqo.org/docs/api-card_transactions-list): GET /card-transactions - [Retrieve a card transaction](https://veyqo.org/docs/api-card_transactions-show): GET /card-transactions/{id} - [Simulate a card payment](https://veyqo.org/docs/api-cards-simulate_authorization): POST /cards/{id}/simulate-authorization - [Simulate a reversal](https://veyqo.org/docs/api-card_authorizations-simulate_reversal): POST /card-authorizations/{id}/simulate-reversal - [Retrieve the card balance](https://veyqo.org/docs/api-card_balance-show): GET /card-balance - [List card balance entries](https://veyqo.org/docs/api-card_balance-entries): GET /card-balance/entries - [Top up the card balance](https://veyqo.org/docs/api-card_balance-top_up): POST /card-balance/top-ups - [Set the low-balance alert](https://veyqo.org/docs/api-card_balance-threshold): PUT /card-balance/low-threshold - [Withdraw from the card balance](https://veyqo.org/docs/api-card_balance-withdraw): POST /card-balance/withdrawals - [List withdrawals](https://veyqo.org/docs/api-card_balance-withdrawals): GET /card-balance/withdrawals - [List card programmes](https://veyqo.org/docs/api-card_programmes-list): GET /card-programmes - [Set the authorization endpoint](https://veyqo.org/docs/api-card_programmes-endpoint): PUT /card-programmes/{id}/authorization-endpoint - [Rotate the endpoint secret](https://veyqo.org/docs/api-card_programmes-rotate_secret): POST /card-programmes/{id}/authorization-endpoint/rotate-secret - [Test the authorization endpoint](https://veyqo.org/docs/api-card_programmes-test): POST /card-programmes/{id}/authorization-endpoint/test - [Import existing Sudo cards](https://veyqo.org/docs/api-card_programmes-import): POST /card-programmes/imported/import - [Create a virtual account](https://veyqo.org/docs/api-virtual_accounts-create): POST /virtual-accounts - [List virtual accounts](https://veyqo.org/docs/api-virtual_accounts-list): GET /virtual-accounts - [Retrieve a virtual account](https://veyqo.org/docs/api-virtual_accounts-show): GET /virtual-accounts/{id} - [Create a plan](https://veyqo.org/docs/api-plans-create): POST /plans - [List plans](https://veyqo.org/docs/api-plans-list): GET /plans - [Retrieve a plan](https://veyqo.org/docs/api-plans-show): GET /plans/{id} - [Update or archive a plan](https://veyqo.org/docs/api-plans-update): PATCH /plans/{id} - [Start a subscription](https://veyqo.org/docs/api-subscriptions-create): POST /subscriptions - [List subscriptions](https://veyqo.org/docs/api-subscriptions-list): GET /subscriptions - [Retrieve a subscription](https://veyqo.org/docs/api-subscriptions-show): GET /subscriptions/{id} - [Cancel a subscription](https://veyqo.org/docs/api-subscriptions-cancel): POST /subscriptions/{id}/cancel - [Change a subscription's plan](https://veyqo.org/docs/api-subscriptions-change_plan): POST /subscriptions/{id}/plan - [Create a payment](https://veyqo.org/docs/api-payments-create): POST /payments - [List payments](https://veyqo.org/docs/api-payments-list): GET /payments - [Retrieve a payment](https://veyqo.org/docs/api-payments-show): GET /payments/{id} - [Cancel a payment](https://veyqo.org/docs/api-payments-cancel): POST /payments/{id}/cancel - [Verify a payment](https://veyqo.org/docs/api-payments-verify): POST /payments/{id}/verify - [Refund a payment](https://veyqo.org/docs/api-refunds-create): POST /payments/{id}/refunds - [Retrieve a refund](https://veyqo.org/docs/api-refunds-show): GET /refunds/{id} - [List events](https://veyqo.org/docs/api-events-list): GET /events - [Retrieve an event](https://veyqo.org/docs/api-events-show): GET /events/{id} - [Create a checkout session](https://veyqo.org/docs/api-checkout-sessions-create): POST /checkout/sessions - [Retrieve a checkout session](https://veyqo.org/docs/api-checkout-sessions-show): GET /checkout/sessions/{id} - [List connected providers](https://veyqo.org/docs/api-providers-list): GET /providers - [Bank List](https://veyqo.org/docs/api-safehaven-bank-list): GET /safehaven/transfers/banks - [Delete Beneficiary](https://veyqo.org/docs/api-safehaven-delete-beneficiary): DELETE /safehaven/transfers/beneficiaries/{id} - [Get Beneficiaries](https://veyqo.org/docs/api-safehaven-get-beneficiaries): GET /safehaven/transfers/beneficiaries - [Get Transfers](https://veyqo.org/docs/api-safehaven-get-transfers): GET /safehaven/transfers - [Name Enquiry](https://veyqo.org/docs/api-safehaven-name-enquiry): POST /safehaven/transfers/name-enquiry - [Transfer Status](https://veyqo.org/docs/api-safehaven-transfer-status): POST /safehaven/transfers/status - [Transfer](https://veyqo.org/docs/api-safehaven-transfer): POST /safehaven/transfers - [Purchase a Data Bundle](https://veyqo.org/docs/api-safehaven-buy-a-data-bundle): POST /safehaven/vas/pay/data - [Get Category Products](https://veyqo.org/docs/api-safehaven-get-category-products): GET /safehaven/vas/service-category/{id}/products - [Get Service Categories](https://veyqo.org/docs/api-safehaven-get-service-categories): GET /safehaven/vas/service/{id}/service-categories - [Get Service](https://veyqo.org/docs/api-safehaven-get-service): GET /safehaven/vas/service/{id} - [Get Services](https://veyqo.org/docs/api-safehaven-get-services): GET /safehaven/vas/services - [Get VAS Transaction](https://veyqo.org/docs/api-safehaven-get-vas-transaction): GET /safehaven/vas/transaction/{id} - [Get VAS Transactions](https://veyqo.org/docs/api-safehaven-get-vas-transactions): GET /safehaven/vas/transactions - [Purchase Airtime](https://veyqo.org/docs/api-safehaven-pay-airtime): POST /safehaven/vas/pay/airtime - [Pay Utility Bill](https://veyqo.org/docs/api-safehaven-pay-utility-bill): POST /safehaven/vas/pay/utility - [Purchase a Cable TV Subscription](https://veyqo.org/docs/api-safehaven-purchase-a-cable-tv-subscription): POST /safehaven/vas/pay/cable-tv - [Verify Power/Cable TV data](https://veyqo.org/docs/api-safehaven-verify-powercable-tv-data): POST /safehaven/vas/verify - [Create Account](https://veyqo.org/docs/api-safehaven-create-account): POST /safehaven/accounts - [Update Sub Account](https://veyqo.org/docs/api-safehaven-create-sub-account-copy): PUT /safehaven/subaccounts/{id} - [Create Sub Account (Corporate)](https://veyqo.org/docs/api-safehaven-create-sub-account-corporate): POST /safehaven/subaccounts/corporate - [Create Sub Account (Individual)](https://veyqo.org/docs/api-safehaven-create-sub-account-new): POST /safehaven/subaccounts/individual - [Create Virtual Account](https://veyqo.org/docs/api-safehaven-create-virtual-account): POST /safehaven/virtual-accounts - [Delete Virtual Account](https://veyqo.org/docs/api-safehaven-delete-virtual-account): DELETE /safehaven/virtual-accounts/{id} - [Get Account Statement](https://veyqo.org/docs/api-safehaven-get-account-statement): GET /safehaven/accounts/{id}/statement - [Get Account](https://veyqo.org/docs/api-safehaven-get-account): GET /safehaven/accounts/{id} - [Get Accounts](https://veyqo.org/docs/api-safehaven-get-accounts): GET /safehaven/accounts - [Get Virtual Account](https://veyqo.org/docs/api-safehaven-get-virtual-account): GET /safehaven/virtual-accounts/{id} - [Get Virtual Transaction](https://veyqo.org/docs/api-safehaven-get-virtual-transaction): GET /safehaven/virtual-accounts/{id}/transaction - [Update Account](https://veyqo.org/docs/api-safehaven-update-account): PUT /safehaven/accounts/{id} - [Update Virtual Account](https://veyqo.org/docs/api-safehaven-update-virtual-account): PUT /safehaven/virtual-accounts/{id} - [Virtual Account Transfer Status](https://veyqo.org/docs/api-safehaven-virtual-account-transfer-status): POST /safehaven/virtual-accounts/status - [Import existing sub-accounts](https://veyqo.org/docs/api-safehaven-accounts-import): POST /safehaven/accounts/import - [Create Reference](https://veyqo.org/docs/api-safehaven-create-reference): POST /safehaven/ussd-payment - [USSD Banks List](https://veyqo.org/docs/api-safehaven-ussd-banks-list): GET /safehaven/ussd-payment/banks - [Verify Checkout Transaction](https://veyqo.org/docs/api-safehaven-verify-checkout-transaction): GET /safehaven/checkout/{id}/verify - [Validate Verification](https://veyqo.org/docs/api-safehaven-validate-verification): POST /safehaven/identity/validate - [Initiate Verification](https://veyqo.org/docs/api-safehaven-verify-identity): POST /safehaven/identity - [Look up operation by idempotency key](https://veyqo.org/docs/api-safehaven-operations-lookup): GET /safehaven/operations - [Retrieve provider operation](https://veyqo.org/docs/api-safehaven-operations-show): GET /safehaven/operations/{id} ## Download the contract The reference, OpenAPI document, Postman collection and AI-readable pages are generated from the same versioned integration contract. JSON examples are illustrative, not real transactions. - [OpenAPI 3.1](/openapi.json): Import paths, scopes, schemas and examples into compatible API tools. - [Postman collection](/postman.json): Configure your own environment values; leave secrets out of shared collections. - [JSON reference](/api-reference.json): Complete endpoint and error metadata. - [Browser checkout API](https://veyqo.org/docs/browser-checkout): Separate publishable-key and session-ID surface. Download the complete OpenAPI contract at https://veyqo.org/openapi.json, JSON reference at https://veyqo.org/api-reference.json, or live definitions at https://api.veyqo.org/docs/reference. --- # Integrate SafeHaven Connect a private SafeHaven OAuth app, accept NGN transfers and use banking, bills, identity and USSD services. ## What is available SafeHaven is available for Nigerian naira (NGN). Veyqo’s standard payment and hosted-checkout endpoints collect bank transfers through short-lived, fixed-amount virtual accounts. Amounts enter and leave Veyqo in kobo: 50000 means NGN 500.00. The provider extension API adds accounts and statements, individual/corporate subaccounts, virtual-account management, bank lists, name enquiry, outbound transfers, beneficiaries, airtime, data, cable TV, utility payments, BVN/NIN verification and USSD references. Your SafeHaven app needs the corresponding permissions and product entitlements. The published SafeHaven reference does not define a refund or direct-debit API. Veyqo does not advertise refunds, saved-card subscriptions or direct debits for this connection. An outbound transfer is a separate debit, not a normalized refund. | Use case | Veyqo surface | | --- | --- | | Accept a bank transfer | POST /payments or POST /checkout/sessions with provider: safehaven | | Banking, bills, identity and USSD | /api/v1/safehaven/* provider extension endpoints | | Run an operation in the dashboard | Providers → SafeHaven connection → Open services | | Find an uncertain write | GET /safehaven/operations?idempotency_key=... | | Receive normalized collection events | payment.* events on the original project webhook | | Receive service notifications | Subscribe to provider_service.updated | | Move an existing SafeHaven integration | Connect it; existing sub-accounts are imported automatically, then repoint the SafeHaven webhook | ## Connect your account 1. Create a sandbox account at online.sandbox.safehavenmfb.com. Use the production SafeHaven portal only when you are ready for real money. 2. In Settings → OAuth Apps, create a private app with the READ, WRITE and PAY permissions your integration needs. Upload your RSA public certificate and keep its matching private key securely. 3. In Veyqo, select the project and sandbox environment, then connect SafeHaven. Enter the OAuth client ID, PEM private key and company URL (JWT issuer). Click Load accounts and select the settlement account by name and number. Veyqo fills its internal _id and account number automatically. Loading accounts does not save credentials; Connect saves them after verification. 4. Veyqo signs short-lived RS256 assertions, exchanges them for OAuth tokens, and checks that the account ID and account number match. You do not paste temporary access or refresh tokens into Veyqo. 5. Choose a dedicated provider account or explicitly share it with other projects in the same organization and environment type. Sandbox and live credentials never mix. 6. Enable webhooks in SafeHaven Settings → Notification Settings. Paste Veyqo’s provider-account webhook URL. Veyqo supplies the same URL when creating virtual accounts. Configure your own outgoing Veyqo webhook separately. > Paste the PEM key with its line breaks. Never put the private key, a Veyqo secret key or an OAuth access token in browser code. Connecting does not create accounts or move funds. [SafeHaven: create an OAuth app](https://safehavenmfb.readme.io/reference/creating-an-app) ## Accept a payment Create a payment or hosted session on your server with provider set to safehaven. A direct payment’s data.checkout_url is a Veyqo-hosted page displaying the transfer account. A hosted session returns data.url as usual. The generated account accepts the exact amount and expires after 15 minutes. Veyqo uses its own globally unique payment ID as the upstream reference. Save the returned payment/session ID and verify status, amount, currency and order ownership before fulfilment. No SafeHaven secret is exposed to the checkout page. The hosted page displays bank-transfer instructions; USSD service operations are available separately through the extension API. ```bash curl --request POST 'https://api.veyqo.org/api/v1/checkout/sessions' \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Idempotency-Key: $ORDER_CHECKOUT_KEY" \ --header 'Content-Type: application/json' \ --data '{"provider":"safehaven","amount":50000,"currency":"NGN","reference":"order-1001","customer":{"email":"customer@example.com"}}' ``` ## Track credits, debits and payment activity A direct transfer into a subaccount does not need a payment initialized through Veyqo. After its verified SafeHaven notification is processed, find it in Transactions → Bank activity for the project environment that owns the account. Existing recorded deposits are included. The dashboard opens Bank activity automatically when deposits exist and there are no API payments. Overview totals, charts, success rates and recent payments include checkout collections, verified deposits, account debits, outbound transfers and bill purchases. Bank activity includes these banking and service operations. A purchase and its matching debit notification count once. Volume combines successful credits and debits; it is not net revenue. API payments remains the history of payments created through the payment or checkout endpoints. Direct account credits remain bank receipts and emit provider_service.updated, with service account-credit or virtual-account-credit. Subscribe to that event when crediting customer wallets from direct deposits; do not wait for a payment.succeeded event for a checkout payment that was never created. Transactions → Bills is a dedicated history for airtime, data, electricity and TV purchases. Filter by bill type and open a receipt to see recipient, bill amount, actual debit, fulfilment, reported charges and references. Electricity recharge tokens appear when returned by the provider. Older bank-detail links to bills open the same receipt. For new purchases, Veyqo stores only an encrypted allowlist of receipt context: recipient number, service/package identifiers, amount, funding account and merchant reference. Historical records display recipient details only when present in their saved provider result; Veyqo does not invent them. A verified matching bank debit supplies the financial status and actual debited amount. The original bill or transfer service outcome remains separate and appears as Service fulfilment status when different. A successful debit does not by itself establish delivery of airtime or another service. Open a bank deposit to inspect its amount, bank reference, receiving account, sender, narration, fees, VAT, stamp duty and provider reversal state. Amounts are kobo. If a deposit is missing, check the selected project and Live/Sandbox environment, the account import, and the provider webhook processing status. ## Grant service permissions explicitly Existing payment permissions do not authorize outbound transfers or bill payments. An organization owner or admin must grant account, transfer, bill-payment and identity scopes; a developer cannot grant them to themselves. Create a scoped key for the service you need. Write permissions imply the corresponding read permission. Operation lookup also requires events:read plus the read permission for the original service. | Scope | Allows | | --- | --- | | payments:write / payments:read | Collections, checkout, USSD references and checkout verification | | accounts:write / accounts:read | Bank accounts, subaccounts, virtual accounts, balances and statements | | transfers:write / transfers:read | Outbound transfers, beneficiary management, name enquiry and transfer status | | bills:write / bills:read | VAS purchases, service catalogues, recipient verification and transaction lookup | | identity:write / identity:read | Initiate and validate identity checks; read their operation records | | events:read | Read normalized events and look up provider operation records | ## Make a transfer safely 1. List banks with GET /safehaven/transfers/banks. 2. Call POST /safehaven/transfers/name-enquiry with bank_code and account_number. Save the returned session_id; Veyqo binds it to this project and the exact destination. 3. Call POST /safehaven/transfers with name_enquiry_reference, beneficiary_bank_code, beneficiary_account_number, integer amount in kobo, and save_beneficiary. Persist one Idempotency-Key before sending. 4. The configured settlement account is the default debit source. Another debit_account_number must be a bank account created in this project environment. A name enquiry for a different beneficiary is rejected. 5. Save data.operation_id and the returned provider session_id. Created or pending means the request is not settled. Use POST /safehaven/transfers/status to reconcile, and process provider_service.updated notifications. 6. If the request times out, look up the same idempotency key using GET /safehaven/operations. Unknown transfers are queried by their Veyqo-generated upstream reference. The read does not resubmit the transfer. > Every service write requires Idempotency-Key, including PUT and DELETE operations. Ambiguous writes stay claimed durably, beyond the general idempotency-cache lifetime. A new key can cause another debit; reconcile first. ## Bills and identity verification For bills, discover services, categories and products at runtime. Verify the meter or cable account using /safehaven/vas/verify before purchasing where the provider requires it. Do not hard-code product IDs or assume every product is enabled for your account. Purchase airtime, data, cable TV or utilities with the appropriate bills:write endpoint. Amount is kobo; Veyqo converts it to naira. The configured account is the default debit source. Save the operation and resource IDs and check the actual provider status. Initiate BVN/NIN verification at POST /safehaven/identity. Validate the resulting identity_id and customer OTP at POST /safehaven/identity/validate, then use that project-owned identity for a subaccount where required. These checks can charge the bank account. Corporate subaccounts require the provider’s director verification and company registration requirements. Individual identity types and conditional OTP/identity requirements follow the chosen SafeHaven verification method. Identity results are encrypted at rest. Generic logs redact identity numbers, OTPs and images. Notifications contain resource identifiers and status, not the identity report. Do not copy sensitive identity results into application logs. ## Move an existing SafeHaven integration If your application already calls SafeHaven directly, its customers’ sub-accounts were created outside Veyqo. Veyqo brings them across for you: connecting a dedicated SafeHaven account starts a background import of every sub-account the app can see, and its progress shows on the connection page. Nothing is written to SafeHaven and no money moves. 1. Connect the same SafeHaven OAuth app in Veyqo (sandbox first), with your existing main account as the settlement account, as a dedicated (not shared) provider account. Sub-accounts that auto-sweep into it keep working, and customers’ existing BVN/NIN verifications keep working: on a dedicated account Veyqo accepts identities, transfers and bills created before the switch, because SafeHaven only returns this app’s own. 2. Open the connection page and watch Existing accounts: the import pages through every sub-account and reports how many were imported, already there, or skipped. On a shared provider account it does not start on its own, because which project should hold the existing accounts is your decision; press Import accounts in the project that should. 3. Skipped accounts are held by another project or are the main account. If one of your customers’ accounts is missing, it was not visible to these credentials (wrong app or environment). You can also import specific accounts from your server with POST /safehaven/accounts/import (account_id or account_number, 100 per call, safe to repeat). 4. Change your code to call the /safehaven endpoints with snake_case fields and kobo amounts, an Idempotency-Key on every write (your own transfer or bill reference works well), and GET /safehaven/operations?idempotency_key=... to check a transfer’s status. Veyqo generates the upstream paymentReference; yours is returned as merchant_reference. 5. Add a handler for Veyqo webhooks and credit deposits from provider_service.updated events with service account-credit (see below). Veyqo has already confirmed each deposit with SafeHaven. 6. Let transfers already in flight finish on the old integration. Then, once the import shows Complete, replace your old webhook URL in SafeHaven Settings → Notification Settings with Veyqo’s provider-account webhook URL. From that moment every deposit reaches you through Veyqo. ```bash curl --request POST 'https://api.veyqo.org/api/v1/safehaven/accounts/import' \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header 'Content-Type: application/json' \ --data '{"accounts":[{"account_id":"64f1c2e9a1b2c3d4e5f60789"},{"account_number":"5011722957"}]}' ``` > Repoint the webhook only after the import completes. A deposit to an account Veyqo does not hold is not forwarded to you. ## Shared credentials and project routing Veyqo generates the upstream reference for supported writes. Your external_reference or payment_reference is preserved as merchant_reference in the response; it never chooses a project. A service operation returns a pso_ operation_id. On a shared provider account, each owned account, verification, enquiry, transaction and operation record is bound to its original project environment and provider connection. On a dedicated account, identities and read-only lookups of resources created outside Veyqo are also accepted, since everything under those credentials is the project’s; money movement still requires a name enquiry and debit account held by the project. Resource reads stay pinned to that connection after an account switch. IDs from another project return RESOURCE_NOT_FOUND. The configured root account balance is pooled across projects sharing that bank account; it is not a per-project ledger. Use project-owned subaccounts for isolated balances. Account lists exclude unowned subaccounts. Transfer and bill history contain only locally initiated project records, with one-based page/per_page pagination and status/date filters. History remains readable after disconnecting a provider. Beneficiary lists include only destinations used by this project. Statements on a shared root account are refused; use a project-owned subaccount. Account-level notifications for a shared settlement account cannot identify a project reliably. Unmatched notifications are ignored. Incoming credit to a project-created or imported subaccount and outgoing transfers created by Veyqo can be routed through their stored ownership. Other services without a published webhook contract must be polled. ## Webhook trust and event payloads SafeHaven’s public webhook documentation specifies event bodies but no signature scheme. Veyqo treats the notification as a hint, authenticates to SafeHaven and fetches the transaction before accepting a collection or transfer state change. No invented HMAC header or secret is required. A failed provider verification does not settle a payment. Provider outages leave the delivery retryable. Collection success is verified again against the stored payment amount and currency before emitting payment.succeeded. Subscribe to provider_service.updated for service resource creation or a verified status change. Its data contains operation_id, service, kind, resource_id, provider and provider status; monetary resources include amount and currency (kobo). The event is not a payment.* payload. An accepted request can still be pending. Ledger notifications with eventType account.debit and type debit are verified against the authenticated account statement, rather than the transfer-status endpoint. Verification matches reference, amount, debit direction and account. An unverified notification never updates a transaction. For a shared connection, the originating bill or owned account must identify the project; Veyqo never guesses. Plan usage includes successful live collections, direct deposits, account debits, bank transfers and bill purchases once each. Sandbox, failed or pending purchases, read-only queries, webhook retries and debit acknowledgements for an already-counted bill do not add usage. Existing durable receipts in the current billing period are included automatically. Transfers and deposits also carry direction (credit or debit), credit_account_number and credit_account_name, debit_account_number and debit_account_name, narration, session_id, fees, vat, stamp_duty, is_reversed and response_code. These keys are always present and null when they do not apply. To credit a deposit: handle service account-credit (or virtual-account-credit) with direction credit, find the customer by credit_account_number, skip it if is_reversed is true or status is not Completed, and record session_id with a unique constraint so a deposit is never credited twice. Your outgoing Veyqo webhook keeps the same raw-body HMAC signature verification, replay tolerance and event-ID deduplication as other Veyqo events. [SafeHaven webhook reference](https://safehavenmfb.readme.io/reference/webhooks) ## Troubleshooting | Problem | Action | | --- | --- | | PROVIDER_AUTHENTICATION_FAILED | Check the environment, private OAuth app, client ID, PEM key, issuer URL and SafeHaven app permissions. | | Settlement account mismatch | Use the account _id and its matching ten-digit NUBAN. These are different identifiers. | | VALIDATION_FAILED | Use snake_case request fields, positive integer kobo amounts and the documented product-specific required fields. Callback URLs are owned by Veyqo. | | RESOURCE_NOT_FOUND | Use a resource from the same project environment. Create or list the resource here before using it. | | INSUFFICIENT_PERMISSION | Grant the explicit service scope. Shared root-account statements require a project-owned subaccount. | | PROVIDER_REQUEST_FAILED | Check SafeHaven product activation, KYC, balance, transaction limits and service-specific response details. | | IDEMPOTENCY_KEY_REUSED | Keep one key and unchanged payload per operation. Use a new key only for a deliberately new operation. | | IDEMPOTENCY_IN_PROGRESS | The first write is pending or uncertain. Look up the original key and reconcile with SafeHaven. Do not blindly debit again. | | Provider timeout or outage | Retry reads after backoff. Reconcile writes by operation ID/key before sending another write. | --- # Provider accounts & project routing Use separate credentials, shared credentials, or a mixture without mixing project data. ## Organization → project → environment → assignment A provider account owns one encrypted credential set in one organization and environment type. A project environment assigns that account through a connection. A project may use dedicated Paystack credentials and shared Flutterwave credentials at the same time. Every public API key is bound to one project environment. API requests never select another project through a project_id field or a header, and shared provider credentials never combine the projects’ payment lists. ## Configure dedicated or shared accounts 1. In a project’s sandbox/live provider page, choose Connect a new account for separate credentials, or Use an existing account for an eligible shared/unassigned account. 2. Sharing is off by default. An owner/admin can enable it for reuse in another project of the same organization and environment type. 3. Assign the saved account separately in each project that will use it. Sharing cannot be disabled while multiple current assignments exist. 4. Copy the incoming account webhook URL into the provider dashboard. Then configure each project’s outgoing webhook URL and signing secret separately. ## How incoming events find the right project Veyqo verifies the provider signature for the incoming account, then matches the stored payment within that account and organization. It prefers the unique Veyqo payment ID and requires an unambiguous match for a provider reference fallback. Merchant order references and untrusted project metadata are not sufficient routing instructions. Two projects can both use ORDER-1001 because Veyqo sends its own unique payment identifier to the provider. Account-scoped event deduplication prevents duplicate processing across old URL aliases. Unknown or ambiguous events are retained for investigation instead of being broadcast to projects. Outgoing normalized events go only to the owning project’s subscribed endpoints. ## Switch, rotate and disconnect mean different things | Action | Effect | | --- | --- | | Switch account | Creates a new assignment for future payments. Existing payments, refunds and late webhooks retain the original account. | | Update credentials | Rotates the account-wide active credentials for every project using it. Use only for keys belonging to the same external provider account. | | Disconnect | Detaches the selected project assignment; shared projects and historical reconciliation keep their account relationship. | | Reuse account | Uses the saved credential set without copying secret credentials into another project. | > Do not connect multiple Veyqo accounts using different keys for the same external provider account and assume events will route across them. Exact duplicate credential sets are refused for new accounts, but external account identity cannot be inferred generically from different keys. Review legacy duplicate accounts before moving provider webhook URLs. ## Public API behavior The public payment API remains unchanged. Pass a provider slug when needed; the environment key resolves its current assignment. Provider account IDs and credentials are managed through the dashboard, not the public payments API. Veyqo’s platform billing account is never available for merchant sharing. --- # Idempotency & safe retries Prevent duplicate operations and recover safely from network uncertainty. ## Persist a key before each write Generate one high-entropy key per logical payment creation, checkout-session creation or refund. Persist it with your operation before sending the HTTP request. Send it as Idempotency-Key, at most 255 characters. The header is optional, but omitting it opts out of the replay guarantee. Uniqueness is scoped to the project environment across endpoints. A reused key with a different method, path or JSON body returns IDEMPOTENCY_KEY_REUSED. ## What is replayed A completed successful request replays its original response status and body, with Idempotency-Replayed: true. Default retention is 24 hours. After expiration/pruning, there is no replay guarantee. Whitespace and JSON object-key order do not change the fingerprint. A request still in progress returns IDEMPOTENCY_IN_PROGRESS. Wait and retry unchanged. Error responses and thrown failures are not retained as completed results. A provider call may already have created a local payment before failing. Reconcile that record by ID/reference and verify uncertain outcomes before trying a new charge. ## Do not cache verification polls The middleware honors Idempotency-Key on POST generally, including verification. Omit it for repeated POST /payments/{id}/verify polls: reusing one can replay an earlier pending result instead of asking the provider again. ## Retry decision table | Situation | Action | | --- | --- | | Network timeout / lost write response | Retrieve and reconcile the original operation, then retry unchanged with its persisted key when appropriate. | | 409 IDEMPOTENCY_IN_PROGRESS | Wait with jitter and retry unchanged. | | 409 IDEMPOTENCY_KEY_REUSED | Restore the original request or use a new key only for a genuinely different operation. | | 429 | Honor Retry-After; bound retries and concurrency. | | 422 validation/business rejection | Correct the input/state/configuration first. | | 503 / 500 on a safe read | Bounded exponential backoff with jitter. | | Duplicate webhook delivery | Acknowledge after durable deduplication; do not fulfil twice. | --- # Pagination & rate limits Read result pages and react to the real service limits. ## Page through payments and events List endpoints use page and per_page. Default per_page is 25; maximum is 100. Results are newest first. Use meta.has_more to decide whether to request the next page. Do not assume an empty page is a missing resource error. Payment filters are status, reference, created_after and created_before. Event filters are type, payment_id, created_after and created_before. The payments list does not currently implement provider or currency filters. Use ISO 8601 dates/times and URL-encode query values. ```json { "success": true, "data": [], "meta": { "page": 1, "per_page": 25, "total": 0, "has_more": false } } ``` ## Rate-limit headers Default server API allowance: 100 requests per key per minute. Payment/checkout creation has an additional 60-per-minute allowance. Address-level protections also apply. Deployment configuration can change defaults; response headers are authoritative. Read X-RateLimit-Limit and X-RateLimit-Remaining. A 429 response includes Retry-After; do not immediately loop or rotate keys to evade the limit. Slow down concurrency and use bounded backoff with jitter. ## Currency units Amounts are integers, never decimal major-unit prices. Use the exponent below instead of multiplying every currency by 100. The selected provider must separately support the currency; this platform list is not a promise of provider availability. | Code | Currency | Exponent | Example: 500 major units | | --- | --- | --- | --- | | NGN | Nigerian Naira | 2 | 50000 | | USD | US Dollar | 2 | 50000 | | GHS | Ghanaian Cedi | 2 | 50000 | | KES | Kenyan Shilling | 2 | 50000 | | ZAR | South African Rand | 2 | 50000 | | EUR | Euro | 2 | 50000 | | GBP | British Pound | 2 | 50000 | | CAD | Canadian Dollar | 2 | 50000 | | AUD | Australian Dollar | 2 | 50000 | | SGD | Singapore Dollar | 2 | 50000 | | JPY | Japanese Yen | 0 | 500 | | UGX | Ugandan Shilling | 0 | 500 | | TZS | Tanzanian Shilling | 0 | 500 | --- # Events & reconciliation Recover missed notifications without confusing event snapshots with current payment state. ## Read your environment’s event history Use a key with events:read. GET /events supports type, payment_id and inclusive creation-time bounds with pagination. GET /events/{id} returns a single normalized event. Event IDs belong to one project environment. - [List events](https://veyqo.org/docs/api-events-list): GET /events - [Retrieve an event](https://veyqo.org/docs/api-events-show): GET /events/{id} ## Snapshots and current truth An event records what was true when it fired. A later refund does not rewrite the original payment.succeeded event. Fetch the payment/refund for its current state when reconciling a missed or out-of-order event. The events API returns {success:true,data:event}; an outgoing webhook sends event directly. The JSON content is the same, but database serialization may change key order, so an events API response cannot replace the raw signed delivery body. ## A reconciliation worker 1. Persist the IDs of locally unresolved orders and their Veyqo payment/session IDs. 2. Poll unresolved payment records using a payments:read key and fresh verification requests where needed. 3. Page through event history for the outage window, with overlap to tolerate processing delay; deduplicate by event ID. 4. Compare verified status, amount, currency and trusted order/session association. 5. Atomically update the order and enqueue fulfilment once. Record unresolved discrepancies for investigation. --- # Payment links Create a fixed-price link in the dashboard and track the resulting checkout payments. ## Create and share a link Create a payment link in the selected project environment’s dashboard. Set its title, amount in minor units, currency and provider as available. The hosted link is /pay/l/{plink_id}; customers start a checkout session from that link. Link creation/management is currently a dashboard operation. There is no public POST /api/v1/payment-links endpoint. The browser link endpoints below read an active link and create customer sessions with its fixed server-configured amount. - [Read a payment link](https://veyqo.org/docs/api-browser-links-show): GET /links/{id} - [Start a payment-link session](https://veyqo.org/docs/api-browser-links-sessions): POST /links/{id}/sessions ## Track the order outcome Payments carry payment_link metadata and normalized payment events. Track each payment independently; sharing a URL does not make a browser callback proof that a specific customer order is paid. Use a server-created checkout session when an individual order’s price and identity must be fixed in advance. Inactive links return RESOURCE_NOT_FOUND. --- # Browser checkout reference The separate public session surface used by the hosted page and checkout script. ## Use the hosted client where possible Base URL: https://api.veyqo.org/checkout/v1 Only browser session creation uses a publishable key. Session and active payment-link IDs address subsequent calls. Never send a Veyqo secret API key to these browser endpoints. Browser-defined prices are untrusted for fulfilment. Prefer server-created sessions for actual orders. Methods and next_action are provider-dependent; use returned values and the Veyqo-hosted client instead of assuming every gateway offers the same flow. - [Create a browser checkout session](https://veyqo.org/docs/api-browser-sessions-create): POST /sessions - [Read browser checkout state](https://veyqo.org/docs/api-browser-sessions-show): GET /sessions/{id} - [Start a checkout method](https://veyqo.org/docs/api-browser-sessions-charge): POST /sessions/{id}/charge - [Submit a checkout OTP](https://veyqo.org/docs/api-browser-sessions-otp): POST /sessions/{id}/otp - [Read a payment link](https://veyqo.org/docs/api-browser-links-show): GET /links/{id} - [Start a payment-link session](https://veyqo.org/docs/api-browser-links-sessions): POST /links/{id}/sessions ## Understand method and action fields methods is the currently offered method list, with method identifiers and provider-dependent bank/network choices. Send a returned method identifier to charge; do not assume card, bank_transfer, ussd or mobile_money is enabled for every provider and currency. next_action is null before an action is needed. A card action supplies provider plus config for the provider card client, or frame_url for a hosted form. Paystack config includes key, email, amount, currency, reference and channels; this key is intentionally public. A bank_transfer action supplies account_number, bank_name, account_name, amount, currency, expires_at and possibly note. A ussd action supplies code and bank_name. An otp action asks for the customer OTP; send it to the session otp endpoint. approve_on_phone supplies a note while the customer approves the prompt. A none action requires no further customer input. Fields may be absent or null when the upstream gateway does not supply them. Never collect raw card details on your own server. Use the hosted Veyqo page or checkout script to handle provider UI. A completed customer action still requires trusted payment verification before fulfilment. --- # Integration changelog Contract corrections and recent integration behavior to account for. ## 2026-11-02 · Documentation contract audit Corrected the direct-payment checkout field to checkout_url, payment lookup by path reference, actual payment/event filters and raw hexadecimal webhook signatures. Added complete endpoint schemas, success responses, error recovery, browser checkout, SDK callbacks, payment links, event reconciliation and shared provider-account routing. Added generated OpenAPI, Postman, JSON reference and AI instruction templates. These documentation changes describe the implemented API; they do not introduce a new API version. ## Recent platform changes Provider accounts can now be dedicated or explicitly shared across projects within one organization/environment type. Switches affect future payments while historical payment/refund ownership remains. Provider logos are managed in the staff console and returned in dashboard catalogue metadata. This does not add a credential-management route to the public payments API. Staff invitations, custom staff permissions and admin themes are internal console capabilities. Merchant developers authenticate the public API with scoped project-environment keys, not staff sessions. ## Compatibility policy The public API uses the /api/v1 contract. Response fields may be added; clients should ignore unrecognized fields. Do not match on message wording, provider-specific redirect URLs or JSON property order. Branch on documented status/error/event values and retain unknown events safely for inspection. --- # List balances What each connected provider account holds, per currency, in minor units, read from the providers (cached for a minute). `available: false` means the provider does not report balances; `error` means it did not answer. Shared provider accounts are not listed. ## Endpoint GET https://api.veyqo.org/api/v1/balances Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/balances" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/balances`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/balances', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "provider": "paystack", "available": true, "balances": [ { "currency": "NGN", "available": 12345600, "pending": null } ], "error": null, "checked_at": "2026-11-17T12:00:00+00:00" }, { "provider": "nomba", "available": false, "balances": [], "error": null, "checked_at": "2026-11-17T12:00:00+00:00" } ] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | provider | string | Optional | Provider slug. | | available | boolean | Optional | Whether this provider reports balances to Veyqo. | | balances | array | Optional | Per currency: currency, available (spendable, minor units) and pending (on its way in, or null). | | error | string \| null | Optional | Set when the provider did not answer. | | checked_at | string | Optional | When it was read. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List banks Without `provider`: every bank by its Veyqo id (the NIBSS institution code) and which of your providers can send to it. With `provider`: exactly the banks that provider accepts, with its own `code` and the Veyqo `id` where there is one (null means send it with `bank_code`). ## Endpoint GET https://api.veyqo.org/api/v1/transfers/banks Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | provider | query | No | A connected provider: list exactly its banks and codes. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/transfers/banks" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/transfers/banks`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/transfers/banks', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "000013", "name": "Guaranty Trust Bank (GTBank)", "providers": [ "paystack", "nomba" ] }, { "id": "090267", "name": "Kuda Microfinance Bank", "providers": [ "paystack" ] } ] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string \| null | Optional | Veyqo bank id: the NIBSS institution code. | | name | string | Optional | Bank name. | | providers | array | Optional | Without provider: your providers that can send to it. | | code | string | Optional | With provider: that provider's own code. | | logo | string \| null | Optional | With provider: a logo URL, when the provider has one. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Check whose account it is Name enquiry before you send: the account holder's name as the bank has it, on the provider that would send the transfer. Pass `bank` (a Veyqo bank id), or `bank_code` with `provider`. ## Endpoint POST https://api.veyqo.org/api/v1/transfers/resolve Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/transfers/resolve" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "bank": "000013", "account_number": "0123456789" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/transfers/resolve`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "bank": "000013", "account_number": "0123456789" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "bank": "000013", "account_number": "0123456789" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/transfers/resolve', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "bank": "000013", "account_number": "0123456789" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | bank | string \| null | Optional | Veyqo bank id from GET /transfers/banks. Required unless bank_code is given. Maximum 10 characters. | | bank_code | string \| null | Optional | A provider's own bank code instead of bank; needs provider when several are connected. Maximum 20 characters. | | account_number | string | Required | The 10-digit NUBAN. Maximum 10 characters. | | provider | string \| null | Optional | Which connected provider sends it. Omitted: the first that can reach the bank. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "account_name": "ADA LOVELACE", "account_number": "0123456789", "bank": { "id": "000013", "code": "058", "name": "Guaranty Trust Bank (GTBank)" }, "provider": "paystack" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | account_name | string | Optional | As the bank has it. | | account_number | string | Optional | The 10-digit NUBAN. | | bank | object | Optional | id, code (the provider's) and name. | | provider | string | Optional | The provider that checked it, and would send the transfer. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Send a transfer Checks the account by name enquiry, then sends once from your provider balance. Veyqo translates the bank, amount and reference into the provider's own format. Pass `account_name` to refuse it when the bank's name for the account differs. `status` is `successful`, `failed` (nothing was sent, or it was returned) or `pending`; a pending transfer settles by itself (at once when the provider notifies Veyqo, else within minutes) and sends `transfer.successful` or `transfer.failed`. At or above your organization's approval limit it is `awaiting_approval`: checked but not sent until an owner or admin approves it in the dashboard (rejected after 7 days). ## Endpoint POST https://api.veyqo.org/api/v1/transfers Server secret key required. Scope: transfers:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/transfers" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "amount": 500000, "bank": "000013", "account_number": "0123456789", "account_name": "Ada Lovelace", "narration": "Vendor payout", "reference": "PAYOUT-1001", "metadata": { "vendor_id": "42" } }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/transfers`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "amount": 500000, "bank": "000013", "account_number": "0123456789", "account_name": "Ada Lovelace", "narration": "Vendor payout", "reference": "PAYOUT-1001", "metadata": { "vendor_id": "42" } }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "amount": 500000, "bank": "000013", "account_number": "0123456789", "account_name": "Ada Lovelace", "narration": "Vendor payout", "reference": "PAYOUT-1001", "metadata": { "vendor_id": "42" } } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/transfers', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "amount": 500000, "bank": "000013", "account_number": "0123456789", "account_name": "Ada Lovelace", "narration": "Vendor payout", "reference": "PAYOUT-1001", "metadata": { "vendor_id": "42" } }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | beneficiary | string \| null | Optional | A saved beneficiary's id (ben_…) instead of bank and account_number. | | bank | string \| null | Optional | Veyqo bank id from GET /transfers/banks. Required unless bank_code is given. Maximum 10 characters. | | bank_code | string \| null | Optional | A provider's own bank code instead of bank; needs provider when several are connected. Maximum 20 characters. | | account_number | string | Optional | The 10-digit NUBAN. Maximum 10 characters. | | provider | string \| null | Optional | Which connected provider sends it. Omitted: the first that can reach the bank. | | amount | integer | Required | In kobo. Minimum 1. | | currency | string \| null | Optional | NGN (the default). | | account_name | string \| null | Optional | Optional: refuse the transfer if the bank's name for the account does not match. Maximum 190 characters. | | narration | string \| null | Optional | Shown to the beneficiary where the bank supports it. Maximum 100 characters. | | reference | string \| null | Optional | Your reference; unique in the environment. Maximum 150 characters. | | metadata | object \| null | Optional | Your own key-values. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "trf_01M7Q4A1B2C3D4E5F6G7H8J9K0", "object": "transfer", "reference": "PAYOUT-1001", "status": "successful", "amount": 500000, "currency": "NGN", "bank": { "id": "000013", "code": "058", "name": "Guaranty Trust Bank (GTBank)" }, "account_number": "0123456789", "account_name": "ADA LOVELACE", "narration": "Vendor payout", "provider": { "name": "paystack", "reference": "vt01m7q4a1b2c3d4e5f6g7h8j9k0", "transfer_id": "TRF_1ptvuv321ahaa7q" }, "failure_message": null, "approval": null, "metadata": { "vendor_id": "42" }, "completed_at": "2026-11-21T12:00:03+00:00", "created_at": "2026-11-21T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | trf_ id. | | object | string | Optional | Always transfer. | | reference | string \| null | Optional | Your own reference, unique in the environment. | | status | string | Optional | pending, successful, failed, or awaiting_approval (held at or above your approval limit until an owner or admin approves it in the dashboard). Values: pending, successful, failed, awaiting_approval. | | amount | integer | Optional | In kobo. | | currency | string | Optional | NGN. | | bank | object | Optional | id (Veyqo bank id, or null when sent by bank_code), code (the provider's own) and name. | | account_number | string | Optional | The 10-digit NUBAN. | | account_name | string \| null | Optional | As the bank returned it at name enquiry. | | narration | string \| null | Optional | What the beneficiary sees, where the bank shows it. | | provider | object | Optional | name, the reference Veyqo sent it (reference) and its own transfer id (transfer_id). | | failure_message | string \| null | Optional | Why it failed. | | approval | object \| null | Optional | Set when the transfer needed approval: required, and approved_at once approved. | | metadata | object | Optional | Your own key-values. | | completed_at | string \| null | Optional | When it succeeded or failed. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | DUPLICATE_REFERENCE | 409 | Retrieve that payment and reconcile its state. For a genuinely new attempt, use a new unique reference and operation key; do not create a second charge just because a response was lost. | Reconcile first. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Send a batch of transfers Up to 200 transfers in one request (payroll, vendor payouts), sent one by one in the background, each checked by name first. `reference` identifies the batch: the same one twice is refused. Each transfer may carry its own reference; a retried batch never pays a row twice. Read the outcome with GET /transfers/batches/{id}; each transfer also sends its own events. ## Endpoint POST https://api.veyqo.org/api/v1/transfers/batches Server secret key required. Scope: transfers:write. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/transfers/batches" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "reference": "payroll-2026-11", "transfers": [ { "bank": "000013", "account_number": "0123456789", "amount": 100000, "narration": "Wages" }, { "bank": "090267", "account_number": "0987654321", "amount": 200000, "reference": "NOV-ADA" } ] }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/transfers/batches`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "reference": "payroll-2026-11", "transfers": [ { "bank": "000013", "account_number": "0123456789", "amount": 100000, "narration": "Wages" }, { "bank": "090267", "account_number": "0987654321", "amount": 200000, "reference": "NOV-ADA" } ] }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "reference": "payroll-2026-11", "transfers": [ { "bank": "000013", "account_number": "0123456789", "amount": 100000, "narration": "Wages" }, { "bank": "090267", "account_number": "0987654321", "amount": 200000, "reference": "NOV-ADA" } ] } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/transfers/batches', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "reference": "payroll-2026-11", "transfers": [ { "bank": "000013", "account_number": "0123456789", "amount": 100000, "narration": "Wages" }, { "bank": "090267", "account_number": "0987654321", "amount": 200000, "reference": "NOV-ADA" } ] }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | reference | string | Required | Identifies the batch; the same one twice is refused. Maximum 150 characters. | | provider | string \| null | Optional | Send every row through this provider; omitted, each row is routed. | | transfers | array | Required | 1 to 200 of: bank or bank_code, account_number, amount (kobo), optional account_name, narration, reference. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "tbat_01M7Q5B1C2D3E4F5G6H7J8K9L0", "object": "transfer_batch", "status": "queued", "provider": null, "total": 2, "total_amount": 300000, "currency": "NGN", "progress": { "queued": 2, "sent": 0, "refused": 0 }, "transfers": [ { "row": 1, "reference": "tbat_01M7Q5B1C2D3E4F5G6H7J8K9L0-1", "amount": 100000, "outcome": "queued", "transfer_id": null, "status": null, "error": null }, { "row": 2, "reference": "NOV-ADA", "amount": 200000, "outcome": "queued", "transfer_id": null, "status": null, "error": null } ], "created_at": "2026-11-17T12:00:00+00:00", "completed_at": null } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | tbat_ id. | | object | string | Optional | Always transfer_batch. | | status | string | Optional | queued, sending or done. Values: queued, sending, done. | | provider | string \| null | Optional | Provider used for every row, or null for automatic. | | total | integer | Optional | Rows. | | total_amount | integer | Optional | Kobo. | | currency | string | Optional | NGN. | | progress | object | Optional | queued, sent and refused counts. | | transfers | array | Optional | Per row: row, reference, amount, outcome (queued, sent, refused), transfer_id, status and error. | | created_at | string | Optional | ISO 8601. Format: date-time. | | completed_at | string \| null | Optional | When every row was handled. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | DUPLICATE_REFERENCE | 409 | Retrieve that payment and reconcile its state. For a genuinely new attempt, use a new unique reference and operation key; do not create a second charge just because a response was lost. | Reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a batch Its status (queued, sending, done), counts, and each transfer's outcome: sent (with transfer_id and status) or refused (with why). ## Endpoint GET https://api.veyqo.org/api/v1/transfers/batches/{id} Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/transfers/batches/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/transfers/batches/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/transfers/batches/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "tbat_01M7Q5B1C2D3E4F5G6H7J8K9L0", "object": "transfer_batch", "status": "done", "provider": null, "total": 2, "total_amount": 300000, "currency": "NGN", "progress": { "queued": 0, "sent": 2, "refused": 0 }, "transfers": [ { "row": 1, "reference": "tbat_01M7Q5B1C2D3E4F5G6H7J8K9L0-1", "amount": 100000, "outcome": "sent", "transfer_id": "trf_01M7Q5C1D2E3F4G5H6J7K8L9M0", "status": "successful", "error": null }, { "row": 2, "reference": "NOV-ADA", "amount": 200000, "outcome": "sent", "transfer_id": "trf_01M7Q5D1E2F3G4H5J6K7L8M9N0", "status": "pending", "error": null } ], "created_at": "2026-11-17T12:00:00+00:00", "completed_at": "2026-11-17T12:00:09+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | tbat_ id. | | object | string | Optional | Always transfer_batch. | | status | string | Optional | queued, sending or done. Values: queued, sending, done. | | provider | string \| null | Optional | Provider used for every row, or null for automatic. | | total | integer | Optional | Rows. | | total_amount | integer | Optional | Kobo. | | currency | string | Optional | NGN. | | progress | object | Optional | queued, sent and refused counts. | | transfers | array | Optional | Per row: row, reference, amount, outcome (queued, sent, refused), transfer_id, status and error. | | created_at | string | Optional | ISO 8601. Format: date-time. | | completed_at | string \| null | Optional | When every row was handled. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List beneficiaries Your saved bank accounts, newest first and paginated, each with the account name checked when it was saved. ## Endpoint GET https://api.veyqo.org/api/v1/beneficiaries Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/beneficiaries" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/beneficiaries`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/beneficiaries', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "ben_01M7Q5A1B2C3D4E5F6G7H8J9K0", "object": "beneficiary", "label": "Ada, supplier", "bank": { "id": "000013", "code": null, "name": "Guaranty Trust Bank (GTBank)" }, "provider": null, "account_number": "0123456789", "account_name": "ADA LOVELACE", "created_at": "2026-11-17T12:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | ben_ id. | | object | string | Optional | Always beneficiary. | | label | string \| null | Optional | Your own name for it. | | bank | object | Optional | id, code and name. | | provider | string \| null | Optional | Provider, when saved with its own bank code. | | account_number | string | Optional | NUBAN. | | account_name | string | Optional | As the bank returned it when saved. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Save a beneficiary Checks the account by name enquiry and saves it, so you can send to it with `beneficiary` instead of bank details. Saving the same account again returns the saved one. Every transfer to it is still checked: one whose name has changed is refused. ## Endpoint POST https://api.veyqo.org/api/v1/beneficiaries Server secret key required. Scope: transfers:write. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/beneficiaries" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "bank": "000013", "account_number": "0123456789", "label": "Ada, supplier" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/beneficiaries`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "bank": "000013", "account_number": "0123456789", "label": "Ada, supplier" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "bank": "000013", "account_number": "0123456789", "label": "Ada, supplier" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/beneficiaries', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "bank": "000013", "account_number": "0123456789", "label": "Ada, supplier" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | bank | string \| null | Optional | Veyqo bank id from GET /transfers/banks. Required unless bank_code is given. Maximum 10 characters. | | bank_code | string \| null | Optional | A provider's own bank code instead of bank; needs provider when several are connected. Maximum 20 characters. | | account_number | string | Required | The 10-digit NUBAN. Maximum 10 characters. | | provider | string \| null | Optional | Which connected provider sends it. Omitted: the first that can reach the bank. | | label | string \| null | Optional | Your own name for it. Maximum 120 characters. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "ben_01M7Q5A1B2C3D4E5F6G7H8J9K0", "object": "beneficiary", "label": "Ada, supplier", "bank": { "id": "000013", "code": null, "name": "Guaranty Trust Bank (GTBank)" }, "provider": null, "account_number": "0123456789", "account_name": "ADA LOVELACE", "created_at": "2026-11-17T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | ben_ id. | | object | string | Optional | Always beneficiary. | | label | string \| null | Optional | Your own name for it. | | bank | object | Optional | id, code and name. | | provider | string \| null | Optional | Provider, when saved with its own bank code. | | account_number | string | Optional | NUBAN. | | account_name | string | Optional | As the bank returned it when saved. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Delete a beneficiary Removes a saved account. Transfers already sent to it are unaffected. ## Endpoint DELETE https://api.veyqo.org/api/v1/beneficiaries/{id} Server secret key required. Scope: transfers:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request DELETE "https://api.veyqo.org/api/v1/beneficiaries/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/beneficiaries/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'DELETE', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'DELETE', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('DELETE', f'https://api.veyqo.org/api/v1/beneficiaries/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "ben_01M7Q5A1B2C3D4E5F6G7H8J9K0", "deleted": true } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | The beneficiary's id. | | deleted | boolean | Optional | Always true. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List transfers Newest first, paginated. Filter by `status` (pending, successful, failed, awaiting_approval). ## Endpoint GET https://api.veyqo.org/api/v1/transfers Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | | status | query | No | pending, successful, failed or awaiting_approval. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/transfers" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/transfers`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/transfers', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "trf_01M7Q4A1B2C3D4E5F6G7H8J9K0", "object": "transfer", "reference": "PAYOUT-1001", "status": "successful", "amount": 500000, "currency": "NGN", "bank": { "id": "000013", "code": "058", "name": "Guaranty Trust Bank (GTBank)" }, "account_number": "0123456789", "account_name": "ADA LOVELACE", "narration": "Vendor payout", "provider": { "name": "paystack", "reference": "vt01m7q4a1b2c3d4e5f6g7h8j9k0", "transfer_id": "TRF_1ptvuv321ahaa7q" }, "failure_message": null, "approval": null, "metadata": { "vendor_id": "42" }, "completed_at": "2026-11-21T12:00:03+00:00", "created_at": "2026-11-21T12:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | trf_ id. | | object | string | Optional | Always transfer. | | reference | string \| null | Optional | Your own reference, unique in the environment. | | status | string | Optional | pending, successful, failed, or awaiting_approval (held at or above your approval limit until an owner or admin approves it in the dashboard). Values: pending, successful, failed, awaiting_approval. | | amount | integer | Optional | In kobo. | | currency | string | Optional | NGN. | | bank | object | Optional | id (Veyqo bank id, or null when sent by bank_code), code (the provider's own) and name. | | account_number | string | Optional | The 10-digit NUBAN. | | account_name | string \| null | Optional | As the bank returned it at name enquiry. | | narration | string \| null | Optional | What the beneficiary sees, where the bank shows it. | | provider | object | Optional | name, the reference Veyqo sent it (reference) and its own transfer id (transfer_id). | | failure_message | string \| null | Optional | Why it failed. | | approval | object \| null | Optional | Set when the transfer needed approval: required, and approved_at once approved. | | metadata | object | Optional | Your own key-values. | | completed_at | string \| null | Optional | When it succeeded or failed. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a transfer By its id (`trf_…`) or your reference. A pending transfer is checked with the provider first. ## Endpoint GET https://api.veyqo.org/api/v1/transfers/{id} Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/transfers/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/transfers/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/transfers/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "trf_01M7Q4A1B2C3D4E5F6G7H8J9K0", "object": "transfer", "reference": "PAYOUT-1001", "status": "successful", "amount": 500000, "currency": "NGN", "bank": { "id": "000013", "code": "058", "name": "Guaranty Trust Bank (GTBank)" }, "account_number": "0123456789", "account_name": "ADA LOVELACE", "narration": "Vendor payout", "provider": { "name": "paystack", "reference": "vt01m7q4a1b2c3d4e5f6g7h8j9k0", "transfer_id": "TRF_1ptvuv321ahaa7q" }, "failure_message": null, "approval": null, "metadata": { "vendor_id": "42" }, "completed_at": "2026-11-21T12:00:03+00:00", "created_at": "2026-11-21T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | trf_ id. | | object | string | Optional | Always transfer. | | reference | string \| null | Optional | Your own reference, unique in the environment. | | status | string | Optional | pending, successful, failed, or awaiting_approval (held at or above your approval limit until an owner or admin approves it in the dashboard). Values: pending, successful, failed, awaiting_approval. | | amount | integer | Optional | In kobo. | | currency | string | Optional | NGN. | | bank | object | Optional | id (Veyqo bank id, or null when sent by bank_code), code (the provider's own) and name. | | account_number | string | Optional | The 10-digit NUBAN. | | account_name | string \| null | Optional | As the bank returned it at name enquiry. | | narration | string \| null | Optional | What the beneficiary sees, where the bank shows it. | | provider | object | Optional | name, the reference Veyqo sent it (reference) and its own transfer id (transfer_id). | | failure_message | string \| null | Optional | Why it failed. | | approval | object \| null | Optional | Set when the transfer needed approval: required, and approved_at once approved. | | metadata | object | Optional | Your own key-values. | | completed_at | string \| null | Optional | When it succeeded or failed. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create a split recipient Checks the bank account by name enquiry, then opens it as a subaccount on a provider that splits payments (Paystack or Flutterwave). Name it in a payment's `split` with a flat `amount`; the provider pays that share to the account and the rest to you. ## Endpoint POST https://api.veyqo.org/api/v1/split-recipients Server secret key required. Scope: payments:write. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/split-recipients" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "name": "Ada Obi Stores", "bank": "090267", "account_number": "0123456789", "reference": "VENDOR-7" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/split-recipients`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "Ada Obi Stores", "bank": "090267", "account_number": "0123456789", "reference": "VENDOR-7" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "name": "Ada Obi Stores", "bank": "090267", "account_number": "0123456789", "reference": "VENDOR-7" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/split-recipients', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "name": "Ada Obi Stores", "bank": "090267", "account_number": "0123456789", "reference": "VENDOR-7" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | name | string | Required | Business or person name. Maximum 190 characters. | | bank | string \| null | Optional | Veyqo bank id from GET /transfers/banks. Required unless bank_code is given. Maximum 10 characters. | | bank_code | string \| null | Optional | A provider's own bank code instead of bank. Maximum 20 characters. | | account_number | string | Required | The 10-digit NUBAN. Maximum 10 characters. | | provider | string \| null | Optional | Which provider holds it. Omitted: the only one connected that splits. | | reference | string \| null | Optional | Your reference, e.g. your vendor id. Maximum 150 characters. | | email | string \| null | Optional | Contact email for the provider. | | phone | string \| null | Optional | Contact phone (Flutterwave asks for one). | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "spr_01M7Q5F1G2H3J4K5L6M7N8P9Q0", "object": "split_recipient", "name": "Ada Obi Stores", "reference": "VENDOR-7", "provider": "paystack", "bank": { "id": "090267", "name": "Kuda Bank" }, "account_number_last4": "6789", "account_name": "ADA OBI STORES", "created_at": "2026-11-17T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | spr_ id. | | object | string | Optional | Always split_recipient. | | name | string | Optional | Business or person name. | | reference | string \| null | Optional | Your reference for it. | | provider | string | Optional | Provider holding the subaccount; split payments go through it. | | bank | object | Optional | id and name. | | account_number_last4 | string | Optional | Last four digits of the account. | | account_name | string \| null | Optional | As the bank returned it. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | DUPLICATE_REFERENCE | 409 | Retrieve that payment and reconcile its state. For a genuinely new attempt, use a new unique reference and operation key; do not create a second charge just because a response was lost. | Reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List split recipients Every recipient in this environment, newest first and paginated. Only the last four digits of the account number are shown. ## Endpoint GET https://api.veyqo.org/api/v1/split-recipients Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/split-recipients" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/split-recipients`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/split-recipients', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "spr_01M7Q5F1G2H3J4K5L6M7N8P9Q0", "object": "split_recipient", "name": "Ada Obi Stores", "reference": "VENDOR-7", "provider": "paystack", "bank": { "id": "090267", "name": "Kuda Bank" }, "account_number_last4": "6789", "account_name": "ADA OBI STORES", "created_at": "2026-11-17T12:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | spr_ id. | | object | string | Optional | Always split_recipient. | | name | string | Optional | Business or person name. | | reference | string \| null | Optional | Your reference for it. | | provider | string | Optional | Provider holding the subaccount; split payments go through it. | | bank | object | Optional | id and name. | | account_number_last4 | string | Optional | Last four digits of the account. | | account_name | string \| null | Optional | As the bank returned it. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a split recipient One recipient by its id (`spr_…`) or your own reference, with its bank and provider. ## Endpoint GET https://api.veyqo.org/api/v1/split-recipients/{id} Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/split-recipients/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/split-recipients/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/split-recipients/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "spr_01M7Q5F1G2H3J4K5L6M7N8P9Q0", "object": "split_recipient", "name": "Ada Obi Stores", "reference": "VENDOR-7", "provider": "paystack", "bank": { "id": "090267", "name": "Kuda Bank" }, "account_number_last4": "6789", "account_name": "ADA OBI STORES", "created_at": "2026-11-17T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | spr_ id. | | object | string | Optional | Always split_recipient. | | name | string | Optional | Business or person name. | | reference | string \| null | Optional | Your reference for it. | | provider | string | Optional | Provider holding the subaccount; split payments go through it. | | bank | object | Optional | id and name. | | account_number_last4 | string | Optional | Last four digits of the account. | | account_name | string \| null | Optional | As the bank returned it. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create a cardholder Registers the person with Sudo on this environment's programme. The identity number goes to Sudo and is never stored by Veyqo. If Sudo does not answer, the cardholder stays pending: read it again rather than creating another. ## Endpoint POST https://api.veyqo.org/api/v1/cardholders Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/cardholders" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "first_name": "Ada", "last_name": "Obi", "email": "ada@example.com", "identity": { "type": "BVN", "number": "22222222222" }, "billing_address": { "line1": "1 Marina", "line2": null, "city": "Lagos", "state": "Lagos", "postal_code": "100001", "country": "NG" }, "reference": "USER-42" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cardholders`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "first_name": "Ada", "last_name": "Obi", "email": "ada@example.com", "identity": { "type": "BVN", "number": "22222222222" }, "billing_address": { "line1": "1 Marina", "line2": null, "city": "Lagos", "state": "Lagos", "postal_code": "100001", "country": "NG" }, "reference": "USER-42" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "first_name": "Ada", "last_name": "Obi", "email": "ada@example.com", "identity": { "type": "BVN", "number": "22222222222" }, "billing_address": { "line1": "1 Marina", "line2": null, "city": "Lagos", "state": "Lagos", "postal_code": "100001", "country": "NG" }, "reference": "USER-42" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/cardholders', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "first_name": "Ada", "last_name": "Obi", "email": "ada@example.com", "identity": { "type": "BVN", "number": "22222222222" }, "billing_address": { "line1": "1 Marina", "line2": None, "city": "Lagos", "state": "Lagos", "postal_code": "100001", "country": "NG" }, "reference": "USER-42" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | first_name | string | Required | Given name. Maximum 80 characters. | | last_name | string | Required | Family name. Maximum 80 characters. | | email | string \| null | Optional | See the JSON example. | | phone | string \| null | Optional | See the JSON example. | | date_of_birth | string \| null | Optional | YYYY-MM-DD. | | identity | object | Optional | type (BVN or NIN) and number (11 digits). Passed to Sudo and never stored by Veyqo. | | billing_address | object | Required | line1, line2, city, state, postal_code, country (2 letters). | | programme | string \| null | Optional | veyqo or imported, when both are set up. | | reference | string \| null | Optional | Your reference. Maximum 150 characters. | | metadata | object | Optional | Your own keys. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "ch_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "cardholder", "reference": "USER-42", "status": "active", "name": "Ada Obi", "email": "ada@example.com", "phone": "+2348000000000", "billing_address": { "line1": "1 Marina", "line2": null, "city": "Lagos", "state": "Lagos", "postal_code": "100001", "country": "NG" }, "metadata": { "user_id": "42" }, "created_at": "2026-11-27T10:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | ch_ id. | | object | string | Optional | Always cardholder. | | reference | string \| null | Optional | Your reference; usable in place of the id. | | status | string | Optional | pending, active, inactive or failed. | | name | string | Optional | Full name. | | email | string \| null | Optional | See the JSON example. | | phone | string \| null | Optional | See the JSON example. | | billing_address | object | Optional | line1, line2, city, state, postal_code, country. | | metadata | object | Optional | Your own keys. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. | | DUPLICATE_REFERENCE | 409 | Retrieve that payment and reconcile its state. For a genuinely new attempt, use a new unique reference and operation key; do not create a second charge just because a response was lost. | Reconcile first. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List cardholders Every cardholder in this environment, newest first and paginated. ## Endpoint GET https://api.veyqo.org/api/v1/cardholders Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/cardholders" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cardholders`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/cardholders', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "ch_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "cardholder", "reference": "USER-42", "status": "active", "name": "Ada Obi", "email": "ada@example.com", "phone": "+2348000000000", "billing_address": { "line1": "1 Marina", "line2": null, "city": "Lagos", "state": "Lagos", "postal_code": "100001", "country": "NG" }, "metadata": { "user_id": "42" }, "created_at": "2026-11-27T10:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | ch_ id. | | object | string | Optional | Always cardholder. | | reference | string \| null | Optional | Your reference; usable in place of the id. | | status | string | Optional | pending, active, inactive or failed. | | name | string | Optional | Full name. | | email | string \| null | Optional | See the JSON example. | | phone | string \| null | Optional | See the JSON example. | | billing_address | object | Optional | line1, line2, city, state, postal_code, country. | | metadata | object | Optional | Your own keys. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a cardholder One cardholder by its id (`ch_…`) or your own reference. ## Endpoint GET https://api.veyqo.org/api/v1/cardholders/{id} Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/cardholders/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cardholders/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/cardholders/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "ch_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "cardholder", "reference": "USER-42", "status": "active", "name": "Ada Obi", "email": "ada@example.com", "phone": "+2348000000000", "billing_address": { "line1": "1 Marina", "line2": null, "city": "Lagos", "state": "Lagos", "postal_code": "100001", "country": "NG" }, "metadata": { "user_id": "42" }, "created_at": "2026-11-27T10:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | ch_ id. | | object | string | Optional | Always cardholder. | | reference | string \| null | Optional | Your reference; usable in place of the id. | | status | string | Optional | pending, active, inactive or failed. | | name | string | Optional | Full name. | | email | string \| null | Optional | See the JSON example. | | phone | string \| null | Optional | See the JSON example. | | billing_address | object | Optional | line1, line2, city, state, postal_code, country. | | metadata | object | Optional | Your own keys. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Issue a card Issues a virtual card in a brand and currency the programme offers, with optional limits, channels and blocked categories. On the Veyqo programme the issuance fee comes off your card balance first. On an imported programme your authorization endpoint must be set. Refused with PLAN_LIMIT_REACHED at your account's card limit. If Sudo does not answer, the card stays pending and Veyqo confirms it within minutes: do not issue another. Sends `card.created`. ## Endpoint POST https://api.veyqo.org/api/v1/cards Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/cards" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "cardholder": "USER-42", "brand": "Verve", "currency": "NGN", "controls": { "limits": { "daily": 10000000 }, "channels": { "atm": false } }, "reference": "CARD-42" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cards`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "cardholder": "USER-42", "brand": "Verve", "currency": "NGN", "controls": { "limits": { "daily": 10000000 }, "channels": { "atm": false } }, "reference": "CARD-42" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "cardholder": "USER-42", "brand": "Verve", "currency": "NGN", "controls": { "limits": { "daily": 10000000 }, "channels": { "atm": false } }, "reference": "CARD-42" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/cards', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "cardholder": "USER-42", "brand": "Verve", "currency": "NGN", "controls": { "limits": { "daily": 10000000 }, "channels": { "atm": False } }, "reference": "CARD-42" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | cardholder | string | Required | ch_ id or your reference. | | brand | string | Required | A brand the programme offers. | | currency | string | Required | A currency the programme offers for that brand. | | controls | object | Optional | Optional limits, channels and blocked_categories. | | reference | string \| null | Optional | Your reference. Maximum 150 characters. | | metadata | object | Optional | See the JSON example. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card", "reference": "CARD-42", "cardholder": "ch_01M7Q5E1F2G3H4J5K6L7M8N9P0", "programme": "imported", "brand": "Verve", "currency": "NGN", "status": "active", "last4": "4321", "expiry_month": 8, "expiry_year": 2029, "controls": { "limits": { "per_authorization": 5000000, "daily": 10000000, "monthly": null }, "channels": { "pos": true, "web": true, "atm": false, "mobile": true }, "blocked_categories": [ "7995" ] }, "cancellation_reason": null, "canceled_at": null, "metadata": { "user_id": "42" }, "created_at": "2026-11-27T10:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | card_ id. | | object | string | Optional | Always card. | | reference | string \| null | Optional | See the JSON example. | | cardholder | string | Optional | ch_ id. | | programme | string | Optional | veyqo or imported. | | brand | string | Optional | Verve, MasterCard or Visa. | | currency | string | Optional | NGN or USD. | | status | string | Optional | pending, active, inactive (frozen), canceled or failed. | | last4 | string \| null | Optional | See the JSON example. | | expiry_month | integer \| null | Optional | See the JSON example. | | expiry_year | integer \| null | Optional | See the JSON example. | | controls | object | Optional | limits (per_authorization, daily, monthly in minor units), channels (pos, web, atm, mobile) and blocked_categories (MCCs). | | cancellation_reason | string \| null | Optional | See the JSON example. | | canceled_at | string \| null | Optional | ISO 8601. | | metadata | object | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. | | CARD_NOT_USABLE | 409 | Read the card's status. A cancelled card cannot be reused; issue a new one. | No. | | DUPLICATE_REFERENCE | 409 | Retrieve that payment and reconcile its state. For a genuinely new attempt, use a new unique reference and operation key; do not create a second charge just because a response was lost. | Reconcile first. | | INSUFFICIENT_CARD_BALANCE | 409 | Top up the card balance, then try again. | After topping up. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PLAN_LIMIT_REACHED | 402 | Review the active plan, project/usage allowances and billing status with the organization owner. | After resolving plan/billing restrictions. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List cards Newest first, paginated. Filter by `status` or `cardholder` (a `ch_` id). ## Endpoint GET https://api.veyqo.org/api/v1/cards Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/cards" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cards`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/cards', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card", "reference": "CARD-42", "cardholder": "ch_01M7Q5E1F2G3H4J5K6L7M8N9P0", "programme": "imported", "brand": "Verve", "currency": "NGN", "status": "active", "last4": "4321", "expiry_month": 8, "expiry_year": 2029, "controls": { "limits": { "per_authorization": 5000000, "daily": 10000000, "monthly": null }, "channels": { "pos": true, "web": true, "atm": false, "mobile": true }, "blocked_categories": [ "7995" ] }, "cancellation_reason": null, "canceled_at": null, "metadata": { "user_id": "42" }, "created_at": "2026-11-27T10:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | card_ id. | | object | string | Optional | Always card. | | reference | string \| null | Optional | See the JSON example. | | cardholder | string | Optional | ch_ id. | | programme | string | Optional | veyqo or imported. | | brand | string | Optional | Verve, MasterCard or Visa. | | currency | string | Optional | NGN or USD. | | status | string | Optional | pending, active, inactive (frozen), canceled or failed. | | last4 | string \| null | Optional | See the JSON example. | | expiry_month | integer \| null | Optional | See the JSON example. | | expiry_year | integer \| null | Optional | See the JSON example. | | controls | object | Optional | limits (per_authorization, daily, monthly in minor units), channels (pos, web, atm, mobile) and blocked_categories (MCCs). | | cancellation_reason | string \| null | Optional | See the JSON example. | | canceled_at | string \| null | Optional | ISO 8601. | | metadata | object | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a card One card by its id (`card_…`) or your reference: status, last four, expiry and controls. Never the number. ## Endpoint GET https://api.veyqo.org/api/v1/cards/{id} Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/cards/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cards/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/cards/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card", "reference": "CARD-42", "cardholder": "ch_01M7Q5E1F2G3H4J5K6L7M8N9P0", "programme": "imported", "brand": "Verve", "currency": "NGN", "status": "active", "last4": "4321", "expiry_month": 8, "expiry_year": 2029, "controls": { "limits": { "per_authorization": 5000000, "daily": 10000000, "monthly": null }, "channels": { "pos": true, "web": true, "atm": false, "mobile": true }, "blocked_categories": [ "7995" ] }, "cancellation_reason": null, "canceled_at": null, "metadata": { "user_id": "42" }, "created_at": "2026-11-27T10:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | card_ id. | | object | string | Optional | Always card. | | reference | string \| null | Optional | See the JSON example. | | cardholder | string | Optional | ch_ id. | | programme | string | Optional | veyqo or imported. | | brand | string | Optional | Verve, MasterCard or Visa. | | currency | string | Optional | NGN or USD. | | status | string | Optional | pending, active, inactive (frozen), canceled or failed. | | last4 | string \| null | Optional | See the JSON example. | | expiry_month | integer \| null | Optional | See the JSON example. | | expiry_year | integer \| null | Optional | See the JSON example. | | controls | object | Optional | limits (per_authorization, daily, monthly in minor units), channels (pos, web, atm, mobile) and blocked_categories (MCCs). | | cancellation_reason | string \| null | Optional | See the JSON example. | | canceled_at | string \| null | Optional | ISO 8601. | | metadata | object | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Freeze, unfreeze or change controls `status: inactive` freezes the card at once (Veyqo declines its payments even before Sudo confirms); `active` unfreezes it once Sudo confirms. New controls are sent to Sudo too, so Sudo enforces them as well. Sends `card.updated`. ## Endpoint PATCH https://api.veyqo.org/api/v1/cards/{id} Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request PATCH "https://api.veyqo.org/api/v1/cards/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "status": "inactive" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cards/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'PATCH', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "status": "inactive" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'PATCH', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "status": "inactive" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('PATCH', f'https://api.veyqo.org/api/v1/cards/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "status": "inactive" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | status | string \| null | Optional | active or inactive. Freezing applies at once; unfreezing waits for Sudo. | | controls | object | Optional | Limits, channels and blocked_categories to change; the rest stay. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card", "reference": "CARD-42", "cardholder": "ch_01M7Q5E1F2G3H4J5K6L7M8N9P0", "programme": "imported", "brand": "Verve", "currency": "NGN", "status": "active", "last4": "4321", "expiry_month": 8, "expiry_year": 2029, "controls": { "limits": { "per_authorization": 5000000, "daily": 10000000, "monthly": null }, "channels": { "pos": true, "web": true, "atm": false, "mobile": true }, "blocked_categories": [ "7995" ] }, "cancellation_reason": null, "canceled_at": null, "metadata": { "user_id": "42" }, "created_at": "2026-11-27T10:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | card_ id. | | object | string | Optional | Always card. | | reference | string \| null | Optional | See the JSON example. | | cardholder | string | Optional | ch_ id. | | programme | string | Optional | veyqo or imported. | | brand | string | Optional | Verve, MasterCard or Visa. | | currency | string | Optional | NGN or USD. | | status | string | Optional | pending, active, inactive (frozen), canceled or failed. | | last4 | string \| null | Optional | See the JSON example. | | expiry_month | integer \| null | Optional | See the JSON example. | | expiry_year | integer \| null | Optional | See the JSON example. | | controls | object | Optional | limits (per_authorization, daily, monthly in minor units), channels (pos, web, atm, mobile) and blocked_categories (MCCs). | | cancellation_reason | string \| null | Optional | See the JSON example. | | canceled_at | string \| null | Optional | ISO 8601. | | metadata | object | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | CARD_NOT_USABLE | 409 | Read the card's status. A cancelled card cannot be reused; issue a new one. | No. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Cancel a card Ends the card for good, as `lost` or `stolen`. It is frozen in Veyqo first, so it declines everything even while Sudo confirms. Sends `card.terminated`. ## Endpoint POST https://api.veyqo.org/api/v1/cards/{id}/cancel Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/cards/$PAYMENT_ID/cancel" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "reason": "lost" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cards/${encodeURIComponent(process.env.PAYMENT_ID)}/cancel`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "reason": "lost" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "reason": "lost" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/cards/{quote(os.environ["PAYMENT_ID"], safe="")}/cancel', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "reason": "lost" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | reason | string | Required | lost or stolen. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card", "reference": "CARD-42", "cardholder": "ch_01M7Q5E1F2G3H4J5K6L7M8N9P0", "programme": "imported", "brand": "Verve", "currency": "NGN", "status": "active", "last4": "4321", "expiry_month": 8, "expiry_year": 2029, "controls": { "limits": { "per_authorization": 5000000, "daily": 10000000, "monthly": null }, "channels": { "pos": true, "web": true, "atm": false, "mobile": true }, "blocked_categories": [ "7995" ] }, "cancellation_reason": null, "canceled_at": null, "metadata": { "user_id": "42" }, "created_at": "2026-11-27T10:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | card_ id. | | object | string | Optional | Always card. | | reference | string \| null | Optional | See the JSON example. | | cardholder | string | Optional | ch_ id. | | programme | string | Optional | veyqo or imported. | | brand | string | Optional | Verve, MasterCard or Visa. | | currency | string | Optional | NGN or USD. | | status | string | Optional | pending, active, inactive (frozen), canceled or failed. | | last4 | string \| null | Optional | See the JSON example. | | expiry_month | integer \| null | Optional | See the JSON example. | | expiry_year | integer \| null | Optional | See the JSON example. | | controls | object | Optional | limits (per_authorization, daily, monthly in minor units), channels (pos, web, atm, mobile) and blocked_categories (MCCs). | | cancellation_reason | string \| null | Optional | See the JSON example. | | canceled_at | string \| null | Optional | ISO 8601. | | metadata | object | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | CARD_NOT_USABLE | 409 | Read the card's status. A cancelled card cannot be reused; issue a new one. | No. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get a card display token A short-lived Sudo token and vault settings, for your app to show the card number and CVV with Sudo's secure display script. The numbers never pass through Veyqo or your servers. ## Endpoint POST https://api.veyqo.org/api/v1/cards/{id}/reveal-token Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/cards/$PAYMENT_ID/reveal-token" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cards/${encodeURIComponent(process.env.PAYMENT_ID)}/reveal-token`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/cards/{quote(os.environ["PAYMENT_ID"], safe="")}/reveal-token', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "object": "card_reveal_token", "card": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "token": "eyJhbGciOi…", "card_id": "6559f1a2c3d4e5f60718293a", "vault": { "id": "we0dsa28s", "url": "https://vault.sandbox.sudo.cards", "script_url": "https://js.securepro.xyz/sudo-show/1.1/ACiWvWF9tYAez4M498DHs.min.js" }, "expires_in": 300 } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | object | string | Optional | Always card_reveal_token. | | card | string | Optional | card_ id. | | token | string | Optional | Short-lived token for Sudo's vault. | | card_id | string | Optional | Sudo's id for the card, which the display script asks for. | | vault | object | Optional | id, url and script_url of the vault display. | | expires_in | integer | Optional | Seconds the token is good for. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | CARD_NOT_USABLE | 409 | Read the card's status. A cancelled card cannot be reused; issue a new one. | No. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List card authorizations Every real-time decision, newest first and paginated: amount, who decided (rules, balance, merchant or timeout), latency, and what became of it. Filter by `card` or `status`. ## Endpoint GET https://api.veyqo.org/api/v1/card-authorizations Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/card-authorizations" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-authorizations`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/card-authorizations', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "cauth_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_authorization", "card": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "status": "captured", "approved": true, "amount": 250000, "fee": 0, "currency": "NGN", "captured_amount": 250000, "decline_reason": null, "decided_by": "merchant", "latency_ms": 412, "merchant_reference": "hold_77", "merchant": { "name": "Shoprite Lekki", "category": "5411", "city": "Lagos", "country": "NG" }, "channel": "pos", "transaction_type": "purchase", "created_at": "2026-11-27T10:05:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | cauth_ id. | | object | string | Optional | Always card_authorization. | | card | string | Optional | card_ id. | | status | string | Optional | declined, approved, captured, partially_captured, reversed, expired or review. | | approved | boolean | Optional | See the JSON example. | | amount | integer | Optional | Minor units (kobo, cents). | | fee | integer | Optional | Veyqo programme fee held with it. Minor units (kobo, cents). | | currency | string | Optional | See the JSON example. | | captured_amount | integer | Optional | Minor units (kobo, cents). | | decline_reason | string \| null | Optional | e.g. insufficient_funds, limit_exceeded, card_inactive, merchant_unavailable. | | decided_by | string | Optional | rules, balance, merchant or timeout. | | latency_ms | integer | Optional | How long Veyqo took to answer Sudo. | | merchant_reference | string \| null | Optional | The hold reference your endpoint returned. | | merchant | object | Optional | name, category (MCC), city, country of the seller. | | channel | string \| null | Optional | See the JSON example. | | transaction_type | string \| null | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a card authorization One decision by its id (`cauth_…`), with its capture status and your hold reference. ## Endpoint GET https://api.veyqo.org/api/v1/card-authorizations/{id} Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/card-authorizations/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-authorizations/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/card-authorizations/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cauth_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_authorization", "card": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "status": "captured", "approved": true, "amount": 250000, "fee": 0, "currency": "NGN", "captured_amount": 250000, "decline_reason": null, "decided_by": "merchant", "latency_ms": 412, "merchant_reference": "hold_77", "merchant": { "name": "Shoprite Lekki", "category": "5411", "city": "Lagos", "country": "NG" }, "channel": "pos", "transaction_type": "purchase", "created_at": "2026-11-27T10:05:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | cauth_ id. | | object | string | Optional | Always card_authorization. | | card | string | Optional | card_ id. | | status | string | Optional | declined, approved, captured, partially_captured, reversed, expired or review. | | approved | boolean | Optional | See the JSON example. | | amount | integer | Optional | Minor units (kobo, cents). | | fee | integer | Optional | Veyqo programme fee held with it. Minor units (kobo, cents). | | currency | string | Optional | See the JSON example. | | captured_amount | integer | Optional | Minor units (kobo, cents). | | decline_reason | string \| null | Optional | e.g. insufficient_funds, limit_exceeded, card_inactive, merchant_unavailable. | | decided_by | string | Optional | rules, balance, merchant or timeout. | | latency_ms | integer | Optional | How long Veyqo took to answer Sudo. | | merchant_reference | string \| null | Optional | The hold reference your endpoint returned. | | merchant | object | Optional | name, category (MCC), city, country of the seller. | | channel | string \| null | Optional | See the JSON example. | | transaction_type | string \| null | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List card transactions Captures and refunds as Sudo confirmed them, newest first and paginated. Filter by `card`. ## Endpoint GET https://api.veyqo.org/api/v1/card-transactions Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/card-transactions" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-transactions`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/card-transactions', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "ctxn_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_transaction", "card": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "authorization": "cauth_01M7Q5E1F2G3H4J5K6L7M8N9P0", "type": "capture", "amount": 250000, "currency": "NGN", "merchant_name": "Shoprite Lekki", "created_at": "2026-11-27T12:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | ctxn_ id. | | object | string | Optional | Always card_transaction. | | card | string | Optional | card_ id. | | authorization | string \| null | Optional | cauth_ id it settles. | | type | string | Optional | capture or refund. | | amount | integer | Optional | Minor units (kobo, cents). | | currency | string | Optional | See the JSON example. | | merchant_name | string \| null | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a card transaction One capture or refund by its id (`ctxn_…`), with the authorization it settles. ## Endpoint GET https://api.veyqo.org/api/v1/card-transactions/{id} Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/card-transactions/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-transactions/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/card-transactions/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "ctxn_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_transaction", "card": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "authorization": "cauth_01M7Q5E1F2G3H4J5K6L7M8N9P0", "type": "capture", "amount": 250000, "currency": "NGN", "merchant_name": "Shoprite Lekki", "created_at": "2026-11-27T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | ctxn_ id. | | object | string | Optional | Always card_transaction. | | card | string | Optional | card_ id. | | authorization | string \| null | Optional | cauth_ id it settles. | | type | string | Optional | capture or refund. | | amount | integer | Optional | Minor units (kobo, cents). | | currency | string | Optional | See the JSON example. | | merchant_name | string \| null | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Simulate a card payment Sandbox only. Sudo sends this card a test payment, which comes back through Veyqo as a real authorization request, through your authorization endpoint, and produces the same records and events as a real one. ## Endpoint POST https://api.veyqo.org/api/v1/cards/{id}/simulate-authorization Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/cards/$PAYMENT_ID/simulate-authorization" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "amount": 250000, "channel": "pos" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/cards/${encodeURIComponent(process.env.PAYMENT_ID)}/simulate-authorization`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "amount": 250000, "channel": "pos" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "amount": 250000, "channel": "pos" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/cards/{quote(os.environ["PAYMENT_ID"], safe="")}/simulate-authorization', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "amount": 250000, "channel": "pos" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | amount | integer | Required | Minor units (kobo, cents). | | channel | string \| null | Optional | pos, web, atm or mobile. | | merchant_name | string \| null | Optional | See the JSON example. | | merchant_category | string \| null | Optional | Four-digit MCC. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "object": "card_simulation", "card": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "result": { "_id": "6559f1a2c3d4e5f60718293b", "approved": true } } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | object | string | Optional | Always card_simulation. | | card | string | Optional | card_ id, when simulating a payment. | | result | object | Optional | Sudo's response. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | ENVIRONMENT_MISMATCH | 403 | Use the correct sandbox/live key. Resources outside the key’s project remain not-found instead of disclosing ownership. | After selecting the correct key. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Simulate a reversal Sandbox only. Sudo reverses a simulated payment; the reversal event follows and releases what was held. ## Endpoint POST https://api.veyqo.org/api/v1/card-authorizations/{id}/simulate-reversal Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/card-authorizations/$PAYMENT_ID/simulate-reversal" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-authorizations/${encodeURIComponent(process.env.PAYMENT_ID)}/simulate-reversal`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/card-authorizations/{quote(os.environ["PAYMENT_ID"], safe="")}/simulate-reversal', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "object": "card_simulation", "card": "card_01M7Q5E1F2G3H4J5K6L7M8N9P0", "result": { "_id": "6559f1a2c3d4e5f60718293b", "approved": true } } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | object | string | Optional | Always card_simulation. | | card | string | Optional | card_ id, when simulating a payment. | | result | object | Optional | Sudo's response. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | ENVIRONMENT_MISMATCH | 403 | Use the correct sandbox/live key. Resources outside the key’s project remain not-found instead of disclosing ownership. | After selecting the correct key. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve the card balance Veyqo programme only. Each currency's balance (available, posted, held) and your fee schedule, with any change already announced. ## Endpoint GET https://api.veyqo.org/api/v1/card-balance Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/card-balance" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-balance`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/card-balance', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "object": "card_balance_summary", "balances": [ { "id": "cbal_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_balance", "currency": "NGN", "available": 4750000, "posted": 5000000, "held": 250000, "low_threshold": 1000000, "updated_at": "2026-11-27T10:05:00+00:00" } ], "fees": [ { "brand": "Verve", "currency": "NGN", "kind": "issuance", "fee": { "fixed": 5000, "percent_bps": 0, "minimum": null, "cap": null, "active": true, "description": "NGN 50.00" }, "upcoming": null } ] } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | object | string | Optional | Always card_balance_summary. | | balances | array | Optional | CardBalance objects. | | fees | array | Optional | Your fees per brand, currency and kind, with any upcoming change. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List card balance entries Every change to the balance, newest first and paginated: top-ups, holds, captures, releases, refunds, fees and withdrawals. Filter by `currency`. ## Endpoint GET https://api.veyqo.org/api/v1/card-balance/entries Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/card-balance/entries" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-balance/entries`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/card-balance/entries', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "cbe_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_balance_entry", "kind": "hold", "posted_change": 0, "held_change": 250000, "reference": "auth:cauth_01M7Q5E1F2G3H4J5K6L7M8N9P0", "description": null, "created_at": "2026-11-27T10:05:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | cbe_ id. | | object | string | Optional | Always card_balance_entry. | | kind | string | Optional | top_up, hold, capture, release, refund, fee, withdrawal or adjustment. | | posted_change | integer | Optional | Minor units (kobo, cents). | | held_change | integer | Optional | Minor units (kobo, cents). | | reference | string | Optional | Unique per balance. | | description | string \| null | Optional | See the JSON example. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Top up the card balance Live: returns a checkout to pay; the balance is credited only once that payment succeeds, and sends `card_balance.topped_up`. Sandbox: test money, credited at once. ## Endpoint POST https://api.veyqo.org/api/v1/card-balance/top-ups Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/card-balance/top-ups" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "currency": "NGN", "amount": 5000000, "email": "ops@example.com" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-balance/top-ups`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "currency": "NGN", "amount": 5000000, "email": "ops@example.com" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "currency": "NGN", "amount": 5000000, "email": "ops@example.com" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/card-balance/top-ups', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "currency": "NGN", "amount": 5000000, "email": "ops@example.com" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | currency | string | Required | NGN or USD. | | amount | integer | Required | Minor units (kobo, cents). | | email | string | Required | Who pays the checkout. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "object": "card_balance_top_up", "status": "awaiting_payment", "amount": 5000000, "currency": "NGN", "checkout_url": "https://api.veyqo.org/checkout/cs_01M7Q5E1F2G3H4J5K6L7M8N9P0", "entry": null } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | object | string | Optional | Always card_balance_top_up. | | status | string | Optional | awaiting_payment or credited. | | amount | integer | Optional | Minor units (kobo, cents). | | currency | string | Optional | See the JSON example. | | checkout_url | string \| null | Optional | See the JSON example. | | entry | string \| null | Optional | cbe_ id, once credited. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Set the low-balance alert Below this available amount, owners are emailed and `card_balance.low` is sent, once each time it dips. Null turns it off. ## Endpoint PUT https://api.veyqo.org/api/v1/card-balance/low-threshold Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request PUT "https://api.veyqo.org/api/v1/card-balance/low-threshold" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "currency": "NGN", "low_threshold": 1000000 }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-balance/low-threshold`, { method: 'PUT', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "currency": "NGN", "low_threshold": 1000000 }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'PUT', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "currency": "NGN", "low_threshold": 1000000 } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('PUT', f'https://api.veyqo.org/api/v1/card-balance/low-threshold', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "currency": "NGN", "low_threshold": 1000000 }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | currency | string | Required | See the JSON example. | | low_threshold | integer \| null | Required | Minor units (kobo, cents). Null turns the alert off. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cbal_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_balance", "currency": "NGN", "available": 4750000, "posted": 5000000, "held": 250000, "low_threshold": 1000000, "updated_at": "2026-11-27T10:05:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | cbal_ id. | | object | string | Optional | Always card_balance. | | currency | string | Optional | See the JSON example. | | available | integer | Optional | posted − held. Minor units (kobo, cents). | | posted | integer | Optional | Minor units (kobo, cents). | | held | integer | Optional | Reserved by approved payments not yet captured, and withdrawals. Minor units (kobo, cents). | | low_threshold | integer \| null | Optional | Below this, card_balance.low is sent. Minor units (kobo, cents). | | updated_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Withdraw from the card balance Sets the amount aside at once, so it cannot also be spent, and pays it to your bank account when Veyqo staff approve it. Rejected, it is released back. ## Endpoint POST https://api.veyqo.org/api/v1/card-balance/withdrawals Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/card-balance/withdrawals" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "currency": "NGN", "amount": 1000000, "bank_code": "058", "account_number": "0123456789", "account_name": "Ada Ltd" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-balance/withdrawals`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "currency": "NGN", "amount": 1000000, "bank_code": "058", "account_number": "0123456789", "account_name": "Ada Ltd" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "currency": "NGN", "amount": 1000000, "bank_code": "058", "account_number": "0123456789", "account_name": "Ada Ltd" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/card-balance/withdrawals', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "currency": "NGN", "amount": 1000000, "bank_code": "058", "account_number": "0123456789", "account_name": "Ada Ltd" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | currency | string | Required | See the JSON example. | | amount | integer | Required | Minor units (kobo, cents). | | bank_code | string | Required | See the JSON example. | | bank_name | string \| null | Optional | See the JSON example. | | account_number | string | Required | Ten digits. | | account_name | string | Required | See the JSON example. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cwd_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_balance_withdrawal", "status": "requested", "amount": 1000000, "currency": "NGN", "destination": { "bank_name": "GTBank", "account_name": "Ada Ltd", "account_number_last4": "6789" }, "payout_reference": null, "decided_at": null, "created_at": "2026-11-27T10:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | cwd_ id. | | object | string | Optional | Always card_balance_withdrawal. | | status | string | Optional | requested, paid or rejected. | | amount | integer | Optional | Minor units (kobo, cents). | | currency | string | Optional | See the JSON example. | | destination | object | Optional | bank_name, account_name and the last four digits. | | payout_reference | string \| null | Optional | See the JSON example. | | decided_at | string \| null | Optional | ISO 8601. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. | | INSUFFICIENT_CARD_BALANCE | 409 | Top up the card balance, then try again. | After topping up. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List withdrawals Your card balance withdrawals, newest first and paginated, with their status. ## Endpoint GET https://api.veyqo.org/api/v1/card-balance/withdrawals Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/card-balance/withdrawals" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-balance/withdrawals`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/card-balance/withdrawals', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "cwd_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_balance_withdrawal", "status": "requested", "amount": 1000000, "currency": "NGN", "destination": { "bank_name": "GTBank", "account_name": "Ada Ltd", "account_number_last4": "6789" }, "payout_reference": null, "decided_at": null, "created_at": "2026-11-27T10:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | cwd_ id. | | object | string | Optional | Always card_balance_withdrawal. | | status | string | Optional | requested, paid or rejected. | | amount | integer | Optional | Minor units (kobo, cents). | | currency | string | Optional | See the JSON example. | | destination | object | Optional | bank_name, account_name and the last four digits. | | payout_reference | string \| null | Optional | See the JSON example. | | decided_at | string \| null | Optional | ISO 8601. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List card programmes How this environment issues cards: its programmes, the brands and currencies each offers, and the health of its authorization endpoint. ## Endpoint GET https://api.veyqo.org/api/v1/card-programmes Server secret key required. Scope: cards:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/card-programmes" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-programmes`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/card-programmes', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "cprg_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_programme", "type": "imported", "status": "active", "offerings": [ { "brand": "Verve", "currency": "NGN" }, { "brand": "MasterCard", "currency": "USD" } ], "authorization_endpoint": { "url": "https://example.com/veyqo/card-authorize", "required": true, "recent_failures": 0, "last_failed_at": null }, "created_at": "2026-11-27T09:00:00+00:00" } ] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | cprg_ id. | | object | string | Optional | Always card_programme. | | type | string | Optional | veyqo or imported. | | status | string | Optional | active or disabled. | | offerings | array | Optional | The brand and currency pairs it issues. | | authorization_endpoint | object | Optional | url, required, recent_failures, last_failed_at. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Set the authorization endpoint `{id}` is the programme type, `veyqo` or `imported`. Where Veyqo asks before every payment on an imported programme (and on the Veyqo programme, if set): a signed `card.authorization.request`, answered within about 1.8 seconds with `{"approved": true|false}`. Hold the amount, do not just read a balance. The signing secret is returned the first time only. ## Endpoint PUT https://api.veyqo.org/api/v1/card-programmes/{id}/authorization-endpoint Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request PUT "https://api.veyqo.org/api/v1/card-programmes/$PAYMENT_ID/authorization-endpoint" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "url": "https://example.com/veyqo/card-authorize" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-programmes/${encodeURIComponent(process.env.PAYMENT_ID)}/authorization-endpoint`, { method: 'PUT', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "url": "https://example.com/veyqo/card-authorize" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'PUT', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "url": "https://example.com/veyqo/card-authorize" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('PUT', f'https://api.veyqo.org/api/v1/card-programmes/{quote(os.environ["PAYMENT_ID"], safe="")}/authorization-endpoint', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "url": "https://example.com/veyqo/card-authorize" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | url | string \| null | Required | Public https URL (http allowed in sandbox). Null removes it. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cprg_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "card_programme", "type": "imported", "status": "active", "offerings": [ { "brand": "Verve", "currency": "NGN" }, { "brand": "MasterCard", "currency": "USD" } ], "authorization_endpoint": { "url": "https://example.com/veyqo/card-authorize", "required": true, "recent_failures": 0, "last_failed_at": null }, "created_at": "2026-11-27T09:00:00+00:00", "signing_secret": "whsec_••••••••" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | signing_secret | string \| null | Optional | Shown once. Verify Veyqo-Signature with it. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Rotate the endpoint secret `{id}` is the programme type, `veyqo` or `imported`. A new signing secret for authorization requests, shown once. The old one stops verifying at once, so deploy the new one first. ## Endpoint POST https://api.veyqo.org/api/v1/card-programmes/{id}/authorization-endpoint/rotate-secret Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/card-programmes/$PAYMENT_ID/authorization-endpoint/rotate-secret" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-programmes/${encodeURIComponent(process.env.PAYMENT_ID)}/authorization-endpoint/rotate-secret`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/card-programmes/{quote(os.environ["PAYMENT_ID"], safe="")}/authorization-endpoint/rotate-secret', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "signing_secret": "whsec_••••••••" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | signing_secret | string | Optional | Shown once. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Test the authorization endpoint `{id}` is the programme type, `veyqo` or `imported`. Sends a signed sample request marked `"test": true`. Nothing is held or moved. Reports what came back, how fast, and why an answer would not count. ## Endpoint POST https://api.veyqo.org/api/v1/card-programmes/{id}/authorization-endpoint/test Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/card-programmes/$PAYMENT_ID/authorization-endpoint/test" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-programmes/${encodeURIComponent(process.env.PAYMENT_ID)}/authorization-endpoint/test`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/card-programmes/{quote(os.environ["PAYMENT_ID"], safe="")}/authorization-endpoint/test', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "object": "card_authorization_test", "ok": true, "approved": true, "reference": "hold_test", "http_status": 200, "latency_ms": 184, "within_budget": true, "budget_ms": 1800, "problem": null } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | object | string | Optional | Always card_authorization_test. | | ok | boolean | Optional | A usable answer came back. | | approved | boolean \| null | Optional | See the JSON example. | | reference | string \| null | Optional | See the JSON example. | | http_status | integer \| null | Optional | See the JSON example. | | latency_ms | integer | Optional | See the JSON example. | | within_budget | boolean | Optional | Answered within budget_ms. | | budget_ms | integer | Optional | See the JSON example. | | problem | string \| null | Optional | Why the answer was not usable. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Import existing Sudo cards Adopts the cardholders and cards already on your Sudo account. Only cards on the programme's funding source move; the rest are listed with the reason. Run with `dry_run: true` first. ## Endpoint POST https://api.veyqo.org/api/v1/card-programmes/imported/import Server secret key required. Scope: cards:write. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/card-programmes/imported/import" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "dry_run": true }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/card-programmes/imported/import`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "dry_run": true }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "dry_run": true } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/card-programmes/imported/import', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "dry_run": True }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | dry_run | boolean | Required | True reports only; false adopts. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "object": "card_import", "dry_run": true, "cardholders": { "adopted": 120, "existing": 0 }, "cards": { "adopted": 118, "existing": 0, "skipped": [ { "id": "6559f1a2c3d4e5f60718293c", "reason": "It is on another funding source. Point that funding source at Veyqo, then import again." } ] } } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | object | string | Optional | Always card_import. | | dry_run | boolean | Optional | See the JSON example. | | cardholders | object | Optional | adopted and existing counts. | | cards | object | Optional | adopted, existing, and skipped with a reason each. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | CARDS_NOT_ENABLED | 403 | Ask Veyqo to turn cards on, set up a programme, or name one with `programme`. | No. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create a virtual account Opens a permanent account number for one customer on a provider that issues them (Paystack, or Flutterwave with the customer's 11-digit `bvn`). Each deposit is confirmed with the provider, then recorded as a succeeded payment carrying `virtual_account_id` and your metadata, and sends `payment.succeeded`. A redelivered notice never counts twice. ## Endpoint POST https://api.veyqo.org/api/v1/virtual-accounts Server secret key required. Scope: payments:write. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/virtual-accounts" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "customer": { "email": "ada@example.com", "name": "Ada Obi" }, "reference": "CUST-42", "metadata": { "customer_id": "42" } }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/virtual-accounts`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "customer": { "email": "ada@example.com", "name": "Ada Obi" }, "reference": "CUST-42", "metadata": { "customer_id": "42" } }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "customer": { "email": "ada@example.com", "name": "Ada Obi" }, "reference": "CUST-42", "metadata": { "customer_id": "42" } } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/virtual-accounts', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "customer": { "email": "ada@example.com", "name": "Ada Obi" }, "reference": "CUST-42", "metadata": { "customer_id": "42" } }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | customer | object | Required | email (required), name, phone, and bvn (11 digits; Flutterwave needs it). | | provider | string \| null | Optional | Which connected provider issues it. Omitted: the first that can. | | reference | string \| null | Optional | Your reference, e.g. your customer id. Usable in place of the id. Maximum 150 characters. | | metadata | object | Optional | Your own keys, copied onto each deposit. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "va_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "virtual_account", "reference": "CUST-42", "status": "active", "account_number": "9930000001", "account_name": "VEYQO/ADA OBI", "bank_name": "Wema Bank", "provider": "paystack", "customer": { "email": "ada@example.com", "name": "Ada Obi" }, "metadata": { "customer_id": "42" }, "created_at": "2026-11-17T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | va_ id. | | object | string | Optional | Always virtual_account. | | reference | string \| null | Optional | Your reference for it. | | status | string | Optional | active. | | account_number | string | Optional | The NUBAN the customer pays into. | | account_name | string \| null | Optional | Name on the account. | | bank_name | string \| null | Optional | The bank that holds it. | | provider | string | Optional | Provider that issued it. | | customer | object | Optional | email and name. | | metadata | object | Optional | Your own keys, copied onto each deposit. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List virtual accounts Every account number opened in this environment, newest first and paginated, with the customer it belongs to. ## Endpoint GET https://api.veyqo.org/api/v1/virtual-accounts Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/virtual-accounts" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/virtual-accounts`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/virtual-accounts', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "va_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "virtual_account", "reference": "CUST-42", "status": "active", "account_number": "9930000001", "account_name": "VEYQO/ADA OBI", "bank_name": "Wema Bank", "provider": "paystack", "customer": { "email": "ada@example.com", "name": "Ada Obi" }, "metadata": { "customer_id": "42" }, "created_at": "2026-11-17T12:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | va_ id. | | object | string | Optional | Always virtual_account. | | reference | string \| null | Optional | Your reference for it. | | status | string | Optional | active. | | account_number | string | Optional | The NUBAN the customer pays into. | | account_name | string \| null | Optional | Name on the account. | | bank_name | string \| null | Optional | The bank that holds it. | | provider | string | Optional | Provider that issued it. | | customer | object | Optional | email and name. | | metadata | object | Optional | Your own keys, copied onto each deposit. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a virtual account One account by its id (`va_…`) or your own reference, with its number, bank and customer. ## Endpoint GET https://api.veyqo.org/api/v1/virtual-accounts/{id} Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/virtual-accounts/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/virtual-accounts/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/virtual-accounts/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "va_01M7Q5E1F2G3H4J5K6L7M8N9P0", "object": "virtual_account", "reference": "CUST-42", "status": "active", "account_number": "9930000001", "account_name": "VEYQO/ADA OBI", "bank_name": "Wema Bank", "provider": "paystack", "customer": { "email": "ada@example.com", "name": "Ada Obi" }, "metadata": { "customer_id": "42" }, "created_at": "2026-11-17T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | va_ id. | | object | string | Optional | Always virtual_account. | | reference | string \| null | Optional | Your reference for it. | | status | string | Optional | active. | | account_number | string | Optional | The NUBAN the customer pays into. | | account_name | string \| null | Optional | Name on the account. | | bank_name | string \| null | Optional | The bank that holds it. | | provider | string | Optional | Provider that issued it. | | customer | object | Optional | email and name. | | metadata | object | Optional | Your own keys, copied onto each deposit. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create a plan What your customers pay and how often: amount in the smallest currency unit, and an interval of day, week, month or year (with an optional count, e.g. every 3 months), and optional `trial_days` for a free trial. ## Endpoint POST https://api.veyqo.org/api/v1/plans Server secret key required. Scope: subscriptions:write. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/plans" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "name": "Pro monthly", "amount": 250000, "currency": "NGN", "interval": "month" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/plans`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "Pro monthly", "amount": 250000, "currency": "NGN", "interval": "month" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "name": "Pro monthly", "amount": 250000, "currency": "NGN", "interval": "month" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/plans', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "name": "Pro monthly", "amount": 250000, "currency": "NGN", "interval": "month" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | name | string | Required | Plan name. Maximum 120 characters. | | description | string \| null | Optional | Optional. Maximum 255 characters. | | amount | integer | Required | Per period, smallest currency unit. Minimum 1. | | currency | string | Required | Three-letter currency. Maximum 3 characters. | | interval | string | Required | day, week, month or year. Values: day, week, month, year. | | interval_count | integer \| null | Optional | 1 to 12. Defaults to 1. Minimum 1. | | trial_days | integer \| null | Optional | 0 to 365 days of free trial. Defaults to 0. Minimum 0. | | metadata | object \| null | Optional | Your own key-values. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "object": "plan", "name": "Pro monthly", "description": "Everything in Pro", "amount": 250000, "currency": "NGN", "interval": "month", "interval_count": 1, "trial_days": 0, "active": true, "metadata": [], "created_at": "2026-11-19T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | rplan_ id. | | object | string | Optional | Always plan. | | name | string | Optional | Shown on checkout. | | description | string \| null | Optional | Optional. | | amount | integer | Optional | Per period, in the smallest currency unit. | | currency | string | Optional | ISO 4217. | | interval | string | Optional | day, week, month or year. Values: day, week, month, year. | | interval_count | integer | Optional | Periods per charge, e.g. 3 with month for quarterly. | | trial_days | integer | Optional | Free trial for new subscriptions, in days (0 for none). | | active | boolean | Optional | False once archived. | | metadata | object | Optional | Your own key-values. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_CURRENCY | 422 | Use a supported currency/provider pair. Do not silently convert amounts or currencies. | After correcting the request. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List plans Newest first, paginated. Pass `active=true` to hide archived plans that no longer accept new subscriptions. ## Endpoint GET https://api.veyqo.org/api/v1/plans Server secret key required. Scope: subscriptions:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | | active | query | No | Only active (true) or archived (false) plans. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/plans" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/plans`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/plans', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "object": "plan", "name": "Pro monthly", "description": "Everything in Pro", "amount": 250000, "currency": "NGN", "interval": "month", "interval_count": 1, "trial_days": 0, "active": true, "metadata": [], "created_at": "2026-11-19T12:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | rplan_ id. | | object | string | Optional | Always plan. | | name | string | Optional | Shown on checkout. | | description | string \| null | Optional | Optional. | | amount | integer | Optional | Per period, in the smallest currency unit. | | currency | string | Optional | ISO 4217. | | interval | string | Optional | day, week, month or year. Values: day, week, month, year. | | interval_count | integer | Optional | Periods per charge, e.g. 3 with month for quarterly. | | trial_days | integer | Optional | Free trial for new subscriptions, in days (0 for none). | | active | boolean | Optional | False once archived. | | metadata | object | Optional | Your own key-values. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a plan One plan by its id (`rplan_…`), including its amount, currency and billing interval. ## Endpoint GET https://api.veyqo.org/api/v1/plans/{id} Server secret key required. Scope: subscriptions:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/plans/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/plans/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/plans/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "object": "plan", "name": "Pro monthly", "description": "Everything in Pro", "amount": 250000, "currency": "NGN", "interval": "month", "interval_count": 1, "trial_days": 0, "active": true, "metadata": [], "created_at": "2026-11-19T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | rplan_ id. | | object | string | Optional | Always plan. | | name | string | Optional | Shown on checkout. | | description | string \| null | Optional | Optional. | | amount | integer | Optional | Per period, in the smallest currency unit. | | currency | string | Optional | ISO 4217. | | interval | string | Optional | day, week, month or year. Values: day, week, month, year. | | interval_count | integer | Optional | Periods per charge, e.g. 3 with month for quarterly. | | trial_days | integer | Optional | Free trial for new subscriptions, in days (0 for none). | | active | boolean | Optional | False once archived. | | metadata | object | Optional | Your own key-values. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Update or archive a plan Change the name, description or `trial_days`, or set `active` to false to archive it. Existing subscriptions keep renewing at the price they started on. ## Endpoint PATCH https://api.veyqo.org/api/v1/plans/{id} Server secret key required. Scope: subscriptions:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request PATCH "https://api.veyqo.org/api/v1/plans/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "active": false }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/plans/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'PATCH', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "active": false }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'PATCH', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "active": false } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('PATCH', f'https://api.veyqo.org/api/v1/plans/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "active": False }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | name | string | Optional | Plan name. Maximum 120 characters. | | description | string \| null | Optional | Optional. Maximum 255 characters. | | active | boolean | Optional | False archives the plan. | | trial_days | integer | Optional | Free trial for new subscriptions, 0 to 365 days. Minimum 0. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "object": "plan", "name": "Pro monthly", "description": "Everything in Pro", "amount": 250000, "currency": "NGN", "interval": "month", "interval_count": 1, "trial_days": 0, "active": false, "metadata": [], "created_at": "2026-11-19T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | rplan_ id. | | object | string | Optional | Always plan. | | name | string | Optional | Shown on checkout. | | description | string \| null | Optional | Optional. | | amount | integer | Optional | Per period, in the smallest currency unit. | | currency | string | Optional | ISO 4217. | | interval | string | Optional | day, week, month or year. Values: day, week, month, year. | | interval_count | integer | Optional | Periods per charge, e.g. 3 with month for quarterly. | | trial_days | integer | Optional | Free trial for new subscriptions, in days (0 for none). | | active | boolean | Optional | False once archived. | | metadata | object | Optional | Your own key-values. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Start a subscription Creates an incomplete subscription and its first payment. Send the customer to `checkout_url`; when they pay, it becomes active, the card is kept for renewals and `subscription.activated` is sent. With a free trial (the plan's `trial_days`, or `trial_days` here) it starts as `trialing` with nothing to pay; when the trial ends, `subscription.payment_required` carries the first checkout link. Add `trial_requires_card: true` to take the card first: the customer pays a small check at `checkout_url` (refunded at once), the trial then starts, and the first period is charged to that card when it ends. ## Endpoint POST https://api.veyqo.org/api/v1/subscriptions Server secret key required. Scope: subscriptions:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/subscriptions" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "plan": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "reference": "SUB-1001", "metadata": { "customer_id": "42" } }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/subscriptions`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "plan": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "reference": "SUB-1001", "metadata": { "customer_id": "42" } }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "plan": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "reference": "SUB-1001", "metadata": { "customer_id": "42" } } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/subscriptions', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "plan": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "reference": "SUB-1001", "metadata": { "customer_id": "42" } }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | plan | string | Required | Plan id. | | customer | object | Required | email (required) and name. | | reference | string \| null | Optional | Your reference; unique in the environment. Maximum 150 characters. | | callback_url | string \| null | Optional | HTTPS return URL after the first payment. Format: uri. | | provider | string \| null | Optional | Provider slug; omitted, routed like a payment. | | trial_days | integer \| null | Optional | Overrides the plan's free trial for this customer; 0 for none. Minimum 0. | | trial_requires_card | boolean \| null | Optional | With a trial: take the card first with a small check that is refunded at once, and charge the first period to it when the trial ends. | | metadata | object \| null | Optional | Copied onto every payment of the subscription. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "csub_01M7Q3A1B2C3D4E5F6G7H8J9K0", "object": "subscription", "reference": "SUB-1001", "status": "incomplete", "plan": { "id": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "object": "plan", "name": "Pro monthly", "description": "Everything in Pro", "amount": 250000, "currency": "NGN", "interval": "month", "interval_count": 1, "trial_days": 0, "active": true, "metadata": [], "created_at": "2026-11-19T12:00:00+00:00" }, "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "card": null, "current_period_start": null, "current_period_end": null, "trial_ends_at": null, "pending_plan": null, "cancel_at_period_end": false, "cancelled_at": null, "failed_attempts": 0, "next_attempt_at": null, "payments_count": 0, "latest_payment_id": "pay_01M7Q3B2C3D4E5F6G7H8J9K0L1", "checkout_url": "https://checkout.paystack.com/example", "metadata": { "customer_id": "42" }, "created_at": "2026-11-19T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | csub_ id. | | object | string | Optional | Always subscription. | | reference | string \| null | Optional | Your own reference, unique in the environment. | | status | string | Optional | incomplete, trialing, active, past_due or cancelled. Values: incomplete, trialing, active, past_due, cancelled. | | plan | Plan | Optional | A plan your customers subscribe to. | | plan.id | string | Optional | rplan_ id. | | plan.object | string | Optional | Always plan. | | plan.name | string | Optional | Shown on checkout. | | plan.description | string \| null | Optional | Optional. | | plan.amount | integer | Optional | Per period, in the smallest currency unit. | | plan.currency | string | Optional | ISO 4217. | | plan.interval | string | Optional | day, week, month or year. Values: day, week, month, year. | | plan.interval_count | integer | Optional | Periods per charge, e.g. 3 with month for quarterly. | | plan.trial_days | integer | Optional | Free trial for new subscriptions, in days (0 for none). | | plan.active | boolean | Optional | False once archived. | | plan.metadata | object | Optional | Your own key-values. | | plan.created_at | string | Optional | ISO 8601. Format: date-time. | | customer | object | Optional | email and name. | | card | object \| null | Optional | brand and last4 of the saved card, if any. | | current_period_start | string \| null | Optional | Start of the paid period. | | current_period_end | string \| null | Optional | When the next charge is due. | | trial_ends_at | string \| null | Optional | When the free trial ends, if it had one. | | pending_plan | object \| null | Optional | The plan that takes over at the next renewal, if a change is scheduled. | | cancel_at_period_end | boolean | Optional | Ends instead of renewing. | | cancelled_at | string \| null | Optional | When it ended. | | failed_attempts | integer | Optional | Failed renewal tries this period (ends after 3). | | next_attempt_at | string \| null | Optional | Next charge or retry. | | payments_count | integer | Optional | Periods paid. | | latest_payment_id | string \| null | Optional | The most recent payment. | | checkout_url | string \| null | Optional | Where the customer pays, when something is due from them. | | metadata | object | Optional | Your own key-values. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | DUPLICATE_REFERENCE | 409 | Retrieve that payment and reconcile its state. For a genuinely new attempt, use a new unique reference and operation key; do not create a second charge just because a response was lost. | Reconcile first. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List subscriptions Newest first, paginated. Filter by `status` (incomplete, trialing, active, past_due, cancelled), `plan` or `customer_email`. ## Endpoint GET https://api.veyqo.org/api/v1/subscriptions Server secret key required. Scope: subscriptions:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | | status | query | No | incomplete, trialing, active, past_due or cancelled. | | plan | query | No | Plan id (rplan_…). | | customer_email | query | No | Exact customer email. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/subscriptions" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/subscriptions`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/subscriptions', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "csub_01M7Q3A1B2C3D4E5F6G7H8J9K0", "object": "subscription", "reference": "SUB-1001", "status": "active", "plan": { "id": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "object": "plan", "name": "Pro monthly", "description": "Everything in Pro", "amount": 250000, "currency": "NGN", "interval": "month", "interval_count": 1, "trial_days": 0, "active": true, "metadata": [], "created_at": "2026-11-19T12:00:00+00:00" }, "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "card": { "brand": "Visa", "last4": "4081" }, "current_period_start": "2026-11-19T12:00:00+00:00", "current_period_end": "2026-12-19T12:00:00+00:00", "trial_ends_at": null, "pending_plan": null, "cancel_at_period_end": false, "cancelled_at": null, "failed_attempts": 0, "next_attempt_at": "2026-12-19T12:00:00+00:00", "payments_count": 1, "latest_payment_id": "pay_01M7Q3B2C3D4E5F6G7H8J9K0L1", "checkout_url": null, "metadata": { "customer_id": "42" }, "created_at": "2026-11-19T12:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | csub_ id. | | object | string | Optional | Always subscription. | | reference | string \| null | Optional | Your own reference, unique in the environment. | | status | string | Optional | incomplete, trialing, active, past_due or cancelled. Values: incomplete, trialing, active, past_due, cancelled. | | plan | Plan | Optional | A plan your customers subscribe to. | | plan.id | string | Optional | rplan_ id. | | plan.object | string | Optional | Always plan. | | plan.name | string | Optional | Shown on checkout. | | plan.description | string \| null | Optional | Optional. | | plan.amount | integer | Optional | Per period, in the smallest currency unit. | | plan.currency | string | Optional | ISO 4217. | | plan.interval | string | Optional | day, week, month or year. Values: day, week, month, year. | | plan.interval_count | integer | Optional | Periods per charge, e.g. 3 with month for quarterly. | | plan.trial_days | integer | Optional | Free trial for new subscriptions, in days (0 for none). | | plan.active | boolean | Optional | False once archived. | | plan.metadata | object | Optional | Your own key-values. | | plan.created_at | string | Optional | ISO 8601. Format: date-time. | | customer | object | Optional | email and name. | | card | object \| null | Optional | brand and last4 of the saved card, if any. | | current_period_start | string \| null | Optional | Start of the paid period. | | current_period_end | string \| null | Optional | When the next charge is due. | | trial_ends_at | string \| null | Optional | When the free trial ends, if it had one. | | pending_plan | object \| null | Optional | The plan that takes over at the next renewal, if a change is scheduled. | | cancel_at_period_end | boolean | Optional | Ends instead of renewing. | | cancelled_at | string \| null | Optional | When it ended. | | failed_attempts | integer | Optional | Failed renewal tries this period (ends after 3). | | next_attempt_at | string \| null | Optional | Next charge or retry. | | payments_count | integer | Optional | Periods paid. | | latest_payment_id | string \| null | Optional | The most recent payment. | | checkout_url | string \| null | Optional | Where the customer pays, when something is due from them. | | metadata | object | Optional | Your own key-values. | | created_at | string | Optional | ISO 8601. Format: date-time. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a subscription By its id (`csub_…`) or your own reference: status, current period, saved card (brand and last four only) and the latest payment. ## Endpoint GET https://api.veyqo.org/api/v1/subscriptions/{id} Server secret key required. Scope: subscriptions:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/subscriptions/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/subscriptions/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/subscriptions/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "csub_01M7Q3A1B2C3D4E5F6G7H8J9K0", "object": "subscription", "reference": "SUB-1001", "status": "active", "plan": { "id": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "object": "plan", "name": "Pro monthly", "description": "Everything in Pro", "amount": 250000, "currency": "NGN", "interval": "month", "interval_count": 1, "trial_days": 0, "active": true, "metadata": [], "created_at": "2026-11-19T12:00:00+00:00" }, "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "card": { "brand": "Visa", "last4": "4081" }, "current_period_start": "2026-11-19T12:00:00+00:00", "current_period_end": "2026-12-19T12:00:00+00:00", "trial_ends_at": null, "pending_plan": null, "cancel_at_period_end": false, "cancelled_at": null, "failed_attempts": 0, "next_attempt_at": "2026-12-19T12:00:00+00:00", "payments_count": 1, "latest_payment_id": "pay_01M7Q3B2C3D4E5F6G7H8J9K0L1", "checkout_url": null, "metadata": { "customer_id": "42" }, "created_at": "2026-11-19T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | csub_ id. | | object | string | Optional | Always subscription. | | reference | string \| null | Optional | Your own reference, unique in the environment. | | status | string | Optional | incomplete, trialing, active, past_due or cancelled. Values: incomplete, trialing, active, past_due, cancelled. | | plan | Plan | Optional | A plan your customers subscribe to. | | plan.id | string | Optional | rplan_ id. | | plan.object | string | Optional | Always plan. | | plan.name | string | Optional | Shown on checkout. | | plan.description | string \| null | Optional | Optional. | | plan.amount | integer | Optional | Per period, in the smallest currency unit. | | plan.currency | string | Optional | ISO 4217. | | plan.interval | string | Optional | day, week, month or year. Values: day, week, month, year. | | plan.interval_count | integer | Optional | Periods per charge, e.g. 3 with month for quarterly. | | plan.trial_days | integer | Optional | Free trial for new subscriptions, in days (0 for none). | | plan.active | boolean | Optional | False once archived. | | plan.metadata | object | Optional | Your own key-values. | | plan.created_at | string | Optional | ISO 8601. Format: date-time. | | customer | object | Optional | email and name. | | card | object \| null | Optional | brand and last4 of the saved card, if any. | | current_period_start | string \| null | Optional | Start of the paid period. | | current_period_end | string \| null | Optional | When the next charge is due. | | trial_ends_at | string \| null | Optional | When the free trial ends, if it had one. | | pending_plan | object \| null | Optional | The plan that takes over at the next renewal, if a change is scheduled. | | cancel_at_period_end | boolean | Optional | Ends instead of renewing. | | cancelled_at | string \| null | Optional | When it ended. | | failed_attempts | integer | Optional | Failed renewal tries this period (ends after 3). | | next_attempt_at | string \| null | Optional | Next charge or retry. | | payments_count | integer | Optional | Periods paid. | | latest_payment_id | string \| null | Optional | The most recent payment. | | checkout_url | string \| null | Optional | Where the customer pays, when something is due from them. | | metadata | object | Optional | Your own key-values. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Cancel a subscription Stops renewals at the end of the paid period by default; pass `at_period_end: false` to end it now. Nothing is refunded and the saved card is forgotten. ## Endpoint POST https://api.veyqo.org/api/v1/subscriptions/{id}/cancel Server secret key required. Scope: subscriptions:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/subscriptions/$PAYMENT_ID/cancel" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "at_period_end": true }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/subscriptions/${encodeURIComponent(process.env.PAYMENT_ID)}/cancel`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "at_period_end": true }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "at_period_end": true } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/subscriptions/{quote(os.environ["PAYMENT_ID"], safe="")}/cancel', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "at_period_end": True }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | at_period_end | boolean | Optional | Default true: stop renewing at period end. false ends it now. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "csub_01M7Q3A1B2C3D4E5F6G7H8J9K0", "object": "subscription", "reference": "SUB-1001", "status": "active", "plan": { "id": "rplan_01M7Q2Z8X4K3V9B6N5C1D0E2F3", "object": "plan", "name": "Pro monthly", "description": "Everything in Pro", "amount": 250000, "currency": "NGN", "interval": "month", "interval_count": 1, "trial_days": 0, "active": true, "metadata": [], "created_at": "2026-11-19T12:00:00+00:00" }, "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "card": { "brand": "Visa", "last4": "4081" }, "current_period_start": "2026-11-19T12:00:00+00:00", "current_period_end": "2026-12-19T12:00:00+00:00", "trial_ends_at": null, "pending_plan": null, "cancel_at_period_end": true, "cancelled_at": null, "failed_attempts": 0, "next_attempt_at": "2026-12-19T12:00:00+00:00", "payments_count": 1, "latest_payment_id": "pay_01M7Q3B2C3D4E5F6G7H8J9K0L1", "checkout_url": null, "metadata": { "customer_id": "42" }, "created_at": "2026-11-19T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | csub_ id. | | object | string | Optional | Always subscription. | | reference | string \| null | Optional | Your own reference, unique in the environment. | | status | string | Optional | incomplete, trialing, active, past_due or cancelled. Values: incomplete, trialing, active, past_due, cancelled. | | plan | Plan | Optional | A plan your customers subscribe to. | | plan.id | string | Optional | rplan_ id. | | plan.object | string | Optional | Always plan. | | plan.name | string | Optional | Shown on checkout. | | plan.description | string \| null | Optional | Optional. | | plan.amount | integer | Optional | Per period, in the smallest currency unit. | | plan.currency | string | Optional | ISO 4217. | | plan.interval | string | Optional | day, week, month or year. Values: day, week, month, year. | | plan.interval_count | integer | Optional | Periods per charge, e.g. 3 with month for quarterly. | | plan.trial_days | integer | Optional | Free trial for new subscriptions, in days (0 for none). | | plan.active | boolean | Optional | False once archived. | | plan.metadata | object | Optional | Your own key-values. | | plan.created_at | string | Optional | ISO 8601. Format: date-time. | | customer | object | Optional | email and name. | | card | object \| null | Optional | brand and last4 of the saved card, if any. | | current_period_start | string \| null | Optional | Start of the paid period. | | current_period_end | string \| null | Optional | When the next charge is due. | | trial_ends_at | string \| null | Optional | When the free trial ends, if it had one. | | pending_plan | object \| null | Optional | The plan that takes over at the next renewal, if a change is scheduled. | | cancel_at_period_end | boolean | Optional | Ends instead of renewing. | | cancelled_at | string \| null | Optional | When it ended. | | failed_attempts | integer | Optional | Failed renewal tries this period (ends after 3). | | next_attempt_at | string \| null | Optional | Next charge or retry. | | payments_count | integer | Optional | Periods paid. | | latest_payment_id | string \| null | Optional | The most recent payment. | | checkout_url | string \| null | Optional | Where the customer pays, when something is due from them. | | metadata | object | Optional | Your own key-values. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Change a subscription's plan Moves the customer to another plan in the same currency. By default the new plan starts at the next renewal and nothing is charged now (`pending_plan` shows it). With `at_period_end: false` the customer pays the new plan's price less what is left of the current period, on the saved card or at `checkout_url`, and a new period starts once paid (`subscription.plan_changed`). In a trial the plan changes straight away. ## Endpoint POST https://api.veyqo.org/api/v1/subscriptions/{id}/plan Server secret key required. Scope: subscriptions:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/subscriptions/$PAYMENT_ID/plan" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "plan": "rplan_01M7Q2Z9Y5L4W0C7P6D2E1G3H4", "at_period_end": false }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/subscriptions/${encodeURIComponent(process.env.PAYMENT_ID)}/plan`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "plan": "rplan_01M7Q2Z9Y5L4W0C7P6D2E1G3H4", "at_period_end": false }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "plan": "rplan_01M7Q2Z9Y5L4W0C7P6D2E1G3H4", "at_period_end": false } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/subscriptions/{quote(os.environ["PAYMENT_ID"], safe="")}/plan', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "plan": "rplan_01M7Q2Z9Y5L4W0C7P6D2E1G3H4", "at_period_end": False }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | plan | string | Required | The new plan's id, in the same currency. | | at_period_end | boolean | Optional | Default true: switch at the next renewal. false: charge the prorated difference now. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "csub_01M7Q3A1B2C3D4E5F6G7H8J9K0", "object": "subscription", "reference": "SUB-1001", "status": "active", "plan": { "id": "rplan_01M7Q2Z9Y5L4W0C7P6D2E1G3H4", "object": "plan", "name": "Business monthly", "description": "Everything in Business", "amount": 500000, "currency": "NGN", "interval": "month", "interval_count": 1, "trial_days": 0, "active": true, "metadata": [], "created_at": "2026-11-19T12:00:00+00:00" }, "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "card": { "brand": "Visa", "last4": "4081" }, "current_period_start": "2026-11-19T12:00:00+00:00", "current_period_end": "2026-12-19T12:00:00+00:00", "trial_ends_at": null, "pending_plan": null, "cancel_at_period_end": false, "cancelled_at": null, "failed_attempts": 0, "next_attempt_at": "2026-12-19T12:00:00+00:00", "payments_count": 2, "latest_payment_id": "pay_01M7Q3B2C3D4E5F6G7H8J9K0L1", "checkout_url": null, "metadata": { "customer_id": "42" }, "created_at": "2026-11-19T12:00:00+00:00", "plan_change": { "amount_due": 375000, "payment_id": "pay_01M7Q3C3D4E5F6G7H8J9K0L1M2", "payment_status": "succeeded" } } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Optional | csub_ id. | | object | string | Optional | Always subscription. | | reference | string \| null | Optional | Your own reference, unique in the environment. | | status | string | Optional | incomplete, trialing, active, past_due or cancelled. Values: incomplete, trialing, active, past_due, cancelled. | | plan | Plan | Optional | A plan your customers subscribe to. | | plan.id | string | Optional | rplan_ id. | | plan.object | string | Optional | Always plan. | | plan.name | string | Optional | Shown on checkout. | | plan.description | string \| null | Optional | Optional. | | plan.amount | integer | Optional | Per period, in the smallest currency unit. | | plan.currency | string | Optional | ISO 4217. | | plan.interval | string | Optional | day, week, month or year. Values: day, week, month, year. | | plan.interval_count | integer | Optional | Periods per charge, e.g. 3 with month for quarterly. | | plan.trial_days | integer | Optional | Free trial for new subscriptions, in days (0 for none). | | plan.active | boolean | Optional | False once archived. | | plan.metadata | object | Optional | Your own key-values. | | plan.created_at | string | Optional | ISO 8601. Format: date-time. | | customer | object | Optional | email and name. | | card | object \| null | Optional | brand and last4 of the saved card, if any. | | current_period_start | string \| null | Optional | Start of the paid period. | | current_period_end | string \| null | Optional | When the next charge is due. | | trial_ends_at | string \| null | Optional | When the free trial ends, if it had one. | | pending_plan | object \| null | Optional | The plan that takes over at the next renewal, if a change is scheduled. | | cancel_at_period_end | boolean | Optional | Ends instead of renewing. | | cancelled_at | string \| null | Optional | When it ended. | | failed_attempts | integer | Optional | Failed renewal tries this period (ends after 3). | | next_attempt_at | string \| null | Optional | Next charge or retry. | | payments_count | integer | Optional | Periods paid. | | latest_payment_id | string \| null | Optional | The most recent payment. | | checkout_url | string \| null | Optional | Where the customer pays, when something is due from them. | | metadata | object | Optional | Your own key-values. | | created_at | string | Optional | ISO 8601. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create a payment Starts a payment with the provider connected in this environment and returns a checkout URL. The amount is an integer in the smallest currency unit. Optionally itemise it with `line_items` (they must add up to `amount`), give a `shipping` address, and set `tax.automatic` to have a provider that supports it (Stripe) add sales tax, VAT or GST at checkout: once paid, `amount` is the total charged, with `amount_subtotal` and `amount_tax` apart. A paid payment carries the provider's fraud assessment in `risk` where it gives one. ## Endpoint POST https://api.veyqo.org/api/v1/payments Server secret key required. Scope: payments:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/payments" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "metadata": { "order_id": "1001" } }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/payments`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "metadata": { "order_id": "1001" } }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "metadata": { "order_id": "1001" } } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/payments', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "metadata": { "order_id": "1001" } }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | amount | integer | Required | Integer minor-unit amount. NGN 500.00 is 50000; JPY 500 is 500. Minimum 1. | | currency | string | Required | Three-letter currency supported by the selected provider. Maximum 3 characters. | | reference | string \| null | Optional | Unique within this environment. Omitted, defaults to the new payment ID. Maximum 190 characters. | | description | string \| null | Optional | Payment description. Maximum 255 characters. | | callback_url | string \| null | Optional | HTTPS return URL. Verify payment server-side after the redirect. Maximum 2048 characters. Format: uri. | | provider | string \| null | Optional | Provider slug, or "auto" to let this environment's published routing policy choose (docs/ROUTING.md). Omitted: routed when the environment has automatic routing on; otherwise the project default, or the only active provider. Maximum 40 characters. | | payment_method | string \| null | Optional | Optional hint read only by routing rules. The customer still chooses on the checkout page. Values: card, bank_transfer, ussd, mobile_money. | | customer | object | Optional | See the JSON example. | | customer.email | string | Required | Required for nested customer requests. Maximum 190 characters. Format: email. | | customer.name | string \| null | Optional | Maximum 190 characters. | | customer.phone | string \| null | Optional | Maximum 32 characters. | | customer.country | string \| null | Optional | ISO 3166-1 alpha-2 country. Read by routing rules and stored on the payment. | | customer_email | string | Optional | Legacy flat alternative to customer.email. Maximum 190 characters. Format: email. | | customer_name | string \| null | Optional | Legacy flat name. Maximum 190 characters. | | customer_phone | string \| null | Optional | Legacy flat phone. Maximum 32 characters. | | customer_country | string \| null | Optional | Legacy flat alternative to customer.country. | | metadata | object \| array \| null | Optional | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. | | line_items | array \| null | Optional | What is being bought: name, quantity (default 1), unit_amount in the smallest unit, optional description. Must add up to amount. Shown on the checkout page where the provider supports it. | | shipping | object \| null | Optional | name, phone, address, and optionally amount (what delivery costs, in the smallest unit, charged and taxed as shipping) and label. Line items plus shipping.amount must equal amount. Required with tax.automatic, which works tax out from the address. | | tax | object \| null | Optional | { automatic: true } has a provider that supports it add tax at checkout. Refused when no provider in the route can. | | split | array \| null | Optional | Flat shares paid to split recipients: [{recipient: spr_…, amount}], in minor units, together less than amount. The payment goes through the recipients' provider. | > Supply customer.email in a nested customer object, or use the legacy customer_email field. When a customer object is present, its email is required. The API validates the form you actually sent. ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "pay_01M6EB66SC61Q3RQYAN0693DGM", "object": "payment", "reference": "ORDER-1001", "status": "pending", "amount": 50000, "amount_subtotal": null, "amount_tax": null, "amount_refunded": 0, "currency": "NGN", "line_items": null, "shipping": null, "tax": { "automatic": false }, "risk": null, "customer": { "email": "customer@example.com", "name": "Ada Lovelace", "phone": null }, "description": "Order 1001", "checkout_url": "https://checkout.paystack.com/example", "provider": "paystack", "provider_reference": "provider_reference_example", "metadata": { "order_id": "1001" }, "failure_code": null, "failure_message": null, "authorized_at": null, "succeeded_at": null, "failed_at": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Globally unique Veyqo payment ID; use it for reconciliation. | | object | "payment" | Required | See the JSON example. | | reference | string | Required | Merchant reference unique within the project environment; defaults to the payment ID. | | status | string | Required | Normalized payment state. Do not fulfil pending, processing, failed or cancelled payments. Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | amount | integer | Required | Original amount in the smallest currency unit. | | amount_subtotal | integer \| null | Optional | With automatic tax: the amount before tax. | | amount_tax | integer \| null | Optional | With automatic tax: the tax added at checkout, once paid. amount is then the total. | | amount_refunded | integer | Required | Successfully refunded amount in the smallest currency unit. | | currency | string | Required | Three-letter currency code. | | line_items | array \| null | Optional | As sent. | | shipping | object \| null | Optional | As sent. | | tax | object | Optional | { automatic: boolean }. | | risk | object \| null | Optional | The provider's fraud assessment when it gives one: level, score, review (true when it advises a manual review) and card_country. | | customer | object | Required | See the JSON example. | | customer.email | string | Required | Customer email address. | | customer.name | string \| null | Required | Customer name. | | customer.phone | string \| null | Required | Customer phone. | | description | string \| null | Required | Optional description. | | checkout_url | string \| null | Required | Provider checkout URL for direct payments; may be null depending on the flow. Format: uri. | | provider | string | Required | Selected provider slug. | | provider_reference | string \| null | Required | Reference the provider assigned, not your order reference. | | routing | object \| null | Required | How Veyqo routing chose the provider. Null when the request named a provider (or the environment is in shadow mode). | | routing.mode | string | Optional | Always "automatic". | | routing.decision_id | string | Optional | Routing decision ID (rtd_…); the full explanation is in the dashboard. | | routing.policy | string \| null | Optional | Policy name. | | routing.version | integer \| null | Optional | Published policy version that decided. | | routing.rule | string \| null | Optional | Rule that matched; null when the policy fallback applied. | | routing.fallbacks | array | Optional | Providers that would be tried next, in order. | | routing.failover | boolean | Optional | True when an earlier provider failed and a fallback took the payment. | | routing.attempts | integer | Optional | Providers tried for this payment. | | metadata | object \| array | Required | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. | | failure_code | string \| null | Required | Machine-readable payment failure reason, separate from API error codes. | | failure_message | string \| null | Required | Human-readable payment failure reason. | | authorized_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | succeeded_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | failed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | split | array \| null | Optional | Flat shares paid to split recipients: [{recipient: spr_…, amount}], in minor units, together less than amount. The payment goes through the recipients' provider. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | DUPLICATE_REFERENCE | 409 | Retrieve that payment and reconcile its state. For a genuinely new attempt, use a new unique reference and operation key; do not create a second charge just because a response was lost. | Reconcile first. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | INVALID_PROVIDER | 422 | Choose a supported connected provider. Refund/direct-checkout capabilities can differ from simple payment creation. | After configuration or provider selection changes. | | INVALID_CURRENCY | 422 | Use a supported currency/provider pair. Do not silently convert amounts or currencies. | After correcting the request. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PLAN_LIMIT_REACHED | 402 | Review the active plan, project/usage allowances and billing status with the organization owner. | After resolving plan/billing restrictions. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List payments List payments in this project environment, newest first. Only status, reference, created_after, created_before and pagination filters are implemented. ## Endpoint GET https://api.veyqo.org/api/v1/payments Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | | status | query | No | Normalized payment status. | | reference | query | No | Exact merchant reference. | | created_after | query | No | Inclusive creation-time lower bound. Use an ISO 8601 date/time. | | created_before | query | No | Inclusive creation-time upper bound. Use an ISO 8601 date/time. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/payments?per_page=5" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/payments?per_page=5`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/payments?per_page=5', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "pay_01M6EB66SC61Q3RQYAN0693DGM", "object": "payment", "reference": "ORDER-1001", "status": "pending", "amount": 50000, "amount_subtotal": null, "amount_tax": null, "amount_refunded": 0, "currency": "NGN", "line_items": null, "shipping": null, "tax": { "automatic": false }, "risk": null, "customer": { "email": "customer@example.com", "name": "Ada Lovelace", "phone": null }, "description": "Order 1001", "checkout_url": "https://checkout.paystack.com/example", "provider": "paystack", "provider_reference": "provider_reference_example", "metadata": { "order_id": "1001" }, "failure_code": null, "failure_message": null, "authorized_at": null, "succeeded_at": null, "failed_at": null, "created_at": "2026-11-02T12:00:00+00:00" } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Globally unique Veyqo payment ID; use it for reconciliation. | | object | "payment" | Required | See the JSON example. | | reference | string | Required | Merchant reference unique within the project environment; defaults to the payment ID. | | status | string | Required | Normalized payment state. Do not fulfil pending, processing, failed or cancelled payments. Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | amount | integer | Required | Original amount in the smallest currency unit. | | amount_subtotal | integer \| null | Optional | With automatic tax: the amount before tax. | | amount_tax | integer \| null | Optional | With automatic tax: the tax added at checkout, once paid. amount is then the total. | | amount_refunded | integer | Required | Successfully refunded amount in the smallest currency unit. | | currency | string | Required | Three-letter currency code. | | line_items | array \| null | Optional | As sent. | | shipping | object \| null | Optional | As sent. | | tax | object | Optional | { automatic: boolean }. | | risk | object \| null | Optional | The provider's fraud assessment when it gives one: level, score, review (true when it advises a manual review) and card_country. | | customer | object | Required | See the JSON example. | | customer.email | string | Required | Customer email address. | | customer.name | string \| null | Required | Customer name. | | customer.phone | string \| null | Required | Customer phone. | | description | string \| null | Required | Optional description. | | checkout_url | string \| null | Required | Provider checkout URL for direct payments; may be null depending on the flow. Format: uri. | | provider | string | Required | Selected provider slug. | | provider_reference | string \| null | Required | Reference the provider assigned, not your order reference. | | routing | object \| null | Required | How Veyqo routing chose the provider. Null when the request named a provider (or the environment is in shadow mode). | | routing.mode | string | Optional | Always "automatic". | | routing.decision_id | string | Optional | Routing decision ID (rtd_…); the full explanation is in the dashboard. | | routing.policy | string \| null | Optional | Policy name. | | routing.version | integer \| null | Optional | Published policy version that decided. | | routing.rule | string \| null | Optional | Rule that matched; null when the policy fallback applied. | | routing.fallbacks | array | Optional | Providers that would be tried next, in order. | | routing.failover | boolean | Optional | True when an earlier provider failed and a fallback took the payment. | | routing.attempts | integer | Optional | Providers tried for this payment. | | metadata | object \| array | Required | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. | | failure_code | string \| null | Required | Machine-readable payment failure reason, separate from API error codes. | | failure_message | string \| null | Required | Human-readable payment failure reason. | | authorized_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | succeeded_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | failed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | split | array \| null | Optional | Flat shares paid to split recipients: [{recipient: spr_…, amount}], in minor units, together less than amount. The payment goes through the recipients' provider. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a payment Retrieve by Veyqo payment ID or your merchant reference directly in the path. URL-encode references; use the Veyqo ID when a reference contains reserved URL characters. ## Endpoint GET https://api.veyqo.org/api/v1/payments/{id} Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Veyqo payment ID or URL-encoded merchant reference. Prefer the Veyqo ID for unambiguous lookup. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/payments/$PAYMENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/payments/${encodeURIComponent(process.env.PAYMENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/payments/{quote(os.environ["PAYMENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "pay_01M6EB66SC61Q3RQYAN0693DGM", "object": "payment", "reference": "ORDER-1001", "status": "pending", "amount": 50000, "amount_subtotal": null, "amount_tax": null, "amount_refunded": 0, "currency": "NGN", "line_items": null, "shipping": null, "tax": { "automatic": false }, "risk": null, "customer": { "email": "customer@example.com", "name": "Ada Lovelace", "phone": null }, "description": "Order 1001", "checkout_url": "https://checkout.paystack.com/example", "provider": "paystack", "provider_reference": "provider_reference_example", "metadata": { "order_id": "1001" }, "failure_code": null, "failure_message": null, "authorized_at": null, "succeeded_at": null, "failed_at": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Globally unique Veyqo payment ID; use it for reconciliation. | | object | "payment" | Required | See the JSON example. | | reference | string | Required | Merchant reference unique within the project environment; defaults to the payment ID. | | status | string | Required | Normalized payment state. Do not fulfil pending, processing, failed or cancelled payments. Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | amount | integer | Required | Original amount in the smallest currency unit. | | amount_subtotal | integer \| null | Optional | With automatic tax: the amount before tax. | | amount_tax | integer \| null | Optional | With automatic tax: the tax added at checkout, once paid. amount is then the total. | | amount_refunded | integer | Required | Successfully refunded amount in the smallest currency unit. | | currency | string | Required | Three-letter currency code. | | line_items | array \| null | Optional | As sent. | | shipping | object \| null | Optional | As sent. | | tax | object | Optional | { automatic: boolean }. | | risk | object \| null | Optional | The provider's fraud assessment when it gives one: level, score, review (true when it advises a manual review) and card_country. | | customer | object | Required | See the JSON example. | | customer.email | string | Required | Customer email address. | | customer.name | string \| null | Required | Customer name. | | customer.phone | string \| null | Required | Customer phone. | | description | string \| null | Required | Optional description. | | checkout_url | string \| null | Required | Provider checkout URL for direct payments; may be null depending on the flow. Format: uri. | | provider | string | Required | Selected provider slug. | | provider_reference | string \| null | Required | Reference the provider assigned, not your order reference. | | routing | object \| null | Required | How Veyqo routing chose the provider. Null when the request named a provider (or the environment is in shadow mode). | | routing.mode | string | Optional | Always "automatic". | | routing.decision_id | string | Optional | Routing decision ID (rtd_…); the full explanation is in the dashboard. | | routing.policy | string \| null | Optional | Policy name. | | routing.version | integer \| null | Optional | Published policy version that decided. | | routing.rule | string \| null | Optional | Rule that matched; null when the policy fallback applied. | | routing.fallbacks | array | Optional | Providers that would be tried next, in order. | | routing.failover | boolean | Optional | True when an earlier provider failed and a fallback took the payment. | | routing.attempts | integer | Optional | Providers tried for this payment. | | metadata | object \| array | Required | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. | | failure_code | string \| null | Required | Machine-readable payment failure reason, separate from API error codes. | | failure_message | string \| null | Required | Human-readable payment failure reason. | | authorized_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | succeeded_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | failed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | split | array \| null | Optional | Flat shares paid to split recipients: [{recipient: spr_…, amount}], in minor units, together less than amount. The payment goes through the recipients' provider. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | PAYMENT_NOT_FOUND | 404 | Use the saved Veyqo payment ID or correctly URL-encoded merchant reference with the original project’s key. | No blind retry. | | ENVIRONMENT_MISMATCH | 403 | Use the correct sandbox/live key. Resources outside the key’s project remain not-found instead of disclosing ownership. | After selecting the correct key. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Cancel a payment Retrieve by Veyqo payment ID or your merchant reference directly in the path. URL-encode references; use the Veyqo ID when a reference contains reserved URL characters. ## Endpoint POST https://api.veyqo.org/api/v1/payments/{id}/cancel Server secret key required. Scope: payments:write. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Veyqo payment ID or URL-encoded merchant reference. Prefer the Veyqo ID for unambiguous lookup. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/payments/$PAYMENT_ID/cancel" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/payments/${encodeURIComponent(process.env.PAYMENT_ID)}/cancel`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/payments/{quote(os.environ["PAYMENT_ID"], safe="")}/cancel', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "pay_01M6EB66SC61Q3RQYAN0693DGM", "object": "payment", "reference": "ORDER-1001", "status": "cancelled", "amount": 50000, "amount_subtotal": null, "amount_tax": null, "amount_refunded": 0, "currency": "NGN", "line_items": null, "shipping": null, "tax": { "automatic": false }, "risk": null, "customer": { "email": "customer@example.com", "name": "Ada Lovelace", "phone": null }, "description": "Order 1001", "checkout_url": "https://checkout.paystack.com/example", "provider": "paystack", "provider_reference": "provider_reference_example", "metadata": { "order_id": "1001" }, "failure_code": null, "failure_message": null, "authorized_at": null, "succeeded_at": null, "failed_at": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Globally unique Veyqo payment ID; use it for reconciliation. | | object | "payment" | Required | See the JSON example. | | reference | string | Required | Merchant reference unique within the project environment; defaults to the payment ID. | | status | string | Required | Normalized payment state. Do not fulfil pending, processing, failed or cancelled payments. Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | amount | integer | Required | Original amount in the smallest currency unit. | | amount_subtotal | integer \| null | Optional | With automatic tax: the amount before tax. | | amount_tax | integer \| null | Optional | With automatic tax: the tax added at checkout, once paid. amount is then the total. | | amount_refunded | integer | Required | Successfully refunded amount in the smallest currency unit. | | currency | string | Required | Three-letter currency code. | | line_items | array \| null | Optional | As sent. | | shipping | object \| null | Optional | As sent. | | tax | object | Optional | { automatic: boolean }. | | risk | object \| null | Optional | The provider's fraud assessment when it gives one: level, score, review (true when it advises a manual review) and card_country. | | customer | object | Required | See the JSON example. | | customer.email | string | Required | Customer email address. | | customer.name | string \| null | Required | Customer name. | | customer.phone | string \| null | Required | Customer phone. | | description | string \| null | Required | Optional description. | | checkout_url | string \| null | Required | Provider checkout URL for direct payments; may be null depending on the flow. Format: uri. | | provider | string | Required | Selected provider slug. | | provider_reference | string \| null | Required | Reference the provider assigned, not your order reference. | | routing | object \| null | Required | How Veyqo routing chose the provider. Null when the request named a provider (or the environment is in shadow mode). | | routing.mode | string | Optional | Always "automatic". | | routing.decision_id | string | Optional | Routing decision ID (rtd_…); the full explanation is in the dashboard. | | routing.policy | string \| null | Optional | Policy name. | | routing.version | integer \| null | Optional | Published policy version that decided. | | routing.rule | string \| null | Optional | Rule that matched; null when the policy fallback applied. | | routing.fallbacks | array | Optional | Providers that would be tried next, in order. | | routing.failover | boolean | Optional | True when an earlier provider failed and a fallback took the payment. | | routing.attempts | integer | Optional | Providers tried for this payment. | | metadata | object \| array | Required | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. | | failure_code | string \| null | Required | Machine-readable payment failure reason, separate from API error codes. | | failure_message | string \| null | Required | Human-readable payment failure reason. | | authorized_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | succeeded_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | failed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | split | array \| null | Optional | Flat shares paid to split recipients: [{recipient: spr_…, amount}], in minor units, together less than amount. The payment goes through the recipients' provider. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | PAYMENT_NOT_FOUND | 404 | Use the saved Veyqo payment ID or correctly URL-encoded merchant reference with the original project’s key. | No blind retry. | | ENVIRONMENT_MISMATCH | 403 | Use the correct sandbox/live key. Resources outside the key’s project remain not-found instead of disclosing ownership. | After selecting the correct key. | | PAYMENT_NOT_CANCELLABLE | 409 | Read the payment: if it succeeded, refund it instead of cancelling. | No. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Verify a payment Asks the provider what actually happened and updates the payment. Use it when a webhook has not arrived — never trust a browser redirect alone. ## Endpoint POST https://api.veyqo.org/api/v1/payments/{id}/verify Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. > Do not reuse an idempotency key across verification polls. Every poll should retrieve fresh state. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Veyqo payment ID or URL-encoded merchant reference. Prefer the Veyqo ID for unambiguous lookup. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/payments/$PAYMENT_ID/verify" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/payments/${encodeURIComponent(process.env.PAYMENT_ID)}/verify`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/payments/{quote(os.environ["PAYMENT_ID"], safe="")}/verify', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "pay_01M6EB66SC61Q3RQYAN0693DGM", "object": "payment", "reference": "ORDER-1001", "status": "pending", "amount": 50000, "amount_subtotal": null, "amount_tax": null, "amount_refunded": 0, "currency": "NGN", "line_items": null, "shipping": null, "tax": { "automatic": false }, "risk": null, "customer": { "email": "customer@example.com", "name": "Ada Lovelace", "phone": null }, "description": "Order 1001", "checkout_url": "https://checkout.paystack.com/example", "provider": "paystack", "provider_reference": "provider_reference_example", "metadata": { "order_id": "1001" }, "failure_code": null, "failure_message": null, "authorized_at": null, "succeeded_at": null, "failed_at": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Globally unique Veyqo payment ID; use it for reconciliation. | | object | "payment" | Required | See the JSON example. | | reference | string | Required | Merchant reference unique within the project environment; defaults to the payment ID. | | status | string | Required | Normalized payment state. Do not fulfil pending, processing, failed or cancelled payments. Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | amount | integer | Required | Original amount in the smallest currency unit. | | amount_subtotal | integer \| null | Optional | With automatic tax: the amount before tax. | | amount_tax | integer \| null | Optional | With automatic tax: the tax added at checkout, once paid. amount is then the total. | | amount_refunded | integer | Required | Successfully refunded amount in the smallest currency unit. | | currency | string | Required | Three-letter currency code. | | line_items | array \| null | Optional | As sent. | | shipping | object \| null | Optional | As sent. | | tax | object | Optional | { automatic: boolean }. | | risk | object \| null | Optional | The provider's fraud assessment when it gives one: level, score, review (true when it advises a manual review) and card_country. | | customer | object | Required | See the JSON example. | | customer.email | string | Required | Customer email address. | | customer.name | string \| null | Required | Customer name. | | customer.phone | string \| null | Required | Customer phone. | | description | string \| null | Required | Optional description. | | checkout_url | string \| null | Required | Provider checkout URL for direct payments; may be null depending on the flow. Format: uri. | | provider | string | Required | Selected provider slug. | | provider_reference | string \| null | Required | Reference the provider assigned, not your order reference. | | routing | object \| null | Required | How Veyqo routing chose the provider. Null when the request named a provider (or the environment is in shadow mode). | | routing.mode | string | Optional | Always "automatic". | | routing.decision_id | string | Optional | Routing decision ID (rtd_…); the full explanation is in the dashboard. | | routing.policy | string \| null | Optional | Policy name. | | routing.version | integer \| null | Optional | Published policy version that decided. | | routing.rule | string \| null | Optional | Rule that matched; null when the policy fallback applied. | | routing.fallbacks | array | Optional | Providers that would be tried next, in order. | | routing.failover | boolean | Optional | True when an earlier provider failed and a fallback took the payment. | | routing.attempts | integer | Optional | Providers tried for this payment. | | metadata | object \| array | Required | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. | | failure_code | string \| null | Required | Machine-readable payment failure reason, separate from API error codes. | | failure_message | string \| null | Required | Human-readable payment failure reason. | | authorized_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | succeeded_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | failed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | split | array \| null | Optional | Flat shares paid to split recipients: [{recipient: spr_…, amount}], in minor units, together less than amount. The payment goes through the recipients' provider. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | PAYMENT_NOT_FOUND | 404 | Use the saved Veyqo payment ID or correctly URL-encoded merchant reference with the original project’s key. | No blind retry. | | ENVIRONMENT_MISMATCH | 403 | Use the correct sandbox/live key. Resources outside the key’s project remain not-found instead of disclosing ownership. | After selecting the correct key. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Refund a payment Full or partial. Omit `amount` to refund everything still refundable. ## Endpoint POST https://api.veyqo.org/api/v1/payments/{id}/refunds Server secret key required. Scope: refunds:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Veyqo payment ID or URL-encoded merchant reference. Prefer the Veyqo ID for unambiguous lookup. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/payments/$PAYMENT_ID/refunds" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "amount": 25000, "reason": "requested_by_customer" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/payments/${encodeURIComponent(process.env.PAYMENT_ID)}/refunds`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "amount": 25000, "reason": "requested_by_customer" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "amount": 25000, "reason": "requested_by_customer" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/payments/{quote(os.environ["PAYMENT_ID"], safe="")}/refunds', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "amount": 25000, "reason": "requested_by_customer" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | amount | integer | Optional | Omit this property to refund the entire remaining refundable amount. Do not send null. Minimum 1. | | reason | string \| null | Optional | Reason for the refund. Maximum 255 characters. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "ref_01M6EB66SC61Q3RQYAN0693DGM", "object": "refund", "payment": "pay_01M6EB66SC61Q3RQYAN0693DGM", "amount": 25000, "currency": "NGN", "status": "pending", "reason": "requested_by_customer", "failure_message": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Veyqo refund ID. | | object | "refund" | Required | See the JSON example. | | payment | string | Required | Original Veyqo payment ID. | | amount | integer | Required | Refund amount in the smallest currency unit. | | currency | string | Required | Original payment currency. | | status | string | Required | Values: pending, succeeded, failed. | | reason | string \| null | Required | Optional reason. | | failure_message | string \| null | Required | Provider failure message when available. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | PAYMENT_NOT_FOUND | 404 | Use the saved Veyqo payment ID or correctly URL-encoded merchant reference with the original project’s key. | No blind retry. | | ENVIRONMENT_MISMATCH | 403 | Use the correct sandbox/live key. Resources outside the key’s project remain not-found instead of disclosing ownership. | After selecting the correct key. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | PAYMENT_ALREADY_REFUNDED | 409 | Read the payment and refunds, compare amount_refunded to amount, and avoid issuing a duplicate refund. | No. | | INVALID_PROVIDER | 422 | Choose a supported connected provider. Refund/direct-checkout capabilities can differ from simple payment creation. | After configuration or provider selection changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a refund The refund and the payment it belongs to. ## Endpoint GET https://api.veyqo.org/api/v1/refunds/{id} Server secret key required. Scope: refunds:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/refunds/$REFUND_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/refunds/${encodeURIComponent(process.env.REFUND_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/refunds/{quote(os.environ["REFUND_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "ref_01M6EB66SC61Q3RQYAN0693DGM", "object": "refund", "payment": "pay_01M6EB66SC61Q3RQYAN0693DGM", "amount": 25000, "currency": "NGN", "status": "pending", "reason": "requested_by_customer", "failure_message": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Veyqo refund ID. | | object | "refund" | Required | See the JSON example. | | payment | string | Required | Original Veyqo payment ID. | | amount | integer | Required | Refund amount in the smallest currency unit. | | currency | string | Required | Original payment currency. | | status | string | Required | Values: pending, succeeded, failed. | | reason | string \| null | Required | Optional reason. | | failure_message | string \| null | Required | Provider failure message when available. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | ENVIRONMENT_MISMATCH | 403 | Use the correct sandbox/live key. Resources outside the key’s project remain not-found instead of disclosing ownership. | After selecting the correct key. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List events Every event Veyqo produced in this environment, newest first. Filter by `type`. ## Endpoint GET https://api.veyqo.org/api/v1/events Server secret key required. Scope: events:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | Page number, starting at 1. | | per_page | query | No | Page size, default 25 and maximum 100. Maximum 100. | | type | query | No | Exact supported event type. | | payment_id | query | No | Veyqo payment ID, not your order reference. | | created_after | query | No | Inclusive creation-time lower bound. Use an ISO 8601 date/time. | | created_before | query | No | Inclusive creation-time upper bound. Use an ISO 8601 date/time. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/events?per_page=5" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/events?per_page=5`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/events?per_page=5', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "id": "evt_01M6EB66SC61Q3RQYAN0693DGM", "type": "payment.succeeded", "created_at": "2026-11-02T12:00:00+00:00", "environment": "sandbox", "data": { "payment_id": "pay_01M6EB66SC61Q3RQYAN0693DGM", "reference": "ORDER-1001", "amount": 50000, "amount_subtotal": null, "amount_tax": null, "amount_refunded": 0, "currency": "NGN", "status": "succeeded", "failure_code": null, "failure_message": null, "risk": null, "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "provider": { "name": "paystack", "reference": "provider_reference_example" }, "metadata": { "order_id": "1001" } } } ], "meta": { "page": 1, "per_page": 25, "total": 1, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Deduplication key: the same ID as Veyqo-Event-Id. | | type | string | Required | Normalized event type; see the webhook guide. | | created_at | string | Required | Event creation timestamp. Format: date-time. | | environment | string | Required | Values: sandbox, live. | | data | EventData \| ProviderServiceEventData | Required | See the JSON example. | | data.payment_id | string | Required | Payment ID to retrieve and verify. | | data.reference | string | Required | Merchant reference. | | data.amount | integer \| null | Optional | Kobo (NGN minor units), like every Veyqo amount. | | data.amount_subtotal | integer \| null | Optional | Before tax, with automatic tax. | | data.amount_tax | integer \| null | Optional | Tax added at checkout, with automatic tax. | | data.amount_refunded | integer | Required | Minor-unit refunded amount. | | data.currency | string | Optional | Values: NGN. | | data.status | string | Required | Provider resource state; accepted and pending are not settled. | | data.failure_code | string \| null | Optional | A short code for why it failed (for example a decline code); null unless failed. | | data.failure_message | string \| null | Optional | Why it failed, in the provider's words where it gave them; null unless failed. | | data.risk | object \| null | Optional | The provider's fraud assessment when it gives one: level, score, review (true when it advises a manual review) and card_country. | | data.customer | object | Required | See the JSON example. | | data.customer.email | string | Required | See the JSON example. | | data.customer.name | string | Optional | See the JSON example. | | data.provider | object | Required | See the JSON example. | | data.provider.name | string | Optional | See the JSON example. | | data.provider.reference | string \| null | Optional | See the JSON example. | | data.metadata | object \| array | Required | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. | | data.refund_id | string | Optional | Present for refund events. | | data.refund_amount | integer | Optional | Present for refund events, in minor units. | | data.refund_status | string | Optional | Present for refund events. Values: pending, succeeded, failed. | | data.reason | string \| null | Optional | Present for refund events. | | data.operation_id | string | Required | See the JSON example. | | data.service | string | Required | See the JSON example. | | data.kind | string | Required | See the JSON example. | | data.resource_id | string \| null | Optional | See the JSON example. | | data.direction | string \| null | Optional | For transfers and account credits: credit is money received into one of this project's accounts, debit is money sent. Values: credit, debit, . | | data.account_id | string \| null | Optional | SafeHaven internal _id of the account involved, when SafeHaven reports it. | | data.account_number | string \| null | Optional | Account number of a created or imported account. | | data.credit_account_number | string \| null | Optional | The account that received the money. For a deposit, the customer's sub-account: use it to find whose wallet to credit. | | data.credit_account_name | string \| null | Optional | Name on the receiving account. | | data.debit_account_number | string \| null | Optional | The account the money came from. | | data.debit_account_name | string \| null | Optional | Name of the sender. | | data.narration | string \| null | Optional | Transfer narration. | | data.session_id | string \| null | Optional | NIP session ID. Unique per transfer: deduplicate deposits on it as well as on the event id. | | data.payment_reference | string \| null | Optional | Upstream payment reference. | | data.merchant_reference | string \| null | Optional | Your external_reference or payment_reference, for operations you started. | | data.fees | integer \| null | Optional | Provider fee in kobo. | | data.vat | integer \| null | Optional | VAT in kobo. | | data.stamp_duty | integer \| null | Optional | Stamp duty in kobo. | | data.is_reversed | boolean \| null | Optional | True when SafeHaven reports the transfer reversed. Never credit a reversed transfer. | | data.response_code | string \| null | Optional | NIP response code; 00 is successful. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve an event The normalized event, identical in shape whichever provider caused it. ## Endpoint GET https://api.veyqo.org/api/v1/events/{id} Server secret key required. Scope: events:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/events/$EVENT_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/events/${encodeURIComponent(process.env.EVENT_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/events/{quote(os.environ["EVENT_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "evt_01M6EB66SC61Q3RQYAN0693DGM", "type": "payment.succeeded", "created_at": "2026-11-02T12:00:00+00:00", "environment": "sandbox", "data": { "payment_id": "pay_01M6EB66SC61Q3RQYAN0693DGM", "reference": "ORDER-1001", "amount": 50000, "amount_subtotal": null, "amount_tax": null, "amount_refunded": 0, "currency": "NGN", "status": "succeeded", "failure_code": null, "failure_message": null, "risk": null, "customer": { "email": "customer@example.com", "name": "Ada Lovelace" }, "provider": { "name": "paystack", "reference": "provider_reference_example" }, "metadata": { "order_id": "1001" } } } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Deduplication key: the same ID as Veyqo-Event-Id. | | type | string | Required | Normalized event type; see the webhook guide. | | created_at | string | Required | Event creation timestamp. Format: date-time. | | environment | string | Required | Values: sandbox, live. | | data | EventData \| ProviderServiceEventData | Required | See the JSON example. | | data.payment_id | string | Required | Payment ID to retrieve and verify. | | data.reference | string | Required | Merchant reference. | | data.amount | integer \| null | Optional | Kobo (NGN minor units), like every Veyqo amount. | | data.amount_subtotal | integer \| null | Optional | Before tax, with automatic tax. | | data.amount_tax | integer \| null | Optional | Tax added at checkout, with automatic tax. | | data.amount_refunded | integer | Required | Minor-unit refunded amount. | | data.currency | string | Optional | Values: NGN. | | data.status | string | Required | Provider resource state; accepted and pending are not settled. | | data.failure_code | string \| null | Optional | A short code for why it failed (for example a decline code); null unless failed. | | data.failure_message | string \| null | Optional | Why it failed, in the provider's words where it gave them; null unless failed. | | data.risk | object \| null | Optional | The provider's fraud assessment when it gives one: level, score, review (true when it advises a manual review) and card_country. | | data.customer | object | Required | See the JSON example. | | data.customer.email | string | Required | See the JSON example. | | data.customer.name | string | Optional | See the JSON example. | | data.provider | object | Required | See the JSON example. | | data.provider.name | string | Optional | See the JSON example. | | data.provider.reference | string \| null | Optional | See the JSON example. | | data.metadata | object \| array | Required | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. | | data.refund_id | string | Optional | Present for refund events. | | data.refund_amount | integer | Optional | Present for refund events, in minor units. | | data.refund_status | string | Optional | Present for refund events. Values: pending, succeeded, failed. | | data.reason | string \| null | Optional | Present for refund events. | | data.operation_id | string | Required | See the JSON example. | | data.service | string | Required | See the JSON example. | | data.kind | string | Required | See the JSON example. | | data.resource_id | string \| null | Optional | See the JSON example. | | data.direction | string \| null | Optional | For transfers and account credits: credit is money received into one of this project's accounts, debit is money sent. Values: credit, debit, . | | data.account_id | string \| null | Optional | SafeHaven internal _id of the account involved, when SafeHaven reports it. | | data.account_number | string \| null | Optional | Account number of a created or imported account. | | data.credit_account_number | string \| null | Optional | The account that received the money. For a deposit, the customer's sub-account: use it to find whose wallet to credit. | | data.credit_account_name | string \| null | Optional | Name on the receiving account. | | data.debit_account_number | string \| null | Optional | The account the money came from. | | data.debit_account_name | string \| null | Optional | Name of the sender. | | data.narration | string \| null | Optional | Transfer narration. | | data.session_id | string \| null | Optional | NIP session ID. Unique per transfer: deduplicate deposits on it as well as on the event id. | | data.payment_reference | string \| null | Optional | Upstream payment reference. | | data.merchant_reference | string \| null | Optional | Your external_reference or payment_reference, for operations you started. | | data.fees | integer \| null | Optional | Provider fee in kobo. | | data.vat | integer \| null | Optional | VAT in kobo. | | data.stamp_duty | integer \| null | Optional | Stamp duty in kobo. | | data.is_reversed | boolean \| null | Optional | True when SafeHaven reports the transfer reversed. Never credit a reversed transfer. | | data.response_code | string \| null | Optional | NIP response code; 00 is successful. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create a checkout session Returns a checkout `url` where the customer pays without leaving Veyqo: by bank transfer, USSD or mobile money on the page itself, or by card in the gateway's own secure form over it. Created here with your secret key, the amount cannot be changed by the customer; open it with the JS SDK or redirect to `url`. ## Endpoint POST https://api.veyqo.org/api/v1/checkout/sessions Server secret key required. Scope: payments:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/checkout/sessions" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" }, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/checkout/sessions`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" }, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" }, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/checkout/sessions', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" }, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | amount | integer | Required | Integer minor-unit amount. NGN 500.00 is 50000; JPY 500 is 500. Minimum 1. | | currency | string | Required | Three-letter currency supported by the selected provider. Maximum 3 characters. | | reference | string \| null | Optional | Order reference; a session can create multiple uniquely referenced payment attempts. Maximum 100 characters. | | description | string \| null | Optional | Maximum 500 characters. | | customer | object | Optional | See the JSON example. | | customer.email | string \| null | Optional | Maximum 255 characters. Format: email. | | customer.name | string \| null | Optional | Maximum 255 characters. | | metadata | object \| array \| null | Optional | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. Maximum 20 entries. | | provider | string \| null | Optional | Gateway selected by your server or project default; the customer chooses a payment method, not the gateway. Maximum 40 characters. | | success_url | string \| null | Optional | HTTP or HTTPS return URL. Use HTTPS in production. Maximum 2048 characters. Format: uri. | | cancel_url | string \| null | Optional | HTTP or HTTPS cancellation URL. Use HTTPS in production. Maximum 2048 characters. Format: uri. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cs_01M6EB66SC61Q3RQYAN0693DGM", "object": "checkout_session", "url": "https://veyqo.org/pay/cs_01M6EB66SC61Q3RQYAN0693DGM", "status": "open", "source": "api", "provider": "paystack", "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "description": "Order 1001", "customer_email": "customer@example.com", "payment": null, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart", "expires_at": "2026-11-02T13:00:00+00:00", "completed_at": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Checkout session ID (cs_ prefix). | | object | "checkout_session" | Required | See the JSON example. | | url | string | Required | Hosted Veyqo URL; redirect here or open this session using VeyqoCheckout. Format: uri. | | status | string | Required | Values: open, completed, expired. | | source | string | Required | Values: api, browser, link. | | provider | string | Required | Selected provider slug; this field is an object on the browser session detail endpoint. | | amount | integer | Required | Server-defined amount in minor units. | | currency | string | Required | Three-letter currency. | | reference | string \| null | Required | Your order reference, when supplied. | | description | string \| null | Required | Checkout description. | | customer_email | string \| null | Required | Customer email if already supplied. | | payment | object \| null | Required | Current payment attempt, if any. A session can have multiple attempts over time. | | payment.id | string | Required | See the JSON example. | | payment.reference | string | Required | See the JSON example. | | payment.status | string | Required | Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | payment.provider | string | Required | See the JSON example. | | success_url | string \| null | Required | Configured return URL. A redirect is not proof of payment. | | cancel_url | string \| null | Required | Configured cancellation URL. | | expires_at | string | Required | Session expiry time. Format: date-time. | | completed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | | PLAN_LIMIT_REACHED | 402 | Review the active plan, project/usage allowances and billing status with the organization owner. | After resolving plan/billing restrictions. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve a checkout session Its status (`open`, `completed`, `expired`) and the payment behind it. A payment still waiting is verified with the provider before this answers. ## Endpoint GET https://api.veyqo.org/api/v1/checkout/sessions/{id} Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/checkout/sessions/$CHECKOUT_SESSION_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/checkout/sessions/${encodeURIComponent(process.env.CHECKOUT_SESSION_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/checkout/sessions/{quote(os.environ["CHECKOUT_SESSION_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cs_01M6EB66SC61Q3RQYAN0693DGM", "object": "checkout_session", "url": "https://veyqo.org/pay/cs_01M6EB66SC61Q3RQYAN0693DGM", "status": "open", "source": "api", "provider": "paystack", "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "description": "Order 1001", "customer_email": "customer@example.com", "payment": null, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart", "expires_at": "2026-11-02T13:00:00+00:00", "completed_at": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Checkout session ID (cs_ prefix). | | object | "checkout_session" | Required | See the JSON example. | | url | string | Required | Hosted Veyqo URL; redirect here or open this session using VeyqoCheckout. Format: uri. | | status | string | Required | Values: open, completed, expired. | | source | string | Required | Values: api, browser, link. | | provider | string | Required | Selected provider slug; this field is an object on the browser session detail endpoint. | | amount | integer | Required | Server-defined amount in minor units. | | currency | string | Required | Three-letter currency. | | reference | string \| null | Required | Your order reference, when supplied. | | description | string \| null | Required | Checkout description. | | customer_email | string \| null | Required | Customer email if already supplied. | | payment | object \| null | Required | Current payment attempt, if any. A session can have multiple attempts over time. | | payment.id | string | Required | See the JSON example. | | payment.reference | string | Required | See the JSON example. | | payment.status | string | Required | Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | payment.provider | string | Required | See the JSON example. | | success_url | string \| null | Required | Configured return URL. A redirect is not proof of payment. | | cancel_url | string \| null | Required | Configured cancellation URL. | | expires_at | string | Required | Session expiry time. Format: date-time. | | completed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # List connected providers Lists provider connection rows for this environment, including status, health and explicitly public provider keys. Disabled or historical rows may be present; secret credentials are never returned. ## Endpoint GET https://api.veyqo.org/api/v1/providers Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/providers" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/providers`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/providers', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "provider": "paystack", "name": "Paystack", "status": "active", "health": "healthy", "currencies": [ "NGN", "GHS", "ZAR", "KES", "USD" ], "capabilities": [ "collections", "refunds", "transfers" ], "public_credentials": { "public_key": "pk_test_public_example" }, "connected_at": "2026-11-02T12:00:00+00:00" } ] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | provider | string | Required | Provider slug. | | name | string | Required | Provider display name. | | status | string | Required | Connection status; active does not guarantee a healthy provider account. | | health | string | Required | Observed connection health. | | currencies | array | Required | See the JSON example. | | capabilities | array | Required | See the JSON example. | | public_credentials | object | Required | Only provider keys explicitly marked public, such as public_key. Never includes secret credentials. | | connected_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | > data is an array. public_credentials contains only deliberately public provider keys; your Veyqo secret key and provider secret keys must remain on your server. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | METHOD_NOT_ALLOWED | 405 | Use the method documented for the endpoint, such as POST for verification and refunds. | After fixing the method. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Bank List Bank List through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires transfers:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/transfers/banks Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/transfers/banks" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/transfers/banks`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/transfers/banks', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | [].name | string | Optional | See the JSON example. | | [].routing_key | string | Optional | See the JSON example. | | [].logo_image | JSON | Optional | See the JSON example. | | [].bank_code | string | Optional | See the JSON example. | | [].category_id | string | Optional | See the JSON example. | | [].nuban_code | JSON | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Delete Beneficiary Delete Beneficiary through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires transfers:write. ## Endpoint DELETE https://api.veyqo.org/api/v1/safehaven/transfers/beneficiaries/{id} Server secret key required. Scope: transfers:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request DELETE "https://api.veyqo.org/api/v1/safehaven/transfers/beneficiaries/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/transfers/beneficiaries/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'DELETE', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'DELETE', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('DELETE', f'https://api.veyqo.org/api/v1/safehaven/transfers/beneficiaries/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Beneficiaries Get Beneficiaries through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires transfers:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/transfers/beneficiaries Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/transfers/beneficiaries" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/transfers/beneficiaries`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/transfers/beneficiaries', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Transfers Get Transfers through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires transfers:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/transfers Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | One-based project history page. | | per_page | query | No | Maximum number of results per page. Maximum 100. | | status | query | No | Provider resource status, matched case-insensitively. | | created_after | query | No | Include operations created on or after this timestamp. | | created_before | query | No | Include operations created on or before this timestamp. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/transfers?page=1&per_page=25" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/transfers?page=1&per_page=25`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/transfers?page=1&per_page=25', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [], "meta": { "page": 1, "per_page": 25, "total": 0, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | account | string | Optional | See the JSON example. | | type | string | Optional | See the JSON example. | | session_id | string | Optional | See the JSON example. | | name_enquiry_reference | string | Optional | See the JSON example. | | payment_reference | string | Optional | See the JSON example. | | mandate_reference | JSON | Optional | See the JSON example. | | is_reversed | boolean | Optional | See the JSON example. | | reversal_reference | JSON | Optional | See the JSON example. | | provider | string | Optional | See the JSON example. | | provider_channel | string | Optional | See the JSON example. | | provider_channel_code | string | Optional | See the JSON example. | | destination_institution_code | string | Optional | See the JSON example. | | credit_account_name | string | Optional | See the JSON example. | | credit_account_number | string | Optional | See the JSON example. | | credit_bank_verification_number | JSON | Optional | See the JSON example. | | credit_k_y_c_level | string | Optional | See the JSON example. | | debit_account_name | string | Optional | See the JSON example. | | debit_account_number | string | Optional | See the JSON example. | | debit_bank_verification_number | JSON | Optional | See the JSON example. | | debit_k_y_c_level | string | Optional | See the JSON example. | | transaction_location | string | Optional | See the JSON example. | | narration | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | fees | integer | Optional | Amount in NGN minor units (kobo). | | vat | integer | Optional | Amount in NGN minor units (kobo). | | stamp_duty | integer | Optional | Amount in NGN minor units (kobo). | | response_code | string | Optional | See the JSON example. | | response_message | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | created_by | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | approved_at | string | Optional | See the JSON example. | | approved_by | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Name Enquiry Name Enquiry through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires transfers:read. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/transfers/name-enquiry Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/transfers/name-enquiry" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "bank_code": "090286", "account_number": "0000000000" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/transfers/name-enquiry`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "bank_code": "090286", "account_number": "0000000000" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "bank_code": "090286", "account_number": "0000000000" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/transfers/name-enquiry', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "bank_code": "090286", "account_number": "0000000000" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | bank_code | string | Required | The bank code of the bank for the account you want to perform an enquiry for. | | account_number | string | Required | The account number of the account to perform the enquiry for. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "response_code": "example", "response_message": "example", "session_id": "000000000000000000000001", "bank_code": "090286", "account_number": "0000000000", "account_name": "example", "kyc_level": "example", "bvn": "example" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | response_code | string | Optional | See the JSON example. | | response_message | string | Optional | See the JSON example. | | session_id | string | Optional | See the JSON example. | | bank_code | string | Optional | See the JSON example. | | account_number | string | Optional | See the JSON example. | | account_name | string | Optional | See the JSON example. | | kyc_level | string | Optional | See the JSON example. | | bvn | string | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Transfer Status Transfer Status through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires transfers:read. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/transfers/status Server secret key required. Scope: transfers:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/transfers/status" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '[]' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/transfers/status`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify([]), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' [] JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/transfers/status', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json=[], timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | session_id | string | Optional | Specifies the sessionId for the transaction. This parameter must be included when the paymentReference is not passed. | | payment_reference | string | Optional | Specifies the paymentReference for the transaction. This parameter must be included when the sessionId is not passed. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "queued": false, "limit_exceeded": false, "_id": "000000000000000000000001", "client": "example", "account": "example", "type": "example", "session_id": "000000000000000000000001", "name_enquiry_reference": "order-1001", "payment_reference": "order-1001", "mandate_reference": [], "is_reversed": false, "reversal_reference": [], "provider": "example", "provider_channel": "example", "provider_channel_code": "example", "destination_institution_code": "example", "credit_account_name": "example", "credit_account_number": "example", "credit_bank_verification_number": [], "credit_k_y_c_level": "example", "debit_account_name": "example", "debit_account_number": "example", "real_debit_account_name": "example", "real_debit_account_number": "example", "debit_bank_verification_number": [], "debit_k_y_c_level": "example", "transaction_location": "example", "narration": "example", "amount": 50000, "fees": 0, "vat": 0, "stamp_duty": 0, "response_code": "example", "response_message": "example", "status": "Created", "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0 } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | queued | boolean | Optional | See the JSON example. | | limit_exceeded | boolean | Optional | See the JSON example. | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | account | string | Optional | See the JSON example. | | type | string | Optional | See the JSON example. | | session_id | string | Optional | See the JSON example. | | name_enquiry_reference | string | Optional | See the JSON example. | | payment_reference | string | Optional | See the JSON example. | | mandate_reference | JSON | Optional | See the JSON example. | | is_reversed | boolean | Optional | See the JSON example. | | reversal_reference | JSON | Optional | See the JSON example. | | provider | string | Optional | See the JSON example. | | provider_channel | string | Optional | See the JSON example. | | provider_channel_code | string | Optional | See the JSON example. | | destination_institution_code | string | Optional | See the JSON example. | | credit_account_name | string | Optional | See the JSON example. | | credit_account_number | string | Optional | See the JSON example. | | credit_bank_verification_number | JSON | Optional | See the JSON example. | | credit_k_y_c_level | string | Optional | See the JSON example. | | debit_account_name | string | Optional | See the JSON example. | | debit_account_number | string | Optional | See the JSON example. | | real_debit_account_name | string | Optional | See the JSON example. | | real_debit_account_number | string | Optional | See the JSON example. | | debit_bank_verification_number | JSON | Optional | See the JSON example. | | debit_k_y_c_level | string | Optional | See the JSON example. | | transaction_location | string | Optional | See the JSON example. | | narration | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | fees | integer | Optional | Amount in NGN minor units (kobo). | | vat | integer | Optional | Amount in NGN minor units (kobo). | | stamp_duty | integer | Optional | Amount in NGN minor units (kobo). | | response_code | string | Optional | See the JSON example. | | response_message | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Transfer Transfer through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires transfers:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/transfers Server secret key required. Scope: transfers:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/transfers" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "name_enquiry_reference": "order-1001", "beneficiary_bank_code": "090286", "beneficiary_account_number": "0000000000", "amount": 50000, "save_beneficiary": false }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/transfers`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "name_enquiry_reference": "order-1001", "beneficiary_bank_code": "090286", "beneficiary_account_number": "0000000000", "amount": 50000, "save_beneficiary": false }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "name_enquiry_reference": "order-1001", "beneficiary_bank_code": "090286", "beneficiary_account_number": "0000000000", "amount": 50000, "save_beneficiary": false } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/transfers', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "name_enquiry_reference": "order-1001", "beneficiary_bank_code": "090286", "beneficiary_account_number": "0000000000", "amount": 50000, "save_beneficiary": False }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | name_enquiry_reference | string | Required | This is the `sessionId` returned in the name enquiry endpoint response. | | debit_account_number | string | Optional | The account to debit the funds from. | | beneficiary_bank_code | string | Required | The bank code of the beneficiary account. | | beneficiary_account_number | string | Required | The account number of the beneficiary account. | | amount | integer | Required | Amount in NGN minor units (kobo). Veyqo converts it to naira for SafeHaven. Minimum 1. | | save_beneficiary | boolean | Required | Set to `true` to save the beneficiary. | | narration | string | Optional | The transfer narration. | | payment_reference | string | Optional | A payment reference to attach to the transfer. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client": "example", "account": "example", "type": "example", "session_id": "000000000000000000000001", "name_enquiry_reference": "order-1001", "payment_reference": "order-1001", "mandate_reference": [], "is_reversed": false, "reversal_reference": [], "provider": "example", "provider_channel": "example", "provider_channel_code": "example", "destination_institution_code": "example", "credit_account_name": "example", "credit_account_number": "example", "credit_bank_verification_number": [], "credit_k_y_c_level": "example", "debit_account_name": "example", "debit_account_number": "example", "debit_bank_verification_number": [], "debit_k_y_c_level": "example", "transaction_location": "example", "narration": "example", "amount": 50000, "fees": 0, "vat": 0, "stamp_duty": 0, "response_code": "example", "response_message": "example", "status": "Created", "is_deleted": false, "created_at": "example", "created_by": "example", "updated_at": "example", "__v": 0, "approved_at": "example", "approved_by": "example", "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | account | string | Optional | See the JSON example. | | type | string | Optional | See the JSON example. | | session_id | string | Optional | See the JSON example. | | name_enquiry_reference | string | Optional | See the JSON example. | | payment_reference | string | Optional | See the JSON example. | | mandate_reference | JSON | Optional | See the JSON example. | | is_reversed | boolean | Optional | See the JSON example. | | reversal_reference | JSON | Optional | See the JSON example. | | provider | string | Optional | See the JSON example. | | provider_channel | string | Optional | See the JSON example. | | provider_channel_code | string | Optional | See the JSON example. | | destination_institution_code | string | Optional | See the JSON example. | | credit_account_name | string | Optional | See the JSON example. | | credit_account_number | string | Optional | See the JSON example. | | credit_bank_verification_number | JSON | Optional | See the JSON example. | | credit_k_y_c_level | string | Optional | See the JSON example. | | debit_account_name | string | Optional | See the JSON example. | | debit_account_number | string | Optional | See the JSON example. | | debit_bank_verification_number | JSON | Optional | See the JSON example. | | debit_k_y_c_level | string | Optional | See the JSON example. | | transaction_location | string | Optional | See the JSON example. | | narration | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | fees | integer | Optional | Amount in NGN minor units (kobo). | | vat | integer | Optional | Amount in NGN minor units (kobo). | | stamp_duty | integer | Optional | Amount in NGN minor units (kobo). | | response_code | string | Optional | See the JSON example. | | response_message | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | created_by | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | approved_at | string | Optional | See the JSON example. | | approved_by | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Purchase a Data Bundle Purchase a Data Bundle through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/vas/pay/data Server secret key required. Scope: bills:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/vas/pay/data" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "service_category_id": "000000000000000000000001", "bundle_code": "example", "amount": 50000, "channel": "WEB", "phone_number": "+2348000000000" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/pay/data`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "service_category_id": "000000000000000000000001", "bundle_code": "example", "amount": 50000, "channel": "WEB", "phone_number": "+2348000000000" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "service_category_id": "000000000000000000000001", "bundle_code": "example", "amount": 50000, "channel": "WEB", "phone_number": "+2348000000000" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/vas/pay/data', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "service_category_id": "000000000000000000000001", "bundle_code": "example", "amount": 50000, "channel": "WEB", "phone_number": "+2348000000000" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | service_category_id | string | Required | The `_id` of the service category. | | bundle_code | string | Required | The bundleCode of the data bundle. | | amount | integer | Required | Amount in NGN minor units (kobo). Veyqo converts it to naira for SafeHaven. Minimum 1. | | channel | string | Required | The channel the purchase is made on Values: WEB, POS, ATM. | | debit_account_number | string | Optional | The account number for the account to be debited. | | phone_number | string | Required | The beneficiary phone number. | | external_reference | string | Optional | This is an external reference to be attached to the transaction object. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "client_id": "000000000000000000000001", "service_category_id": "000000000000000000000001", "reference": "order-1001", "status": "Created", "amount": 50000, "id": "000000000000000000000001", "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | client_id | string | Optional | See the JSON example. | | service_category_id | string | Optional | See the JSON example. | | reference | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | id | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Category Products Get Category Products through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/vas/service-category/{id}/products Server secret key required. Scope: bills:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/vas/service-category/$PROVIDER_RESOURCE_ID/products" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/service-category/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}/products`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/vas/service-category/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}/products', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "name": "example", "bundle_code": "example", "amount": 50000, "duration": "example", "is_amount_fixed": false } ] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | [].name | string | Optional | See the JSON example. | | [].bundle_code | string | Optional | See the JSON example. | | [].amount | integer | Optional | Amount in NGN minor units (kobo). | | [].duration | string | Optional | See the JSON example. | | [].is_amount_fixed | boolean | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Service Categories Get Service Categories through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/vas/service/{id}/service-categories Server secret key required. Scope: bills:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/vas/service/$PROVIDER_RESOURCE_ID/service-categories" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/service/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}/service-categories`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/vas/service/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}/service-categories', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [ { "_id": "000000000000000000000001", "name": "example", "identifier": "example", "service": "example", "vendor": "example", "is_fixed_amount": false, "description": "example", "logo_url": "https://example.com", "provider_commission": { "flat_amount": 0, "percentage_amount": 0, "min_cap": [], "max_cap": [] }, "created_at": "example", "updated_at": "example", "__v": 0 } ] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | []._id | string | Optional | See the JSON example. | | [].name | string | Optional | See the JSON example. | | [].identifier | string | Optional | See the JSON example. | | [].service | string | Optional | See the JSON example. | | [].vendor | string | Optional | See the JSON example. | | [].is_fixed_amount | boolean | Optional | See the JSON example. | | [].description | string | Optional | See the JSON example. | | [].logo_url | string | Optional | See the JSON example. | | [].provider_commission | JSON | Optional | See the JSON example. | | [].provider_commission.flat_amount | integer | Optional | See the JSON example. | | [].provider_commission.percentage_amount | number | Optional | See the JSON example. | | [].provider_commission.min_cap | JSON | Optional | See the JSON example. | | [].provider_commission.max_cap | JSON | Optional | See the JSON example. | | [].created_at | string | Optional | See the JSON example. | | [].updated_at | string | Optional | See the JSON example. | | [].__v | integer | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Service Get Service through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/vas/service/{id} Server secret key required. Scope: bills:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/vas/service/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/service/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/vas/service/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "name": "example", "identifier": "example", "description": "example", "created_at": "example", "updated_at": "example", "__v": 0 } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | name | string | Optional | See the JSON example. | | identifier | string | Optional | See the JSON example. | | description | string | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Services Get Services through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/vas/services Server secret key required. Scope: bills:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/vas/services" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/services`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/vas/services', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | []._id | string | Optional | See the JSON example. | | [].name | string | Optional | See the JSON example. | | [].identifier | string | Optional | See the JSON example. | | [].description | string | Optional | See the JSON example. | | [].created_at | string | Optional | See the JSON example. | | [].updated_at | string | Optional | See the JSON example. | | [].__v | integer | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get VAS Transaction Get VAS Transaction through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/vas/transaction/{id} Server secret key required. Scope: bills:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/vas/transaction/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/transaction/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/vas/transaction/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client_id": "000000000000000000000001", "debit_account_number": "example", "service_category_id": { "_id": "000000000000000000000001", "name": "example", "identifier": "example", "service": "example", "vendor": "example", "is_fixed_amount": false, "description": "example", "logo_url": "https://example.com", "created_at": "example", "updated_at": "example", "__v": 0 }, "service_id": { "_id": "000000000000000000000001", "name": "example", "identifier": "example", "description": "example", "created_at": "example", "updated_at": "example", "__v": 0 }, "product_name": "example", "reference": "order-1001", "internal_reference": "order-1001", "debit_payment_reference": "order-1001", "reversal_payment_reference": "order-1001", "transaction_id": "000000000000000000000001", "transaction_status": "example", "receiver_number": "example", "vas_type": "example", "channel": "example", "payment_status": "example", "vendor": "example", "transaction_fee": 0, "debited_amount": 0, "transaction_amount": 0, "utility_token": "example", "created_at": "example", "updated_at": "example", "__v": 0 } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client_id | string | Optional | See the JSON example. | | debit_account_number | string | Optional | See the JSON example. | | service_category_id | object | Optional | See the JSON example. | | service_category_id._id | string | Optional | See the JSON example. | | service_category_id.name | string | Optional | See the JSON example. | | service_category_id.identifier | string | Optional | See the JSON example. | | service_category_id.service | string | Optional | See the JSON example. | | service_category_id.vendor | string | Optional | See the JSON example. | | service_category_id.is_fixed_amount | boolean | Optional | See the JSON example. | | service_category_id.description | string | Optional | See the JSON example. | | service_category_id.logo_url | string | Optional | See the JSON example. | | service_category_id.created_at | string | Optional | See the JSON example. | | service_category_id.updated_at | string | Optional | See the JSON example. | | service_category_id.__v | integer | Optional | See the JSON example. | | service_id | object | Optional | See the JSON example. | | service_id._id | string | Optional | See the JSON example. | | service_id.name | string | Optional | See the JSON example. | | service_id.identifier | string | Optional | See the JSON example. | | service_id.description | string | Optional | See the JSON example. | | service_id.created_at | string | Optional | See the JSON example. | | service_id.updated_at | string | Optional | See the JSON example. | | service_id.__v | integer | Optional | See the JSON example. | | product_name | string | Optional | See the JSON example. | | reference | string | Optional | See the JSON example. | | internal_reference | string | Optional | See the JSON example. | | debit_payment_reference | string | Optional | See the JSON example. | | reversal_payment_reference | string | Optional | See the JSON example. | | transaction_id | string | Optional | See the JSON example. | | transaction_status | string | Optional | See the JSON example. | | receiver_number | string | Optional | See the JSON example. | | vas_type | string | Optional | See the JSON example. | | channel | string | Optional | See the JSON example. | | payment_status | string | Optional | See the JSON example. | | vendor | string | Optional | See the JSON example. | | transaction_fee | integer | Optional | See the JSON example. | | debited_amount | integer | Optional | See the JSON example. | | transaction_amount | integer | Optional | See the JSON example. | | utility_token | string | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get VAS Transactions Get VAS Transactions through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/vas/transactions Server secret key required. Scope: bills:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | One-based project history page. | | per_page | query | No | Maximum number of results per page. Maximum 100. | | status | query | No | Provider resource status, matched case-insensitively. | | created_after | query | No | Include operations created on or after this timestamp. | | created_before | query | No | Include operations created on or before this timestamp. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/vas/transactions?page=1&per_page=25" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/transactions?page=1&per_page=25`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/vas/transactions?page=1&per_page=25', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [], "meta": { "page": 1, "per_page": 25, "total": 0, "has_more": false } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | client_id | string | Optional | See the JSON example. | | service_category_id | string | Optional | See the JSON example. | | reference | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | id | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | > data is an array; meta contains page, per_page, total and has_more. These public API pagination fields use snake_case. ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Purchase Airtime Purchase Airtime through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/vas/pay/airtime Server secret key required. Scope: bills:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/vas/pay/airtime" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "service_category_id": "000000000000000000000001", "amount": 50000, "channel": "WEB", "phone_number": "+2348000000000" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/pay/airtime`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "service_category_id": "000000000000000000000001", "amount": 50000, "channel": "WEB", "phone_number": "+2348000000000" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "service_category_id": "000000000000000000000001", "amount": 50000, "channel": "WEB", "phone_number": "+2348000000000" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/vas/pay/airtime', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "service_category_id": "000000000000000000000001", "amount": 50000, "channel": "WEB", "phone_number": "+2348000000000" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | service_category_id | string | Required | The `_id` of the service category. | | amount | integer | Required | Amount in NGN minor units (kobo). Veyqo converts it to naira for SafeHaven. Minimum 1. | | channel | string | Required | The channel the purchase is made on Values: WEB, POS, ATM. | | debit_account_number | string | Optional | The account number for the account to be debited. | | phone_number | string | Required | The beneficiary phone number. | | external_reference | string | Optional | This is an external reference to be attached to the transaction object. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "client_id": "000000000000000000000001", "service_category_id": "000000000000000000000001", "reference": "order-1001", "status": "Created", "amount": 50000, "id": "000000000000000000000001", "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | client_id | string | Optional | See the JSON example. | | service_category_id | string | Optional | See the JSON example. | | reference | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | id | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Pay Utility Bill Pay Utility Bill through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/vas/pay/utility Server secret key required. Scope: bills:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/vas/pay/utility" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "service_category_id": "000000000000000000000001", "amount": 50000, "channel": "WEB", "meter_number": "example", "vend_type": "example" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/pay/utility`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "service_category_id": "000000000000000000000001", "amount": 50000, "channel": "WEB", "meter_number": "example", "vend_type": "example" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "service_category_id": "000000000000000000000001", "amount": 50000, "channel": "WEB", "meter_number": "example", "vend_type": "example" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/vas/pay/utility', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "service_category_id": "000000000000000000000001", "amount": 50000, "channel": "WEB", "meter_number": "example", "vend_type": "example" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | service_category_id | string | Required | The `_id` of the service category. | | amount | integer | Required | Amount in NGN minor units (kobo). Veyqo converts it to naira for SafeHaven. Minimum 1. | | channel | string | Required | The channel the purchase is made on Values: WEB, POS, ATM. | | debit_account_number | string | Optional | The account number for the account to be debited. | | meter_number | string | Required | The meter number of the utility account. | | vend_type | string | Required | The vendType is returned when you verify meter number | | external_reference | string | Optional | This is an external reference to be attached to the transaction object. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "client_id": "000000000000000000000001", "service_category_id": "000000000000000000000001", "reference": "order-1001", "status": "Created", "amount": 50000, "id": "000000000000000000000001", "utility_token": "example", "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | client_id | string | Optional | See the JSON example. | | service_category_id | string | Optional | See the JSON example. | | reference | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | id | string | Optional | See the JSON example. | | utility_token | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Purchase a Cable TV Subscription Purchase a Cable TV Subscription through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/vas/pay/cable-tv Server secret key required. Scope: bills:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/vas/pay/cable-tv" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "service_category_id": "000000000000000000000001", "bundle_code": "example", "amount": 50000, "channel": "WEB", "card_number": "example" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/pay/cable-tv`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "service_category_id": "000000000000000000000001", "bundle_code": "example", "amount": 50000, "channel": "WEB", "card_number": "example" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "service_category_id": "000000000000000000000001", "bundle_code": "example", "amount": 50000, "channel": "WEB", "card_number": "example" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/vas/pay/cable-tv', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "service_category_id": "000000000000000000000001", "bundle_code": "example", "amount": 50000, "channel": "WEB", "card_number": "example" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | service_category_id | string | Required | The `_id` of the service category. | | bundle_code | string | Required | The bundleCode of the data bundle. | | amount | integer | Required | Amount in NGN minor units (kobo). Veyqo converts it to naira for SafeHaven. Minimum 1. | | channel | string | Required | The channel the purchase is made on Values: WEB, POS, ATM. | | debit_account_number | string | Optional | The account number for the account to be debited. | | card_number | string | Required | The card number of the cable tv account. | | external_reference | string | Optional | This is an external reference to be attached to the transaction object. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "client_id": "000000000000000000000001", "service_category_id": "000000000000000000000001", "reference": "order-1001", "status": "Created", "amount": 50000, "id": "000000000000000000000001", "receiver": { "number": "example", "name": [], "customer_number": [], "distribution": "example", "vend_type": "example" }, "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | client_id | string | Optional | See the JSON example. | | service_category_id | string | Optional | See the JSON example. | | reference | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | id | string | Optional | See the JSON example. | | receiver | object | Optional | See the JSON example. | | receiver.number | string | Optional | See the JSON example. | | receiver.name | JSON | Optional | See the JSON example. | | receiver.customer_number | JSON | Optional | See the JSON example. | | receiver.distribution | string | Optional | See the JSON example. | | receiver.vend_type | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Verify Power/Cable TV data Verify Power/Cable TV data through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires bills:read. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/vas/verify Server secret key required. Scope: bills:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/vas/verify" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "service_category_id": "000000000000000000000001", "entity_number": "example" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/vas/verify`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "service_category_id": "000000000000000000000001", "entity_number": "example" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "service_category_id": "000000000000000000000001", "entity_number": "example" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/vas/verify', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "service_category_id": "000000000000000000000001", "entity_number": "example" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | service_category_id | string | Required | The `_id` of the service category. | | entity_number | string | Required | This is the Card number for cable tv and the Meter number for utility | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "disco_code": "example", "vend_type": "example", "meter_no": "example", "min_vend_amount": 0, "max_vend_amount": 0, "outstanding": 0, "debt_repayment": 0, "name": "example", "address": "example", "order_id": "000000000000000000000001" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | disco_code | string | Optional | See the JSON example. | | vend_type | string | Optional | See the JSON example. | | meter_no | string | Optional | See the JSON example. | | min_vend_amount | integer | Optional | Amount in NGN minor units (kobo). | | max_vend_amount | integer | Optional | Amount in NGN minor units (kobo). | | outstanding | integer | Optional | Amount in NGN minor units (kobo). | | debt_repayment | integer | Optional | Amount in NGN minor units (kobo). | | name | string | Optional | See the JSON example. | | address | string | Optional | See the JSON example. | | order_id | string | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create Account Create Account through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/accounts Server secret key required. Scope: accounts:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/accounts" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "account_type": "Savings", "suffix": "example" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/accounts`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "account_type": "Savings", "suffix": "example" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "account_type": "Savings", "suffix": "example" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/accounts', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "account_type": "Savings", "suffix": "example" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | account_type | string | Required | This is the type of account you wish to create. Values: Savings, Current. | | suffix | string | Required | This is the suffix to be added to the account name. | | metadata | object | Optional | Maximum 20 entries. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "can_debit": false, "can_credit": false, "_id": "000000000000000000000001", "client": "example", "account_product": "example", "account_number": "0000000000", "account_name": "example", "account_type": "example", "currency_code": "example", "bvn": "example", "account_balance": 0, "book_balance": 0, "interest_balance": 0, "with_holding_tax_balance": 0, "status": "Created", "is_default": false, "nominal_annual_interest_rate": 0, "interest_compounding_period": "example", "interest_posting_period": "example", "interest_calculation_type": "example", "interest_calculation_days_in_year_type": "example", "min_required_opening_balance": 0, "lockin_period_frequency": 0, "lockin_period_frequency_type": "example", "allow_overdraft": false, "overdraft_limit": 0, "charge_with_holding_tax": false, "charge_value_added_tax": false, "charge_stamp_duty": false, "notification_settings": { "sms_notification": false, "email_notification": false, "email_monthly_statement": false, "sms_monthly_statement": false }, "is_sub_account": false, "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0, "cba_account_id": "000000000000000000000001", "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | can_debit | boolean | Optional | See the JSON example. | | can_credit | boolean | Optional | See the JSON example. | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | account_product | string | Optional | See the JSON example. | | account_number | string | Optional | See the JSON example. | | account_name | string | Optional | See the JSON example. | | account_type | string | Optional | See the JSON example. | | currency_code | string | Optional | See the JSON example. | | bvn | string | Optional | See the JSON example. | | account_balance | integer | Optional | Amount in NGN minor units (kobo). | | book_balance | integer | Optional | Amount in NGN minor units (kobo). | | interest_balance | integer | Optional | Amount in NGN minor units (kobo). | | with_holding_tax_balance | integer | Optional | Amount in NGN minor units (kobo). | | status | string | Optional | See the JSON example. | | is_default | boolean | Optional | See the JSON example. | | nominal_annual_interest_rate | integer | Optional | See the JSON example. | | interest_compounding_period | string | Optional | See the JSON example. | | interest_posting_period | string | Optional | See the JSON example. | | interest_calculation_type | string | Optional | See the JSON example. | | interest_calculation_days_in_year_type | string | Optional | See the JSON example. | | min_required_opening_balance | integer | Optional | See the JSON example. | | lockin_period_frequency | integer | Optional | See the JSON example. | | lockin_period_frequency_type | string | Optional | See the JSON example. | | allow_overdraft | boolean | Optional | See the JSON example. | | overdraft_limit | integer | Optional | See the JSON example. | | charge_with_holding_tax | boolean | Optional | See the JSON example. | | charge_value_added_tax | boolean | Optional | See the JSON example. | | charge_stamp_duty | boolean | Optional | See the JSON example. | | notification_settings | object | Optional | See the JSON example. | | notification_settings.sms_notification | boolean | Optional | See the JSON example. | | notification_settings.email_notification | boolean | Optional | See the JSON example. | | notification_settings.email_monthly_statement | boolean | Optional | See the JSON example. | | notification_settings.sms_monthly_statement | boolean | Optional | See the JSON example. | | is_sub_account | boolean | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | cba_account_id | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Update Sub Account Update Sub Account through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:write. ## Endpoint PUT https://api.veyqo.org/api/v1/safehaven/subaccounts/{id} Server secret key required. Scope: accounts:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request PUT "https://api.veyqo.org/api/v1/safehaven/subaccounts/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/subaccounts/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'PUT', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'PUT', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('PUT', f'https://api.veyqo.org/api/v1/safehaven/subaccounts/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | phone_number | string | Required | This is the phone number of the account holder. It should begin with the country code. | | email_address | string | Required | This is the email address. | | external_reference | string | Required | This is an external reference to be attached to the account object. | | identity_type | string | Required | Identification method the account holder, should be either NIN, vNIN, BVN, BVNUSSD, or vID (if you are using Safe Haven Verification Service)). Values: NIN, vNIN, BVN, BVNUSSD, vID. | | identity_number | string | Optional | It is required when using `BVN`, `NIN`, and `BVNUSSD`. Not required if you are using `vID` | | identity_id | string | Optional | The `_id` from the Safe Haven Verification Endpoint. It is required when `vID`, `BVN`, or `NIN` | | otp | string | Optional | The OTP sent to the customer's phone number when you initiate verification using Safe Haven verification endpoint. This works for `BVN` and `NIN` or the OTP sent to customer's phone number when using | | metadata | object | Optional | Maximum 20 entries. | | auto_sweep | boolean | Optional | This should be set when creating a virtual account. It determines if auto sweep should be enabled or disabled. | | auto_sweep_details | object | Optional | This contains the auto sweep details to be filled if creating a virtual account. | | auto_sweep_details.schedule | string | Required | This is the schedule for the autosweep Values: Instant. | | auto_sweep_details.account_number | string | Required | This represents the account to auto sweep to. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create Sub Account (Corporate) Create Sub Account (Corporate) through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/subaccounts/corporate Server secret key required. Scope: accounts:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/subaccounts/corporate" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001", "company_registration_number": "example" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/subaccounts/corporate`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001", "company_registration_number": "example" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001", "company_registration_number": "example" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/subaccounts/corporate', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001", "company_registration_number": "example" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | phone_number | string | Required | This is the phone number of the account holder. It should begin with the country code. | | email_address | string | Required | This is the email address. | | external_reference | string | Required | This is an external reference to be attached to the account object. | | identity_type | string | Required | Identification method the account holder, should be vID (Provided you have Validated the KYC of at least one director of the company). Values: vID. | | identity_id | string | Required | The `_id` from the Safe Haven Verification Endpoint. | | company_registration_number | string | Required | The should be the company's RC or BN Number. | | auto_sweep | boolean | Optional | This should be set when creating a virtual account. It determines if auto sweep should be enabled or disabled. | | auto_sweep_details | object | Optional | This contains the auto sweep details to be filled if creating a virtual account. | | auto_sweep_details.schedule | string | Required | This is the schedule for the autosweep Values: Instant. | | auto_sweep_details.account_number | string | Required | This represents the account to auto sweep to. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client": "example", "account_product": "example", "account_number": "0000000000", "account_name": "example", "account_type": "example", "currency_code": "example", "bvn": "example", "identity_id": "000000000000000000000001", "account_balance": 0, "book_balance": 0, "callback_url": "https://example.com", "is_sub_account": false, "sub_account_details": { "_id": "000000000000000000000001", "first_name": "example", "last_name": "example", "email_address": "customer@example.com", "bvn": "example" }, "external_reference": "order-1001", "created_at": "example", "updated_at": "example", "nin": "example", "__v": 0, "cba_account_id": "000000000000000000000001", "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | account_product | string | Optional | See the JSON example. | | account_number | string | Optional | See the JSON example. | | account_name | string | Optional | See the JSON example. | | account_type | string | Optional | See the JSON example. | | currency_code | string | Optional | See the JSON example. | | bvn | string | Optional | See the JSON example. | | identity_id | string | Optional | See the JSON example. | | account_balance | integer | Optional | Amount in NGN minor units (kobo). | | book_balance | integer | Optional | Amount in NGN minor units (kobo). | | callback_url | string | Optional | See the JSON example. | | is_sub_account | boolean | Optional | See the JSON example. | | sub_account_details | object | Optional | See the JSON example. | | sub_account_details._id | string | Optional | See the JSON example. | | sub_account_details.first_name | string | Optional | See the JSON example. | | sub_account_details.last_name | string | Optional | See the JSON example. | | sub_account_details.email_address | string | Optional | See the JSON example. | | sub_account_details.bvn | string | Optional | See the JSON example. | | external_reference | string | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | nin | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | cba_account_id | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create Sub Account (Individual) Create Sub Account (Individual) through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/subaccounts/individual Server secret key required. Scope: accounts:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/subaccounts/individual" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/subaccounts/individual`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/subaccounts/individual', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "phone_number": "+2348000000000", "email_address": "customer@example.com", "external_reference": "order-1001", "identity_type": "vID", "identity_id": "000000000000000000000001" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | phone_number | string | Required | This is the phone number of the account holder. It should begin with the country code. | | email_address | string | Required | This is the email address. | | external_reference | string | Required | This is an external reference to be attached to the account object. | | identity_type | string | Required | Identification method the account holder, should be either NIN, vNIN, BVN, BVNUSSD, or vID (if you are using Safe Haven Verification Service)). Values: NIN, vNIN, BVN, BVNUSSD, vID. | | identity_number | string | Optional | It is required when using `BVN`, `NIN`, and `BVNUSSD`. Not required if you are using `vID` | | identity_id | string | Optional | The `_id` from the Safe Haven Verification Endpoint. It is required when `vID`, `BVN`, or `NIN` | | otp | string | Optional | The OTP sent to the customer's phone number when you initiate verification using Safe Haven verification endpoint. This works for `BVN` and `NIN` or the OTP sent to customer's phone number when using | | auto_sweep | boolean | Optional | This should be set when creating a virtual account. It determines if auto sweep should be enabled or disabled. | | auto_sweep_details | object | Optional | This contains the auto sweep details to be filled if creating a virtual account. | | auto_sweep_details.schedule | string | Required | This is the schedule for the autosweep Values: Instant. | | auto_sweep_details.account_number | string | Required | This represents the account to auto sweep to. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client": "example", "account_product": "example", "account_number": "0000000000", "account_name": "example", "account_type": "example", "currency_code": "example", "bvn": "example", "identity_id": "000000000000000000000001", "account_balance": 0, "book_balance": 0, "callback_url": "https://example.com", "is_sub_account": false, "sub_account_details": { "_id": "000000000000000000000001", "first_name": "example", "last_name": "example", "email_address": "customer@example.com", "bvn": "example" }, "external_reference": "order-1001", "created_at": "example", "updated_at": "example", "nin": "example", "__v": 0, "cba_account_id": "000000000000000000000001", "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | account_product | string | Optional | See the JSON example. | | account_number | string | Optional | See the JSON example. | | account_name | string | Optional | See the JSON example. | | account_type | string | Optional | See the JSON example. | | currency_code | string | Optional | See the JSON example. | | bvn | string | Optional | See the JSON example. | | identity_id | string | Optional | See the JSON example. | | account_balance | integer | Optional | Amount in NGN minor units (kobo). | | book_balance | integer | Optional | Amount in NGN minor units (kobo). | | callback_url | string | Optional | See the JSON example. | | is_sub_account | boolean | Optional | See the JSON example. | | sub_account_details | object | Optional | See the JSON example. | | sub_account_details._id | string | Optional | See the JSON example. | | sub_account_details.first_name | string | Optional | See the JSON example. | | sub_account_details.last_name | string | Optional | See the JSON example. | | sub_account_details.email_address | string | Optional | See the JSON example. | | sub_account_details.bvn | string | Optional | See the JSON example. | | external_reference | string | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | nin | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | cba_account_id | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create Virtual Account Create Virtual Account through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/virtual-accounts Server secret key required. Scope: accounts:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/virtual-accounts" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "amount_control": "Fixed", "amount": 50000 }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/virtual-accounts`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "amount_control": "Fixed", "amount": 50000 }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "amount_control": "Fixed", "amount": 50000 } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/virtual-accounts', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "amount_control": "Fixed", "amount": 50000 }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | valid_for | integer | Optional | Account validity time in seconds. Default `900` = 15 Mins Format: int32. | | settlement_account | object | Optional | Settlement account details | | settlement_account.bank_code | string | Optional | 6 digits bank code. Must be `090286` | | settlement_account.account_number | string | Optional | 10 digits NUBAN account number | | amount_control | string | Required | This is required if the account is only valid for a specified time. Values: Fixed, UnderPayment, OverPayment. | | amount | integer | Required | Amount in NGN minor units (kobo). Veyqo converts it to naira for SafeHaven. Minimum 1. | | external_reference | string | Optional | Unique per account. This will be returned on the transfer object | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client": "example", "bank_code": "090286", "account_number": "0000000000", "account_name": "example", "currency_code": "example", "bvn": "example", "valid_for": 0, "amount_control": "example", "amount": 50000, "expiry_date": "example", "callback_url": "https://example.com", "settlement_account": { "bank_code": "090286", "account_number": "0000000000" }, "status": "Created", "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0, "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | bank_code | string | Optional | See the JSON example. | | account_number | string | Optional | See the JSON example. | | account_name | string | Optional | See the JSON example. | | currency_code | string | Optional | See the JSON example. | | bvn | string | Optional | See the JSON example. | | valid_for | integer | Optional | See the JSON example. | | amount_control | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | expiry_date | string | Optional | See the JSON example. | | callback_url | string | Optional | See the JSON example. | | settlement_account | object | Optional | See the JSON example. | | settlement_account.bank_code | string | Optional | See the JSON example. | | settlement_account.account_number | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Delete Virtual Account Delete Virtual Account through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:write. ## Endpoint DELETE https://api.veyqo.org/api/v1/safehaven/virtual-accounts/{id} Server secret key required. Scope: accounts:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request DELETE "https://api.veyqo.org/api/v1/safehaven/virtual-accounts/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/virtual-accounts/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'DELETE', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'DELETE', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('DELETE', f'https://api.veyqo.org/api/v1/safehaven/virtual-accounts/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Account Statement Get Account Statement through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/accounts/{id}/statement Server secret key required. Scope: accounts:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | | page | query | No | This represents the position the results should begin from. 0 represents the first position. | | limit | query | No | This is the maximum number of accounts to be fetched for this request. Maximum 100. | | from_date | query | No | This is the start date of the period you wish to fetch the statement for. | | to_date | query | No | This is the end date of the period you wish to fetch the statement for. | | type | query | No | The type of transaction you wish to fetch for | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/accounts/$PROVIDER_RESOURCE_ID/statement?page=0&limit=100" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/accounts/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}/statement?page=0&limit=100`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/accounts/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}/statement?page=0&limit=100', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Account Get Account through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/accounts/{id} Server secret key required. Scope: accounts:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/accounts/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/accounts/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/accounts/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "can_debit": false, "can_credit": false, "_id": "000000000000000000000001", "client": "example", "account_product": "example", "account_number": "0000000000", "account_name": "example", "account_type": "example", "currency_code": "example", "bvn": "example", "account_balance": 0, "book_balance": 0, "interest_balance": 0, "with_holding_tax_balance": 0, "status": "Created", "is_default": false, "nominal_annual_interest_rate": 0, "interest_compounding_period": "example", "interest_posting_period": "example", "interest_calculation_type": "example", "interest_calculation_days_in_year_type": "example", "min_required_opening_balance": 0, "lockin_period_frequency": 0, "lockin_period_frequency_type": "example", "allow_overdraft": false, "overdraft_limit": 0, "charge_with_holding_tax": false, "charge_value_added_tax": false, "charge_stamp_duty": false, "notification_settings": { "sms_notification": false, "email_notification": false, "email_monthly_statement": false, "sms_monthly_statement": false }, "is_sub_account": false, "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0, "cba_account_id": "000000000000000000000001" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | can_debit | boolean | Optional | See the JSON example. | | can_credit | boolean | Optional | See the JSON example. | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | account_product | string | Optional | See the JSON example. | | account_number | string | Optional | See the JSON example. | | account_name | string | Optional | See the JSON example. | | account_type | string | Optional | See the JSON example. | | currency_code | string | Optional | See the JSON example. | | bvn | string | Optional | See the JSON example. | | account_balance | integer | Optional | Amount in NGN minor units (kobo). | | book_balance | integer | Optional | Amount in NGN minor units (kobo). | | interest_balance | integer | Optional | Amount in NGN minor units (kobo). | | with_holding_tax_balance | integer | Optional | Amount in NGN minor units (kobo). | | status | string | Optional | See the JSON example. | | is_default | boolean | Optional | See the JSON example. | | nominal_annual_interest_rate | integer | Optional | See the JSON example. | | interest_compounding_period | string | Optional | See the JSON example. | | interest_posting_period | string | Optional | See the JSON example. | | interest_calculation_type | string | Optional | See the JSON example. | | interest_calculation_days_in_year_type | string | Optional | See the JSON example. | | min_required_opening_balance | integer | Optional | See the JSON example. | | lockin_period_frequency | integer | Optional | See the JSON example. | | lockin_period_frequency_type | string | Optional | See the JSON example. | | allow_overdraft | boolean | Optional | See the JSON example. | | overdraft_limit | integer | Optional | See the JSON example. | | charge_with_holding_tax | boolean | Optional | See the JSON example. | | charge_value_added_tax | boolean | Optional | See the JSON example. | | charge_stamp_duty | boolean | Optional | See the JSON example. | | notification_settings | object | Optional | See the JSON example. | | notification_settings.sms_notification | boolean | Optional | See the JSON example. | | notification_settings.email_notification | boolean | Optional | See the JSON example. | | notification_settings.email_monthly_statement | boolean | Optional | See the JSON example. | | notification_settings.sms_monthly_statement | boolean | Optional | See the JSON example. | | is_sub_account | boolean | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | cba_account_id | string | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Accounts Get Accounts through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/accounts Server secret key required. Scope: accounts:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | page | query | No | This represents the position the results should begin from. 0 represents the first position. | | limit | query | No | This is the maximum number of accounts to be fetched for this request. Maximum 100. | | is_sub_account | query | No | Set it to `true` to fetch sub accounts and virtual accounts and `false` to fetch main accounts | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/accounts?page=0&limit=100&is_sub_account=0" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/accounts?page=0&limit=100&is_sub_account=0`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/accounts?page=0&limit=100&is_sub_account=0', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Virtual Account Get Virtual Account through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/virtual-accounts/{id} Server secret key required. Scope: accounts:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/virtual-accounts/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/virtual-accounts/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/virtual-accounts/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client": "example", "bank_code": "090286", "account_number": "0000000000", "account_name": "example", "currency_code": "example", "bvn": "example", "valid_for": 0, "amount_control": "example", "amount": 50000, "expiry_date": "example", "callback_url": "https://example.com", "settlement_account": { "bank_code": "090286", "account_number": "0000000000" }, "status": "Created", "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0 } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | bank_code | string | Optional | See the JSON example. | | account_number | string | Optional | See the JSON example. | | account_name | string | Optional | See the JSON example. | | currency_code | string | Optional | See the JSON example. | | bvn | string | Optional | See the JSON example. | | valid_for | integer | Optional | See the JSON example. | | amount_control | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | expiry_date | string | Optional | See the JSON example. | | callback_url | string | Optional | See the JSON example. | | settlement_account | object | Optional | See the JSON example. | | settlement_account.bank_code | string | Optional | See the JSON example. | | settlement_account.account_number | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Get Virtual Transaction Get Virtual Transaction through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/virtual-accounts/{id}/transaction Server secret key required. Scope: accounts:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/virtual-accounts/$PROVIDER_RESOURCE_ID/transaction" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/virtual-accounts/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}/transaction`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/virtual-accounts/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}/transaction', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client": "example", "virtual_account": { "_id": "000000000000000000000001", "client": "example", "bank_code": "090286", "account_number": "0000000000", "account_name": "example", "currency_code": "example", "bvn": "example", "valid_for": 0, "external_reference": "order-1001", "amount_control": "example", "amount": 50000, "expiry_date": "example", "callback_url": "https://example.com", "settlement_account": { "_id": "000000000000000000000001", "bank_code": "090286", "account_number": "0000000000" }, "status": "Created", "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0 }, "session_id": "000000000000000000000001", "name_enquiry_reference": "order-1001", "payment_reference": "order-1001", "is_reversed": false, "reversal_reference": "order-1001", "provider": "example", "provider_channel": "example", "provider_channel_code": "example", "destination_institution_code": "example", "credit_account_name": "example", "credit_account_number": "example", "credit_bank_verification_number": [], "credit_k_y_c_level": "example", "debit_account_name": "example", "debit_account_number": "example", "debit_bank_verification_number": [], "debit_k_y_c_level": "example", "transaction_location": "example", "narration": "example", "amount": 50000, "fees": 0, "vat": 0, "stamp_duty": 0, "response_code": "example", "response_message": "example", "status": "Created", "is_deleted": false, "created_at": "example", "declined_at": "example", "updated_at": "example", "__v": 0 } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | virtual_account | object | Optional | See the JSON example. | | virtual_account._id | string | Optional | See the JSON example. | | virtual_account.client | string | Optional | See the JSON example. | | virtual_account.bank_code | string | Optional | See the JSON example. | | virtual_account.account_number | string | Optional | See the JSON example. | | virtual_account.account_name | string | Optional | See the JSON example. | | virtual_account.currency_code | string | Optional | See the JSON example. | | virtual_account.bvn | string | Optional | See the JSON example. | | virtual_account.valid_for | integer | Optional | See the JSON example. | | virtual_account.external_reference | string | Optional | See the JSON example. | | virtual_account.amount_control | string | Optional | See the JSON example. | | virtual_account.amount | integer | Optional | Amount in NGN minor units (kobo). | | virtual_account.expiry_date | string | Optional | See the JSON example. | | virtual_account.callback_url | string | Optional | See the JSON example. | | virtual_account.settlement_account | object | Optional | See the JSON example. | | virtual_account.settlement_account._id | string | Optional | See the JSON example. | | virtual_account.settlement_account.bank_code | string | Optional | See the JSON example. | | virtual_account.settlement_account.account_number | string | Optional | See the JSON example. | | virtual_account.status | string | Optional | See the JSON example. | | virtual_account.is_deleted | boolean | Optional | See the JSON example. | | virtual_account.created_at | string | Optional | See the JSON example. | | virtual_account.updated_at | string | Optional | See the JSON example. | | virtual_account.__v | integer | Optional | See the JSON example. | | session_id | string | Optional | See the JSON example. | | name_enquiry_reference | string | Optional | See the JSON example. | | payment_reference | string | Optional | See the JSON example. | | is_reversed | boolean | Optional | See the JSON example. | | reversal_reference | string | Optional | See the JSON example. | | provider | string | Optional | See the JSON example. | | provider_channel | string | Optional | See the JSON example. | | provider_channel_code | string | Optional | See the JSON example. | | destination_institution_code | string | Optional | See the JSON example. | | credit_account_name | string | Optional | See the JSON example. | | credit_account_number | string | Optional | See the JSON example. | | credit_bank_verification_number | JSON | Optional | See the JSON example. | | credit_k_y_c_level | string | Optional | See the JSON example. | | debit_account_name | string | Optional | See the JSON example. | | debit_account_number | string | Optional | See the JSON example. | | debit_bank_verification_number | JSON | Optional | See the JSON example. | | debit_k_y_c_level | string | Optional | See the JSON example. | | transaction_location | string | Optional | See the JSON example. | | narration | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | fees | integer | Optional | Amount in NGN minor units (kobo). | | vat | integer | Optional | Amount in NGN minor units (kobo). | | stamp_duty | integer | Optional | Amount in NGN minor units (kobo). | | response_code | string | Optional | See the JSON example. | | response_message | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | declined_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Update Account Update Account through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:write. ## Endpoint PUT https://api.veyqo.org/api/v1/safehaven/accounts/{id} Server secret key required. Scope: accounts:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request PUT "https://api.veyqo.org/api/v1/safehaven/accounts/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '[]' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/accounts/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'PUT', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify([]), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'PUT', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' [] JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('PUT', f'https://api.veyqo.org/api/v1/safehaven/accounts/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json=[], timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | notification_settings | object | Optional | See the JSON example. | | notification_settings.sms_notification | boolean | Required | Set to `true` to enable SMS notification | | notification_settings.email_notification | boolean | Required | Set to `true` to enable email notification. | | notification_settings.email_monthly_statement | boolean | Required | Set to `true` to enable email monthly statement. | | notification_settings.sms_monthly_statement | boolean | Required | Set to `true` to enable sms monthly statement. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "can_debit": false, "can_credit": false, "_id": "000000000000000000000001", "client": "example", "account_product": "example", "account_number": "0000000000", "account_name": "example", "account_type": "example", "currency_code": "example", "bvn": "example", "account_balance": 0, "book_balance": 0, "interest_balance": 0, "with_holding_tax_balance": 0, "status": "Created", "is_default": false, "nominal_annual_interest_rate": 0, "interest_compounding_period": "example", "interest_posting_period": "example", "interest_calculation_type": "example", "interest_calculation_days_in_year_type": "example", "min_required_opening_balance": 0, "lockin_period_frequency": 0, "lockin_period_frequency_type": "example", "allow_overdraft": false, "overdraft_limit": 0, "charge_with_holding_tax": false, "charge_value_added_tax": false, "charge_stamp_duty": false, "notification_settings": { "sms_notification": false, "email_notification": false, "email_monthly_statement": false, "sms_monthly_statement": false }, "is_sub_account": false, "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0, "cba_account_id": "000000000000000000000001", "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | can_debit | boolean | Optional | See the JSON example. | | can_credit | boolean | Optional | See the JSON example. | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | account_product | string | Optional | See the JSON example. | | account_number | string | Optional | See the JSON example. | | account_name | string | Optional | See the JSON example. | | account_type | string | Optional | See the JSON example. | | currency_code | string | Optional | See the JSON example. | | bvn | string | Optional | See the JSON example. | | account_balance | integer | Optional | Amount in NGN minor units (kobo). | | book_balance | integer | Optional | Amount in NGN minor units (kobo). | | interest_balance | integer | Optional | Amount in NGN minor units (kobo). | | with_holding_tax_balance | integer | Optional | Amount in NGN minor units (kobo). | | status | string | Optional | See the JSON example. | | is_default | boolean | Optional | See the JSON example. | | nominal_annual_interest_rate | integer | Optional | See the JSON example. | | interest_compounding_period | string | Optional | See the JSON example. | | interest_posting_period | string | Optional | See the JSON example. | | interest_calculation_type | string | Optional | See the JSON example. | | interest_calculation_days_in_year_type | string | Optional | See the JSON example. | | min_required_opening_balance | integer | Optional | See the JSON example. | | lockin_period_frequency | integer | Optional | See the JSON example. | | lockin_period_frequency_type | string | Optional | See the JSON example. | | allow_overdraft | boolean | Optional | See the JSON example. | | overdraft_limit | integer | Optional | See the JSON example. | | charge_with_holding_tax | boolean | Optional | See the JSON example. | | charge_value_added_tax | boolean | Optional | See the JSON example. | | charge_stamp_duty | boolean | Optional | See the JSON example. | | notification_settings | object | Optional | See the JSON example. | | notification_settings.sms_notification | boolean | Optional | See the JSON example. | | notification_settings.email_notification | boolean | Optional | See the JSON example. | | notification_settings.email_monthly_statement | boolean | Optional | See the JSON example. | | notification_settings.sms_monthly_statement | boolean | Optional | See the JSON example. | | is_sub_account | boolean | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | cba_account_id | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Update Virtual Account Update Virtual Account through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:write. ## Endpoint PUT https://api.veyqo.org/api/v1/safehaven/virtual-accounts/{id} Server secret key required. Scope: accounts:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request PUT "https://api.veyqo.org/api/v1/safehaven/virtual-accounts/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '[]' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/virtual-accounts/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'PUT', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify([]), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'PUT', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' [] JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('PUT', f'https://api.veyqo.org/api/v1/safehaven/virtual-accounts/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json=[], timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Virtual Account Transfer Status Virtual Account Transfer Status through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires accounts:read. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/virtual-accounts/status Server secret key required. Scope: accounts:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/virtual-accounts/status" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "session_id": "000000000000000000000001" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/virtual-accounts/status`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "session_id": "000000000000000000000001" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "session_id": "000000000000000000000001" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/virtual-accounts/status', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "session_id": "000000000000000000000001" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | session_id | string | Required | See the JSON example. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client": "example", "virtual_account": { "_id": "000000000000000000000001", "client": "example", "bank_code": "090286", "account_number": "0000000000", "account_name": "example", "currency_code": "example", "bvn": "example", "valid_for": 0, "external_reference": "order-1001", "amount_control": "example", "amount": 50000, "expiry_date": "example", "callback_url": "https://example.com", "settlement_account": { "_id": "000000000000000000000001", "bank_code": "090286", "account_number": "0000000000" }, "status": "Created", "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0 }, "session_id": "000000000000000000000001", "name_enquiry_reference": "order-1001", "payment_reference": "order-1001", "is_reversed": false, "reversal_reference": "order-1001", "provider": "example", "provider_channel": "example", "provider_channel_code": "example", "destination_institution_code": "example", "credit_account_name": "example", "credit_account_number": "example", "credit_bank_verification_number": [], "credit_k_y_c_level": "example", "debit_account_name": "example", "debit_account_number": "example", "debit_bank_verification_number": [], "debit_k_y_c_level": "example", "transaction_location": "example", "narration": "example", "amount": 50000, "fees": 0, "vat": 0, "stamp_duty": 0, "response_code": "example", "response_message": "example", "status": "Created", "is_deleted": false, "created_at": "example", "declined_at": "example", "updated_at": "example", "__v": 0 } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client | string | Optional | See the JSON example. | | virtual_account | object | Optional | See the JSON example. | | virtual_account._id | string | Optional | See the JSON example. | | virtual_account.client | string | Optional | See the JSON example. | | virtual_account.bank_code | string | Optional | See the JSON example. | | virtual_account.account_number | string | Optional | See the JSON example. | | virtual_account.account_name | string | Optional | See the JSON example. | | virtual_account.currency_code | string | Optional | See the JSON example. | | virtual_account.bvn | string | Optional | See the JSON example. | | virtual_account.valid_for | integer | Optional | See the JSON example. | | virtual_account.external_reference | string | Optional | See the JSON example. | | virtual_account.amount_control | string | Optional | See the JSON example. | | virtual_account.amount | integer | Optional | Amount in NGN minor units (kobo). | | virtual_account.expiry_date | string | Optional | See the JSON example. | | virtual_account.callback_url | string | Optional | See the JSON example. | | virtual_account.settlement_account | object | Optional | See the JSON example. | | virtual_account.settlement_account._id | string | Optional | See the JSON example. | | virtual_account.settlement_account.bank_code | string | Optional | See the JSON example. | | virtual_account.settlement_account.account_number | string | Optional | See the JSON example. | | virtual_account.status | string | Optional | See the JSON example. | | virtual_account.is_deleted | boolean | Optional | See the JSON example. | | virtual_account.created_at | string | Optional | See the JSON example. | | virtual_account.updated_at | string | Optional | See the JSON example. | | virtual_account.__v | integer | Optional | See the JSON example. | | session_id | string | Optional | See the JSON example. | | name_enquiry_reference | string | Optional | See the JSON example. | | payment_reference | string | Optional | See the JSON example. | | is_reversed | boolean | Optional | See the JSON example. | | reversal_reference | string | Optional | See the JSON example. | | provider | string | Optional | See the JSON example. | | provider_channel | string | Optional | See the JSON example. | | provider_channel_code | string | Optional | See the JSON example. | | destination_institution_code | string | Optional | See the JSON example. | | credit_account_name | string | Optional | See the JSON example. | | credit_account_number | string | Optional | See the JSON example. | | credit_bank_verification_number | JSON | Optional | See the JSON example. | | credit_k_y_c_level | string | Optional | See the JSON example. | | debit_account_name | string | Optional | See the JSON example. | | debit_account_number | string | Optional | See the JSON example. | | debit_bank_verification_number | JSON | Optional | See the JSON example. | | debit_k_y_c_level | string | Optional | See the JSON example. | | transaction_location | string | Optional | See the JSON example. | | narration | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | fees | integer | Optional | Amount in NGN minor units (kobo). | | vat | integer | Optional | Amount in NGN minor units (kobo). | | stamp_duty | integer | Optional | Amount in NGN minor units (kobo). | | response_code | string | Optional | See the JSON example. | | response_message | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | declined_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Import existing sub-accounts Bring sub-accounts created directly with SafeHaven (before you used Veyqo) under this project environment, so their deposits are forwarded as provider_service.updated events and they can be read, debited and used for statements through Veyqo. Each account is re-read from SafeHaven with this connection's credentials. Requires accounts:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/accounts/import Server secret key required. Scope: accounts:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/accounts/import" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/accounts/import`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/accounts/import', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | accounts | array | Required | Up to 100 accounts per request. Give account_id (SafeHaven internal _id, fastest) or the ten-digit account_number. | | accounts[].account_id | string | Optional | See the JSON example. | | accounts[].account_number | string | Optional | See the JSON example. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "imported": [ { "account_id": "64f1c2e9a1b2c3d4e5f60789", "account_number": "5011722956", "account_name": "Ada Obi", "status": "imported" }, { "account_id": "64f1c2e9a1b2c3d4e5f6078a", "account_number": "5011722957", "account_name": "Bayo Ade", "status": "already_imported" } ], "failed": [] } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | imported | array | Required | See the JSON example. | | imported[].account_id | string | Required | See the JSON example. | | imported[].account_number | string | Required | See the JSON example. | | imported[].account_name | string \| null | Optional | See the JSON example. | | imported[].status | string | Required | Values: imported, already_imported. | | failed | array | Required | See the JSON example. | | failed[].account_id | string | Optional | See the JSON example. | | failed[].account_number | string | Optional | See the JSON example. | | failed[].reason | string | Required | Values: not_found, mismatch, not_a_subaccount, main_account, owned_elsewhere. | | failed[].message | string | Required | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create Reference Create Reference through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires payments:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/ussd-payment Server secret key required. Scope: payments:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/ussd-payment" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "amount": 50000, "merchant_name": "example", "ussd_bank_code": "090286" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/ussd-payment`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "amount": 50000, "merchant_name": "example", "ussd_bank_code": "090286" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "amount": 50000, "merchant_name": "example", "ussd_bank_code": "090286" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/ussd-payment', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "amount": 50000, "merchant_name": "example", "ussd_bank_code": "090286" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | amount | integer | Required | Amount in NGN minor units (kobo). Veyqo converts it to naira for SafeHaven. Minimum 1. | | merchant_name | string | Required | See the JSON example. | | ussd_bank_code | string | Required | See the JSON example. | | settlement_account | object | Optional | See the JSON example. | | settlement_account.bank_code | string | Optional | 6 digits bank code. Must be `090286` | | settlement_account.account_number | string | Optional | 10 digits NUBAN account number | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client": { "search_paid": false, "sub_account_creation": false, "long_term_virtual_account": false, "override_sub_account_limit": false, "allow_debit_account_info": false, "allow_debit_account_name": false, "indemnity_signed": false, "_id": "000000000000000000000001", "type": "example", "kyc_level": "example", "full_name": "example", "gender": "example", "date_of_birth": [], "email_address": "customer@example.com", "phone_number": "+2348000000000", "phone_number2": "+2348000000000", "bvn": "example", "nin": "example", "tin": "example", "contact_address": { "street": "example", "city": "example", "state": "example", "country": "example" }, "identification_details": { "status": "Created", "type": "example", "number": "example" }, "notification_settings": { "login_notification": false, "newsletter": false, "product_notification": false, "vas_notification": false, "webhook_notifcation": { "url": "https://example.com", "enabled": false } }, "sub_account_prefix": "example", "is_blocked": false, "status": "Created", "referees": [], "is_deleted": false, "created_at": "example", "updated_at": "example", "identity_status": [], "__v": 0, "cba_client_id": "000000000000000000000001", "contract": "example", "virtual_account_limit": { "daily_limit": 0, "single_transaction_limit": 0, "allow_other_prefix": "example" }, "documents": { "passport_url": "https://example.com", "id_card_url": "https://example.com", "signature_url": "https://example.com", "certificate_url": "https://example.com", "memat_url": "https://example.com", "board_resolution_url": "https://example.com", "utility_bill_url": "https://example.com" }, "employment_information": [], "next_of_kin": [] }, "account": { "can_debit": false, "can_credit": false, "_id": "000000000000000000000001", "client": "example", "account_product": "example", "account_number": "0000000000", "account_name": "example", "account_type": "example", "currency_code": "example", "bvn": "example", "account_balance": 0, "book_balance": 0, "interest_balance": 0, "with_holding_tax_balance": 0, "status": "Created", "is_default": false, "nominal_annual_interest_rate": 0, "interest_compounding_period": "example", "interest_posting_period": "example", "interest_calculation_type": "example", "interest_calculation_days_in_year_type": "example", "min_required_opening_balance": 0, "lockin_period_frequency": 0, "lockin_period_frequency_type": "example", "allow_overdraft": false, "overdraft_limit": 0, "charge_with_holding_tax": false, "charge_value_added_tax": false, "charge_stamp_duty": false, "notification_settings": { "sms_notification": false, "email_notification": false, "email_monthly_statement": false, "sms_monthly_statement": false }, "is_sub_account": false, "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0, "cba_account_id": "000000000000000000000001" }, "bank_code": "090286", "account_name": "example", "amount": 50000, "callback_url": "https://example.com", "status": "Created", "fees": 0, "settlement_account": { "bank_code": "090286", "account_number": "0000000000" }, "external_reference": "order-1001", "is_deleted": false, "created_at": "example", "updated_at": "example", "__v": 0, "account_number": "0000000000", "details": { "reference": "order-1001", "amount": 50000, "transaction_id": "000000000000000000000001", "trace_id": "000000000000000000000001", "ussd_string": "example", "time_stamp": 0, "signature": "example" }, "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client | object | Optional | See the JSON example. | | client.search_paid | boolean | Optional | See the JSON example. | | client.sub_account_creation | boolean | Optional | See the JSON example. | | client.long_term_virtual_account | boolean | Optional | See the JSON example. | | client.override_sub_account_limit | boolean | Optional | See the JSON example. | | client.allow_debit_account_info | boolean | Optional | See the JSON example. | | client.allow_debit_account_name | boolean | Optional | See the JSON example. | | client.indemnity_signed | boolean | Optional | See the JSON example. | | client._id | string | Optional | See the JSON example. | | client.type | string | Optional | See the JSON example. | | client.kyc_level | string | Optional | See the JSON example. | | client.full_name | string | Optional | See the JSON example. | | client.gender | string | Optional | See the JSON example. | | client.date_of_birth | JSON | Optional | See the JSON example. | | client.email_address | string | Optional | See the JSON example. | | client.phone_number | string | Optional | See the JSON example. | | client.phone_number2 | string | Optional | See the JSON example. | | client.bvn | string | Optional | See the JSON example. | | client.nin | string | Optional | See the JSON example. | | client.tin | string | Optional | See the JSON example. | | client.contact_address | object | Optional | See the JSON example. | | client.contact_address.street | string | Optional | See the JSON example. | | client.contact_address.city | string | Optional | See the JSON example. | | client.contact_address.state | string | Optional | See the JSON example. | | client.contact_address.country | string | Optional | See the JSON example. | | client.identification_details | object | Optional | See the JSON example. | | client.identification_details.status | string | Optional | See the JSON example. | | client.identification_details.type | string | Optional | See the JSON example. | | client.identification_details.number | string | Optional | See the JSON example. | | client.notification_settings | object | Optional | See the JSON example. | | client.notification_settings.login_notification | boolean | Optional | See the JSON example. | | client.notification_settings.newsletter | boolean | Optional | See the JSON example. | | client.notification_settings.product_notification | boolean | Optional | See the JSON example. | | client.notification_settings.vas_notification | boolean | Optional | See the JSON example. | | client.notification_settings.webhook_notifcation | object | Optional | See the JSON example. | | client.sub_account_prefix | string | Optional | See the JSON example. | | client.is_blocked | boolean | Optional | See the JSON example. | | client.status | string | Optional | See the JSON example. | | client.referees | array | Optional | See the JSON example. | | client.is_deleted | boolean | Optional | See the JSON example. | | client.created_at | string | Optional | See the JSON example. | | client.updated_at | string | Optional | See the JSON example. | | client.identity_status | array | Optional | See the JSON example. | | client.__v | integer | Optional | See the JSON example. | | client.cba_client_id | string | Optional | See the JSON example. | | client.contract | string | Optional | See the JSON example. | | client.virtual_account_limit | object | Optional | See the JSON example. | | client.virtual_account_limit.daily_limit | integer | Optional | See the JSON example. | | client.virtual_account_limit.single_transaction_limit | integer | Optional | See the JSON example. | | client.virtual_account_limit.allow_other_prefix | string | Optional | See the JSON example. | | client.documents | object | Optional | See the JSON example. | | client.documents.passport_url | string | Optional | See the JSON example. | | client.documents.id_card_url | string | Optional | See the JSON example. | | client.documents.signature_url | string | Optional | See the JSON example. | | client.documents.certificate_url | string | Optional | See the JSON example. | | client.documents.memat_url | string | Optional | See the JSON example. | | client.documents.board_resolution_url | string | Optional | See the JSON example. | | client.documents.utility_bill_url | string | Optional | See the JSON example. | | client.employment_information | object | Optional | See the JSON example. | | client.next_of_kin | object | Optional | See the JSON example. | | account | object | Optional | See the JSON example. | | account.can_debit | boolean | Optional | See the JSON example. | | account.can_credit | boolean | Optional | See the JSON example. | | account._id | string | Optional | See the JSON example. | | account.client | string | Optional | See the JSON example. | | account.account_product | string | Optional | See the JSON example. | | account.account_number | string | Optional | See the JSON example. | | account.account_name | string | Optional | See the JSON example. | | account.account_type | string | Optional | See the JSON example. | | account.currency_code | string | Optional | See the JSON example. | | account.bvn | string | Optional | See the JSON example. | | account.account_balance | integer | Optional | Amount in NGN minor units (kobo). | | account.book_balance | integer | Optional | Amount in NGN minor units (kobo). | | account.interest_balance | integer | Optional | Amount in NGN minor units (kobo). | | account.with_holding_tax_balance | integer | Optional | Amount in NGN minor units (kobo). | | account.status | string | Optional | See the JSON example. | | account.is_default | boolean | Optional | See the JSON example. | | account.nominal_annual_interest_rate | integer | Optional | See the JSON example. | | account.interest_compounding_period | string | Optional | See the JSON example. | | account.interest_posting_period | string | Optional | See the JSON example. | | account.interest_calculation_type | string | Optional | See the JSON example. | | account.interest_calculation_days_in_year_type | string | Optional | See the JSON example. | | account.min_required_opening_balance | integer | Optional | See the JSON example. | | account.lockin_period_frequency | integer | Optional | See the JSON example. | | account.lockin_period_frequency_type | string | Optional | See the JSON example. | | account.allow_overdraft | boolean | Optional | See the JSON example. | | account.overdraft_limit | integer | Optional | See the JSON example. | | account.charge_with_holding_tax | boolean | Optional | See the JSON example. | | account.charge_value_added_tax | boolean | Optional | See the JSON example. | | account.charge_stamp_duty | boolean | Optional | See the JSON example. | | account.notification_settings | object | Optional | See the JSON example. | | account.notification_settings.sms_notification | boolean | Optional | See the JSON example. | | account.notification_settings.email_notification | boolean | Optional | See the JSON example. | | account.notification_settings.email_monthly_statement | boolean | Optional | See the JSON example. | | account.notification_settings.sms_monthly_statement | boolean | Optional | See the JSON example. | | account.is_sub_account | boolean | Optional | See the JSON example. | | account.is_deleted | boolean | Optional | See the JSON example. | | account.created_at | string | Optional | See the JSON example. | | account.updated_at | string | Optional | See the JSON example. | | account.__v | integer | Optional | See the JSON example. | | account.cba_account_id | string | Optional | See the JSON example. | | bank_code | string | Optional | See the JSON example. | | account_name | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | callback_url | string | Optional | See the JSON example. | | status | string | Optional | See the JSON example. | | fees | integer | Optional | Amount in NGN minor units (kobo). | | settlement_account | object | Optional | See the JSON example. | | settlement_account.bank_code | string | Optional | See the JSON example. | | settlement_account.account_number | string | Optional | See the JSON example. | | external_reference | string | Optional | See the JSON example. | | is_deleted | boolean | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | account_number | string | Optional | See the JSON example. | | details | object | Optional | See the JSON example. | | details.reference | string | Optional | See the JSON example. | | details.amount | integer | Optional | Amount in NGN minor units (kobo). | | details.transaction_id | string | Optional | See the JSON example. | | details.trace_id | string | Optional | See the JSON example. | | details.ussd_string | string | Optional | See the JSON example. | | details.time_stamp | integer | Optional | See the JSON example. | | details.signature | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # USSD Banks List USSD Banks List through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires payments:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/ussd-payment/banks Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/ussd-payment/banks" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/ussd-payment/banks`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/ussd-payment/banks', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | [].bank_name | string | Optional | See the JSON example. | | [].ussd | string | Optional | See the JSON example. | | [].ussd_string | string | Optional | See the JSON example. | | [].url | string | Optional | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Verify Checkout Transaction Verify Checkout Transaction through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires payments:read. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/checkout/{id}/verify Server secret key required. Scope: payments:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/checkout/$PROVIDER_RESOURCE_ID/verify" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/checkout/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}/verify`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/checkout/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}/verify', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": [] } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Validate Verification Validate Verification through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires identity:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/identity/validate Server secret key required. Scope: identity:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/identity/validate" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "identity_id": "000000000000000000000001", "type": "BVN", "otp": "example" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/identity/validate`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "identity_id": "000000000000000000000001", "type": "BVN", "otp": "example" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "identity_id": "000000000000000000000001", "type": "BVN", "otp": "example" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/identity/validate', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "identity_id": "000000000000000000000001", "type": "BVN", "otp": "example" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | identity_id | string | Required | The `_id` you captured from the initial request. | | type | string | Required | Specify the type of verification (either BVN or NIN). Values: BVN, NIN. | | otp | string | Required | The OTP that was sent to the customer’s phone number. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client_id": "000000000000000000000001", "identity_number": "example", "type": "example", "amount": 50000, "status": "Created", "debit_account_number": "example", "vat": 0, "stamp_duty": 0, "is_deleted": false, "otp_verified": false, "otp_resend_count": 0, "created_at": "example", "updated_at": "example", "__v": 0, "debit_message": "example", "debit_respons_code": 0, "debit_session_id": "000000000000000000000001", "otp_id": "000000000000000000000001", "provider_response": { "bvn": "example", "full_name": "example", "first_name": "example", "middle_name": "example", "last_name": "example", "date_of_birth": "example", "phone_number1": "+2348000000000", "phone_number2": "+2348000000000", "gender": "example", "enrollment_bank": "example", "enrollment_branch": "example", "email": "customer@example.com", "lga_of_origin": "example", "lga_of_residence": "example", "marital_status": "example", "nin": "example", "nationality": "example", "residential_address": "example", "state_of_origin": "example", "state_of_residence": "example", "title": "example", "watch_listed": "example", "level_of_account": "example", "registration_date": [], "image_base64": "example" }, "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client_id | string | Optional | See the JSON example. | | identity_number | string | Optional | See the JSON example. | | type | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | status | string | Optional | See the JSON example. | | debit_account_number | string | Optional | See the JSON example. | | vat | integer | Optional | Amount in NGN minor units (kobo). | | stamp_duty | integer | Optional | Amount in NGN minor units (kobo). | | is_deleted | boolean | Optional | See the JSON example. | | otp_verified | boolean | Optional | See the JSON example. | | otp_resend_count | integer | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | debit_message | string | Optional | See the JSON example. | | debit_respons_code | integer | Optional | See the JSON example. | | debit_session_id | string | Optional | See the JSON example. | | otp_id | string | Optional | See the JSON example. | | provider_response | object | Optional | See the JSON example. | | provider_response.bvn | string | Optional | See the JSON example. | | provider_response.full_name | string | Optional | See the JSON example. | | provider_response.first_name | string | Optional | See the JSON example. | | provider_response.middle_name | string | Optional | See the JSON example. | | provider_response.last_name | string | Optional | See the JSON example. | | provider_response.date_of_birth | string | Optional | See the JSON example. | | provider_response.phone_number1 | string | Optional | See the JSON example. | | provider_response.phone_number2 | string | Optional | See the JSON example. | | provider_response.gender | string | Optional | See the JSON example. | | provider_response.enrollment_bank | string | Optional | See the JSON example. | | provider_response.enrollment_branch | string | Optional | See the JSON example. | | provider_response.email | string | Optional | See the JSON example. | | provider_response.lga_of_origin | string | Optional | See the JSON example. | | provider_response.lga_of_residence | string | Optional | See the JSON example. | | provider_response.marital_status | string | Optional | See the JSON example. | | provider_response.nin | string | Optional | See the JSON example. | | provider_response.nationality | string | Optional | See the JSON example. | | provider_response.residential_address | string | Optional | See the JSON example. | | provider_response.state_of_origin | string | Optional | See the JSON example. | | provider_response.state_of_residence | string | Optional | See the JSON example. | | provider_response.title | string | Optional | See the JSON example. | | provider_response.watch_listed | string | Optional | See the JSON example. | | provider_response.level_of_account | string | Optional | See the JSON example. | | provider_response.registration_date | JSON | Optional | See the JSON example. | | provider_response.image_base64 | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Initiate Verification Initiate Verification through this project environment’s SafeHaven account. Uses snake_case fields and NGN minor units. Requires identity:write. ## Endpoint POST https://api.veyqo.org/api/v1/safehaven/identity Server secret key required. Scope: identity:write. The key determines the project and environment; no project-selection header is accepted. > For each new operation, generate and persist one OPERATION_IDEMPOTENCY_KEY. Retry the unchanged request with that same key. Do not generate a new key on every retry. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/api/v1/safehaven/identity" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" \ --header "Idempotency-Key: $OPERATION_IDEMPOTENCY_KEY" \ --header "Content-Type: application/json" \ --data '{ "type": "BVN", "number": "example", "async": false }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/identity`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json", "Idempotency-Key": operation.idempotencyKey, "Content-Type": "application/json" }, body: JSON.stringify({ "type": "BVN", "number": "example", "async": false }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json', 'Idempotency-Key: '.$operationIdempotencyKey, 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "type": "BVN", "number": "example", "async": false } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/api/v1/safehaven/identity', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json", "Idempotency-Key": operation_idempotency_key, "Content-Type": "application/json" }, json={ "type": "BVN", "number": "example", "async": False }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | type | string | Required | Values: BVN, NIN. | | number | string | Required | See the JSON example. | | debit_account_number | string | Optional | The account number for the account to be debited. | | async | boolean | Required | See the JSON example. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "_id": "000000000000000000000001", "client_id": "000000000000000000000001", "identity_number": "example", "type": "example", "amount": 50000, "status": "Created", "debit_account_number": "example", "vat": 0, "stamp_duty": 0, "is_deleted": false, "otp_verified": false, "otp_resend_count": 0, "created_at": "example", "updated_at": "example", "__v": 0, "debit_message": "example", "debit_respons_code": 0, "debit_session_id": "000000000000000000000001", "otp_id": "000000000000000000000001", "provider_response": "example", "operation_id": "pso_01M6EB66SC61Q3RQYAN0693DGM" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | _id | string | Optional | See the JSON example. | | client_id | string | Optional | See the JSON example. | | identity_number | string | Optional | See the JSON example. | | type | string | Optional | See the JSON example. | | amount | integer | Optional | Amount in NGN minor units (kobo). | | status | string | Optional | See the JSON example. | | debit_account_number | string | Optional | See the JSON example. | | vat | integer | Optional | Amount in NGN minor units (kobo). | | stamp_duty | integer | Optional | Amount in NGN minor units (kobo). | | is_deleted | boolean | Optional | See the JSON example. | | otp_verified | boolean | Optional | See the JSON example. | | otp_resend_count | integer | Optional | See the JSON example. | | created_at | string | Optional | See the JSON example. | | updated_at | string | Optional | See the JSON example. | | __v | integer | Optional | See the JSON example. | | debit_message | string | Optional | See the JSON example. | | debit_respons_code | integer | Optional | See the JSON example. | | debit_session_id | string | Optional | See the JSON example. | | otp_id | string | Optional | See the JSON example. | | provider_response | string | Optional | See the JSON example. | | operation_id | string | Optional | Veyqo pso_ operation ID. Save it to reconcile retries and match provider_service.updated events. | | merchant_reference | string | Optional | Your external_reference or payment_reference, if supplied. SafeHaven receives a globally unique Veyqo reference for supported writes. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_NOT_CONNECTED | 422 | Connect a provider, choose the project default, or explicitly pass provider. An account shared with another project still needs its own assignment here. | After configuration changes. | | PROVIDER_AUTHENTICATION_FAILED | 502 | The merchant must check/rotate the provider credentials in the dashboard. Do not expose those secrets to your application users. | After credential correction; reconcile existing payment first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | IDEMPOTENCY_KEY_REUSED | 409 | Reuse the exact original request to recover that operation, or use a new key only for a genuinely different operation. | Do not retry a changed body with that key. | | IDEMPOTENCY_IN_PROGRESS | 409 | Wait briefly, retry with the same key and unchanged request, then reconcile by reference if the result remains uncertain. | Back off with jitter; preserve key/body. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Look up operation by idempotency key Retrieve or reconcile a SafeHaven write in this project environment. Requires events:read and the read scope for the original service. A returned resource can still be pending or failed. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/operations Server secret key required. Scope: events:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | idempotency_key | query | Yes | The persisted Idempotency-Key used for the write. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/operations?idempotency_key=persisted-operation-key" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/operations?idempotency_key=persisted-operation-key`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/operations?idempotency_key=persisted-operation-key', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "pso_01M6EB66SC61Q3RQYAN0693DGM", "operation": "transfer", "status": "unknown", "resource": null, "provider_reference": "pso_01M6EB66SC61Q3RQYAN0693DGM", "created_at": "2026-11-02T12:00:00Z" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Veyqo pso_ operation ID. Also used as the globally unique upstream reference where supported. | | operation | string | Required | See the JSON example. | | status | string | Required | Operation execution status, not proof of settled funds. succeeded means a response was received; inspect resource.status. Values: pending, succeeded, unknown, failed. | | resource | object \| array \| null | Required | Encrypted-at-rest result, returned only to this environment with the original service read permission. | | provider_reference | string | Required | See the JSON example. | | created_at | string | Required | Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Retrieve provider operation Retrieve or reconcile a SafeHaven write in this project environment. Requires events:read and the read scope for the original service. A returned resource can still be pending or failed. ## Endpoint GET https://api.veyqo.org/api/v1/safehaven/operations/{id} Server secret key required. Scope: events:read. The key determines the project and environment; no project-selection header is accepted. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/api/v1/safehaven/operations/$PROVIDER_RESOURCE_ID" \ --header "Authorization: Bearer $VEYQO_SECRET_KEY" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/api/v1/safehaven/operations/${encodeURIComponent(process.env.PROVIDER_RESOURCE_ID)}`, { method: 'GET', headers: { "Authorization": `Bearer ${process.env.VEYQO_SECRET_KEY}`, "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_SECRET_KEY'), 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/api/v1/safehaven/operations/{quote(os.environ["PROVIDER_RESOURCE_ID"], safe="")}', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_SECRET_KEY'], "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "pso_01M6EB66SC61Q3RQYAN0693DGM", "operation": "transfer", "status": "unknown", "resource": null, "provider_reference": "pso_01M6EB66SC61Q3RQYAN0693DGM", "created_at": "2026-11-02T12:00:00Z" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Veyqo pso_ operation ID. Also used as the globally unique upstream reference where supported. | | operation | string | Required | See the JSON example. | | status | string | Required | Operation execution status, not proof of settled funds. succeeded means a response was received; inspect resource.status. Values: pending, succeeded, unknown, failed. | | resource | object \| array \| null | Required | Encrypted-at-rest result, returned only to this environment with the original service read permission. | | provider_reference | string | Required | See the JSON example. | | created_at | string | Required | Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | | INSUFFICIENT_PERMISSION | 403 | Grant the required scope or use a suitably scoped key. Dashboard organization roles and staff permissions are separate. | After permission changes. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | PROVIDER_REQUEST_FAILED | 422 | Read the safe message, inspect the payment’s failure details and correct the request or provider account. Never repeatedly retry a business rejection. | Only after resolving the cause. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Create a browser checkout session Starts a browser-defined checkout with a publishable key. The browser can change the amount, so reconcile against your server order. Success/cancel URL hosts must match the request Origin. Prefer server-created checkout for trusted pricing. ## Endpoint POST https://api.veyqo.org/checkout/v1/sessions Send your Veyqo publishable key using Authorization: Bearer or X-Veyqo-Key. This is the browser checkout surface, not the secret-key payments API. ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/checkout/v1/sessions" \ --header "Authorization: Bearer $VEYQO_PUBLISHABLE_KEY" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" } }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/checkout/v1/sessions`, { method: 'POST', headers: { "Authorization": `Bearer ${process.env.VEYQO_PUBLISHABLE_KEY}`, "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" } }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer '.getenv('VEYQO_PUBLISHABLE_KEY'), 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" } } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/checkout/v1/sessions', headers={ "Authorization": 'Bearer ' + os.environ['VEYQO_PUBLISHABLE_KEY'], "Accept": "application/json", "Content-Type": "application/json" }, json={ "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "provider": "paystack", "customer": { "email": "customer@example.com" } }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | amount | integer | Required | Integer minor-unit amount. NGN 500.00 is 50000; JPY 500 is 500. Minimum 1. | | currency | string | Required | Three-letter currency supported by the selected provider. Maximum 3 characters. | | reference | string \| null | Optional | Order reference; a session can create multiple uniquely referenced payment attempts. Maximum 100 characters. | | description | string \| null | Optional | Maximum 500 characters. | | customer | object | Optional | See the JSON example. | | customer.email | string \| null | Optional | Maximum 255 characters. Format: email. | | customer.name | string \| null | Optional | Maximum 255 characters. | | metadata | object \| array \| null | Optional | Your non-sensitive JSON metadata. Objects are recommended; do not store secrets or card details. Maximum 20 entries. | | provider | string \| null | Optional | Gateway selected by your server or project default; the customer chooses a payment method, not the gateway. Maximum 40 characters. | | success_url | string \| null | Optional | HTTP or HTTPS return URL. Use HTTPS in production. Maximum 2048 characters. Format: uri. | | cancel_url | string \| null | Optional | HTTP or HTTPS cancellation URL. Use HTTPS in production. Maximum 2048 characters. Format: uri. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cs_01M6EB66SC61Q3RQYAN0693DGM", "object": "checkout_session", "url": "https://veyqo.org/pay/cs_01M6EB66SC61Q3RQYAN0693DGM", "status": "open", "source": "browser", "provider": "paystack", "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "description": "Order 1001", "customer_email": "customer@example.com", "payment": null, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart", "expires_at": "2026-11-02T13:00:00+00:00", "completed_at": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Checkout session ID (cs_ prefix). | | object | "checkout_session" | Required | See the JSON example. | | url | string | Required | Hosted Veyqo URL; redirect here or open this session using VeyqoCheckout. Format: uri. | | status | string | Required | Values: open, completed, expired. | | source | string | Required | Values: api, browser, link. | | provider | string | Required | Selected provider slug; this field is an object on the browser session detail endpoint. | | amount | integer | Required | Server-defined amount in minor units. | | currency | string | Required | Three-letter currency. | | reference | string \| null | Required | Your order reference, when supplied. | | description | string \| null | Required | Checkout description. | | customer_email | string \| null | Required | Customer email if already supplied. | | payment | object \| null | Required | Current payment attempt, if any. A session can have multiple attempts over time. | | payment.id | string | Required | See the JSON example. | | payment.reference | string | Required | See the JSON example. | | payment.status | string | Required | Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | payment.provider | string | Required | See the JSON example. | | success_url | string \| null | Required | Configured return URL. A redirect is not proof of payment. | | cancel_url | string \| null | Required | Configured cancellation URL. | | expires_at | string | Required | Session expiry time. Format: date-time. | | completed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | | INVALID_API_KEY | 401 | Use a current kc_test_ or kc_live_ secret key on /api/v1. Use a pk_test_ or pk_live_ publishable key only on browser checkout. | After fixing credentials. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Read browser checkout state Possession of the session ID addresses this customer checkout. These endpoints support the hosted page and SDK; prefer those clients over reimplementing provider-specific actions. ## Endpoint GET https://api.veyqo.org/checkout/v1/sessions/{id} The resource ID addresses this customer checkout. Do not expose it unnecessarily. This endpoint supports the hosted page and checkout script. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/checkout/v1/sessions/$CHECKOUT_SESSION_ID" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/checkout/v1/sessions/${encodeURIComponent(process.env.CHECKOUT_SESSION_ID)}`, { method: 'GET', headers: { "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/checkout/v1/sessions/{quote(os.environ["CHECKOUT_SESSION_ID"], safe="")}', headers={ "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cs_01M6EB66SC61Q3RQYAN0693DGM", "object": "checkout_session", "url": "https://veyqo.org/pay/cs_01M6EB66SC61Q3RQYAN0693DGM", "status": "open", "source": "api", "provider": { "slug": "paystack", "name": "Paystack" }, "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "description": "Order 1001", "customer_email": "customer@example.com", "payment": null, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart", "expires_at": "2026-11-02T13:00:00+00:00", "completed_at": null, "created_at": "2026-11-02T12:00:00+00:00", "merchant": { "name": "Example Store" }, "sandbox": true, "needs_email": false, "methods": [ { "id": "card" }, { "id": "bank_transfer" }, { "id": "ussd", "banks": [ { "code": "737", "name": "GTBank" }, { "code": "919", "name": "UBA" }, { "code": "822", "name": "Sterling Bank" }, { "code": "966", "name": "Zenith Bank" } ] } ], "next_action": null } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Checkout session ID (cs_ prefix). | | object | "checkout_session" | Required | See the JSON example. | | url | string | Required | Hosted Veyqo URL; redirect here or open this session using VeyqoCheckout. Format: uri. | | status | string | Required | Values: open, completed, expired. | | source | string | Required | Values: api, browser, link. | | provider | object \| null | Required | Available provider identity, never secret credentials. | | provider.slug | string | Optional | See the JSON example. | | provider.name | string | Optional | See the JSON example. | | amount | integer | Required | Server-defined amount in minor units. | | currency | string | Required | Three-letter currency. | | reference | string \| null | Required | Your order reference, when supplied. | | description | string \| null | Required | Checkout description. | | customer_email | string \| null | Required | Customer email if already supplied. | | payment | object \| null | Required | Current payment attempt, if any. A session can have multiple attempts over time. | | payment.id | string | Required | See the JSON example. | | payment.reference | string | Required | See the JSON example. | | payment.status | string | Required | Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | payment.provider | string | Required | See the JSON example. | | success_url | string \| null | Required | Configured return URL. A redirect is not proof of payment. | | cancel_url | string \| null | Required | Configured cancellation URL. | | expires_at | string | Required | Session expiry time. Format: date-time. | | completed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | merchant | object | Required | See the JSON example. | | merchant.name | string | Required | See the JSON example. | | sandbox | boolean | Required | See the JSON example. | | needs_email | boolean | Required | See the JSON example. | | methods | array | Required | Currency-dependent method descriptions. Use the hosted page/SDK instead of hard-coding this provider-specific payload. | | next_action | object \| null | Required | Provider-specific action for the hosted checkout: bank details, USSD instructions, OTP or secure card form. May change per method. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Start a checkout method Possession of the session ID addresses this customer checkout. These endpoints support the hosted page and SDK; prefer those clients over reimplementing provider-specific actions. ## Endpoint POST https://api.veyqo.org/checkout/v1/sessions/{id}/charge The resource ID addresses this customer checkout. Do not expose it unnecessarily. This endpoint supports the hosted page and checkout script. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/checkout/v1/sessions/$CHECKOUT_SESSION_ID/charge" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "method": "bank_transfer", "email": "customer@example.com" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/checkout/v1/sessions/${encodeURIComponent(process.env.CHECKOUT_SESSION_ID)}/charge`, { method: 'POST', headers: { "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "method": "bank_transfer", "email": "customer@example.com" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "method": "bank_transfer", "email": "customer@example.com" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/checkout/v1/sessions/{quote(os.environ["CHECKOUT_SESSION_ID"], safe="")}/charge', headers={ "Accept": "application/json", "Content-Type": "application/json" }, json={ "method": "bank_transfer", "email": "customer@example.com" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | method | string | Required | Values: card, bank_transfer, ussd, mobile_money. | | email | string \| null | Optional | Maximum 255 characters. Format: email. | | name | string \| null | Optional | Maximum 255 characters. | | phone | string \| null | Optional | Maximum 32 characters. | | bank | string \| null | Optional | Bank code returned in the available method options. Maximum 10 characters. | | network | string \| null | Optional | Mobile-money network code from the method options. Maximum 10 characters. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cs_01M6EB66SC61Q3RQYAN0693DGM", "object": "checkout_session", "url": "https://veyqo.org/pay/cs_01M6EB66SC61Q3RQYAN0693DGM", "status": "open", "source": "api", "provider": { "slug": "paystack", "name": "Paystack" }, "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "description": "Order 1001", "customer_email": "customer@example.com", "payment": null, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart", "expires_at": "2026-11-02T13:00:00+00:00", "completed_at": null, "created_at": "2026-11-02T12:00:00+00:00", "merchant": { "name": "Example Store" }, "sandbox": true, "needs_email": false, "methods": [ { "id": "card" }, { "id": "bank_transfer" }, { "id": "ussd", "banks": [ { "code": "737", "name": "GTBank" }, { "code": "919", "name": "UBA" }, { "code": "822", "name": "Sterling Bank" }, { "code": "966", "name": "Zenith Bank" } ] } ], "next_action": null } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Checkout session ID (cs_ prefix). | | object | "checkout_session" | Required | See the JSON example. | | url | string | Required | Hosted Veyqo URL; redirect here or open this session using VeyqoCheckout. Format: uri. | | status | string | Required | Values: open, completed, expired. | | source | string | Required | Values: api, browser, link. | | provider | object \| null | Required | Available provider identity, never secret credentials. | | provider.slug | string | Optional | See the JSON example. | | provider.name | string | Optional | See the JSON example. | | amount | integer | Required | Server-defined amount in minor units. | | currency | string | Required | Three-letter currency. | | reference | string \| null | Required | Your order reference, when supplied. | | description | string \| null | Required | Checkout description. | | customer_email | string \| null | Required | Customer email if already supplied. | | payment | object \| null | Required | Current payment attempt, if any. A session can have multiple attempts over time. | | payment.id | string | Required | See the JSON example. | | payment.reference | string | Required | See the JSON example. | | payment.status | string | Required | Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | payment.provider | string | Required | See the JSON example. | | success_url | string \| null | Required | Configured return URL. A redirect is not proof of payment. | | cancel_url | string \| null | Required | Configured cancellation URL. | | expires_at | string | Required | Session expiry time. Format: date-time. | | completed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | merchant | object | Required | See the JSON example. | | merchant.name | string | Required | See the JSON example. | | sandbox | boolean | Required | See the JSON example. | | needs_email | boolean | Required | See the JSON example. | | methods | array | Required | Currency-dependent method descriptions. Use the hosted page/SDK instead of hard-coding this provider-specific payload. | | next_action | object \| null | Required | Provider-specific action for the hosted checkout: bank details, USSD instructions, OTP or secure card form. May change per method. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Submit a checkout OTP Possession of the session ID addresses this customer checkout. These endpoints support the hosted page and SDK; prefer those clients over reimplementing provider-specific actions. ## Endpoint POST https://api.veyqo.org/checkout/v1/sessions/{id}/otp The resource ID addresses this customer checkout. Do not expose it unnecessarily. This endpoint supports the hosted page and checkout script. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/checkout/v1/sessions/$CHECKOUT_SESSION_ID/otp" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "otp": "123456" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/checkout/v1/sessions/${encodeURIComponent(process.env.CHECKOUT_SESSION_ID)}/otp`, { method: 'POST', headers: { "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "otp": "123456" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "otp": "123456" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/checkout/v1/sessions/{quote(os.environ["CHECKOUT_SESSION_ID"], safe="")}/otp', headers={ "Accept": "application/json", "Content-Type": "application/json" }, json={ "otp": "123456" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | otp | string | Required | Customer OTP for the current pending provider action. Maximum 12 characters. | ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cs_01M6EB66SC61Q3RQYAN0693DGM", "object": "checkout_session", "url": "https://veyqo.org/pay/cs_01M6EB66SC61Q3RQYAN0693DGM", "status": "open", "source": "api", "provider": { "slug": "paystack", "name": "Paystack" }, "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "description": "Order 1001", "customer_email": "customer@example.com", "payment": null, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart", "expires_at": "2026-11-02T13:00:00+00:00", "completed_at": null, "created_at": "2026-11-02T12:00:00+00:00", "merchant": { "name": "Example Store" }, "sandbox": true, "needs_email": false, "methods": [ { "id": "card" }, { "id": "bank_transfer" }, { "id": "ussd", "banks": [ { "code": "737", "name": "GTBank" }, { "code": "919", "name": "UBA" }, { "code": "822", "name": "Sterling Bank" }, { "code": "966", "name": "Zenith Bank" } ] } ], "next_action": null } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Checkout session ID (cs_ prefix). | | object | "checkout_session" | Required | See the JSON example. | | url | string | Required | Hosted Veyqo URL; redirect here or open this session using VeyqoCheckout. Format: uri. | | status | string | Required | Values: open, completed, expired. | | source | string | Required | Values: api, browser, link. | | provider | object \| null | Required | Available provider identity, never secret credentials. | | provider.slug | string | Optional | See the JSON example. | | provider.name | string | Optional | See the JSON example. | | amount | integer | Required | Server-defined amount in minor units. | | currency | string | Required | Three-letter currency. | | reference | string \| null | Required | Your order reference, when supplied. | | description | string \| null | Required | Checkout description. | | customer_email | string \| null | Required | Customer email if already supplied. | | payment | object \| null | Required | Current payment attempt, if any. A session can have multiple attempts over time. | | payment.id | string | Required | See the JSON example. | | payment.reference | string | Required | See the JSON example. | | payment.status | string | Required | Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | payment.provider | string | Required | See the JSON example. | | success_url | string \| null | Required | Configured return URL. A redirect is not proof of payment. | | cancel_url | string \| null | Required | Configured cancellation URL. | | expires_at | string | Required | Session expiry time. Format: date-time. | | completed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | merchant | object | Required | See the JSON example. | | merchant.name | string | Required | See the JSON example. | | sandbox | boolean | Required | See the JSON example. | | needs_email | boolean | Required | See the JSON example. | | methods | array | Required | Currency-dependent method descriptions. Use the hosted page/SDK instead of hard-coding this provider-specific payload. | | next_action | object \| null | Required | Provider-specific action for the hosted checkout: bank details, USSD instructions, OTP or secure card form. May change per method. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Read a payment link Possession of the payment link ID addresses this checkout. The fixed amount comes from the dashboard link, never the request body. ## Endpoint GET https://api.veyqo.org/checkout/v1/links/{id} The resource ID addresses this customer checkout. Do not expose it unnecessarily. This endpoint supports the hosted page and checkout script. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request GET "https://api.veyqo.org/checkout/v1/links/$PAYMENT_LINK_ID" \ --header "Accept: application/json" ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/checkout/v1/links/${encodeURIComponent(process.env.PAYMENT_LINK_ID)}`, { method: 'GET', headers: { "Accept": "application/json" }, }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Accept: application/json' ], ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('GET', f'https://api.veyqo.org/checkout/v1/links/{quote(os.environ["PAYMENT_LINK_ID"], safe="")}', headers={ "Accept": "application/json" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Successful response · 200 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "plink_01M6EB66SC61Q3RQYAN0693DGM", "object": "payment_link", "title": "Order 1001", "description": null, "amount": 50000, "currency": "NGN", "merchant": { "name": "Example Store" }, "sandbox": true } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Payment link ID. | | object | "payment_link" | Required | See the JSON example. | | title | string | Required | See the JSON example. | | description | string \| null | Required | See the JSON example. | | amount | integer | Required | Fixed minor-unit amount configured in the dashboard. | | currency | string | Required | See the JSON example. | | merchant | object | Required | See the JSON example. | | merchant.name | string | Required | See the JSON example. | | sandbox | boolean | Required | See the JSON example. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover. --- # Start a payment-link session Possession of the payment link ID addresses this checkout. The fixed amount comes from the dashboard link, never the request body. ## Endpoint POST https://api.veyqo.org/checkout/v1/links/{id}/sessions The resource ID addresses this customer checkout. Do not expose it unnecessarily. This endpoint supports the hosted page and checkout script. ## Path and query parameters | Parameter | Location | Required | Description | | --- | --- | --- | --- | | id | path | Yes | Use the ID returned when this resource was created. | ## Example request Examples use illustrative IDs and provider URLs. Replace path variables with IDs returned by your own requests. Never paste a live secret into client code or a public tool. ### cURL ```bash curl --request POST "https://api.veyqo.org/checkout/v1/links/$PAYMENT_LINK_ID/sessions" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{ "email": "customer@example.com" }' ``` ### Node.js ```javascript // Server-side Node.js 18+. Save operation.idempotencyKey before a write. const response = await fetch(`https://api.veyqo.org/checkout/v1/links/${encodeURIComponent(process.env.PAYMENT_LINK_ID)}/sessions`, { method: 'POST', headers: { "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ "email": "customer@example.com" }), }); const result = await response.json(); if (!response.ok || !result.success) { console.error(response.status, result.error?.code, response.headers.get('X-Request-Id')); throw new Error(result.error?.message ?? 'Veyqo request failed'); } console.log(result.data); ``` ### PHP ```php 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Accept: application/json', 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => <<<'JSON' { "email": "customer@example.com" } JSON, ]); $body = curl_exec($curl); if ($body === false) throw new RuntimeException(curl_error($curl)); $status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); $result = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if ($status >= 400 || !($result['success'] ?? false)) { throw new RuntimeException($result['error']['code'] ?? 'Veyqo request failed'); } print_r($result['data']); ``` ### Python ```python # pip install requests; run on your server. import os, requests from urllib.parse import quote response = requests.request('POST', f'https://api.veyqo.org/checkout/v1/links/{quote(os.environ["PAYMENT_LINK_ID"], safe="")}/sessions', headers={ "Accept": "application/json", "Content-Type": "application/json" }, json={ "email": "customer@example.com" }, timeout=30) result = response.json() if not response.ok or not result.get('success'): raise RuntimeError(f"{response.status_code} {result.get('error')} request_id={response.headers.get('X-Request-Id')}") print(result['data']) ``` ## Request body | Field | Type | Presence | Description | | --- | --- | --- | --- | | email | string \| null | Optional | Maximum 255 characters. Format: email. | | name | string \| null | Optional | Maximum 255 characters. | ## Successful response · 201 HTTP success means the request was accepted. A pending payment or refund is not completed merely because the response is 200 or 201. ```json { "success": true, "data": { "id": "cs_01M6EB66SC61Q3RQYAN0693DGM", "object": "checkout_session", "url": "https://veyqo.org/pay/cs_01M6EB66SC61Q3RQYAN0693DGM", "status": "open", "source": "link", "provider": "paystack", "amount": 50000, "currency": "NGN", "reference": "ORDER-1001", "description": "Order 1001", "customer_email": "customer@example.com", "payment": null, "success_url": "https://shop.example.com/thanks", "cancel_url": "https://shop.example.com/cart", "expires_at": "2026-11-02T13:00:00+00:00", "completed_at": null, "created_at": "2026-11-02T12:00:00+00:00" } } ``` ## Response fields | Field in data | Type | Presence | Description | | --- | --- | --- | --- | | id | string | Required | Checkout session ID (cs_ prefix). | | object | "checkout_session" | Required | See the JSON example. | | url | string | Required | Hosted Veyqo URL; redirect here or open this session using VeyqoCheckout. Format: uri. | | status | string | Required | Values: open, completed, expired. | | source | string | Required | Values: api, browser, link. | | provider | string | Required | Selected provider slug; this field is an object on the browser session detail endpoint. | | amount | integer | Required | Server-defined amount in minor units. | | currency | string | Required | Three-letter currency. | | reference | string \| null | Required | Your order reference, when supplied. | | description | string \| null | Required | Checkout description. | | customer_email | string \| null | Required | Customer email if already supplied. | | payment | object \| null | Required | Current payment attempt, if any. A session can have multiple attempts over time. | | payment.id | string | Required | See the JSON example. | | payment.reference | string | Required | See the JSON example. | | payment.status | string | Required | Values: created, pending, processing, succeeded, failed, cancelled, refunded, partially_refunded. | | payment.provider | string | Required | See the JSON example. | | success_url | string \| null | Required | Configured return URL. A redirect is not proof of payment. | | cancel_url | string \| null | Required | Configured cancellation URL. | | expires_at | string | Required | Session expiry time. Format: date-time. | | completed_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | | created_at | string \| null | Required | ISO 8601 timestamp. Format: date-time. | ## Errors and recovery | Code | HTTP | Recovery | Retry policy | | --- | --- | --- | --- | | VALIDATION_FAILED | 422 | Read error.details when present, correct the named fields and retry only after correction. Validation messages may describe state/capability errors without field details. | No automatic retry. | | RESOURCE_NOT_FOUND | 404 | Check the ID, project and environment. Do not guess another project’s IDs. An inactive payment link is also not-found. | No blind retry. | | RATE_LIMIT_EXCEEDED | 429 | Honor Retry-After, use bounded exponential backoff with jitter, and reduce concurrent requests. Read X-RateLimit headers. | Yes, after Retry-After; preserve write idempotency. | | PROVIDER_UNAVAILABLE | 503 | Check the existing payment and verify its state before starting another attempt. Retry safe reads with backoff; preserve operation identity for retried writes. | Conditional: reconcile unknown outcomes first. | | INTERNAL_ERROR | 500 | Record X-Request-Id, timestamp and sanitized request context. Reconcile unknown payment outcomes before retrying a write; contact support if it persists. | Safe reads: bounded backoff. Writes: reconcile first. | - [Complete error catalogue](https://veyqo.org/docs/errors): Every Veyqo error code, including which surface emits it and how to recover.