# VEX Pay Docs (full) > Complete Markdown documentation for AI agents and integrations. # Payments built for Venezuela > One tenant-scoped API for C2P, VPOS, Pago Móvil verification, stablecoins and Colombian pesos, reconciliation, and signed webhooks. ## What you can build > **WARNING: Card payments are temporarily unavailable** > > Card payments (VPOS) are temporarily unavailable. The endpoint answers 400 until they return. | Flow | Best for | Core endpoint | | --- | --- | --- | | C2P | Bank-authorized customer payments | POST /v1/payments/c2p | | VPOS | Card-present-style online collection | POST /v1/payments/vpos | | Pago Móvil | Transfer reference verification | POST /v1/payments/pago-movil/verify | | Débito inmediato | VES debit with bank OTP | POST /v1/payments/debit | | Hosted checkout | One page where the buyer picks bolívares, stablecoins or Colombian pesos | POST /v1/checkout/sessions | | Stablecoins | USDT and USDC deposit addresses, checkout and payouts | See /usdt | | Colombian pesos (COP) | Card, PSE, Bancolombia, Bre-B, Nequi and Daviplata pay-ins from Colombia | POST /v1/cop/payments | | Subscriptions | Recurring USD plans paid in bolívares, by emailed invoice or automatic debit (domiciliación) | POST /v1/subscriptions · see /subscriptions | | Merchants & payouts | Verify Pago Móvil destinations, then pay out VES | POST /v1/merchants · POST /v1/payouts | | Marketplace settlement | Collect, retain a fee, pay seller or split batch | See /marketplace-settlement | | Marketplace splits | One payment split between up to 10 comercios, with automatic comercio payouts | See /marketplace-splits | | Server SDKs | Typed clients for Node, Python, PHP, and a Laravel package | See /node-sdk · /python-sdk · /php-sdk · /laravel | | AI agents (MCP) | Let Claude, Cursor and other agents read your account and create checkouts | See /mcp | | E-commerce plugins | Accept VEX Pay in WooCommerce without writing payment code | See /integrations | | Postman collection | Importable happy-path for collect + payout against the hosted API | See /postman | | Pricing | Standard rates, worked examples, and what is free | See /pricing | > **SUCCESS: New here? Start with the integration path** > > Build your integration, step by step (/integration-path) takes you from your first call to live payments in nine checkpoints. Ready-made recipes cover an online store, a marketplace, bolívares-to-USDT top-ups and Colombian pesos. > **NOTE: One task at a time? Use a playbook** > > The playbooks (/playbooks) walk through single tasks end to end — go live, rotate a key, set up webhooks, split a payment with a seller, withdraw, refund, or find a Pago Móvil that was not matched — each with the checks and fixes you need. ## The integration model 1. **Authenticate** — Use your tenant x-api-key from a trusted server. 2. **Load banks** — Build customer bank selectors from GET /v1/banks. 3. **Quote your Bolívar rate** — Call GET /v1/quote for the rate your payments use (BCV or market), the official BCV rate and the median across BCV sources. 4. **Create and reconcile** — Persist payment IDs, receive signed events, and use lookups to resolve uncertainty. > **SUCCESS: Designed for tenant control** > > Your application owns the customer experience, including collecting the C2P token. The gateway executes and normalizes payment operations. --- # Make your first request > Connect a server, load the supported banks, and create a C2P payment intent. Human docs: /quickstart ## Before you begin - Keep your API key on your server—never ship it in browser or mobile code. - Set API_URL to your deployed gateway origin. - Use test credentials and synthetic customer data outside production. ## 01. Configure your environment ### .env ```bash API_URL=https://api.example.com VEXPAY_API_KEY=vk_test_replace_me ``` ## 02. Check the connection ### curl ```bash curl "${API_URL}/v1/banks" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### JavaScript ```javascript const response = await fetch( `${process.env.API_URL}/v1/banks`, { headers: { 'x-api-key': process.env.VEXPAY_API_KEY } } ); if (!response.ok) throw new Error(`API error: ${response.status}`); const banks = await response.json(); ``` ## 03. Choose a payment flow C2P is the recommended starting point for bank-authorized payments. Your application requests an intent, gathers the token from the customer, then executes the payment. > **NOTE: Your interface owns token collection** > > The gateway does not send an SMS or otherwise message the customer. Explain where the customer can find their bank-issued C2P token. > **NOTE: Marketplace fee + payout** > > If you collect from a buyer, keep a platform fee, and pay a verified seller (or split across merchants), follow Settle marketplace payments at /marketplace-settlement. > **SUCCESS: Next: the full integration path** > > Build your integration, step by step (/integration-path) continues from here: first payment, webhooks, safe retries, balances and the 24h hold, payouts and go-live — each with a checkpoint. --- # Authenticate every request > Tenant API keys scope requests and payment records to one integration. Human docs: /authentication ## Use the x-api-key header Send the raw tenant key in the x-api-key header on every /v1 request. Missing, invalid, inactive, or rotated keys return 401. ### curl ```bash curl "${API_URL}/v1/banks" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` > **WARNING: Server-side only** > > Treat the API key as a secret. Load it from a secret manager or server environment variable; do not expose it through NEXT_PUBLIC_ variables. > **NOTE: Live and Test keys** > > Each commercial account has a Live twin and a Test twin. Mode is implied by which key you send. Local seed: `dev-local-api-key` (live) and `dev-local-api-key-test` (test). Webhook payloads include `livemode: true|false`. VEX Pay routes each method to a partner bank for you — you never pick or configure the bank. Test keys use sandbox rails or the bank's test environment, so no real money moves — card payments in Test accept only the VPOS test cards (/vpos#test-card) — fixed numbers that return each outcome — and decline real cards without charging them. Test mode never moves real money, and that includes Bolívar payouts and payout-account / merchant micro-deposits: they run on the sandbox and complete at once (`payout.completed`, an `SBXC…` reference). The micro-deposit start response then carries `testAmounts` — the two amounts to confirm — because nothing reaches a phone. > **NOTE: Provider routing per method** > > VEX Pay ops can limit which payment methods (Pago Móvil, VPOS, Débito Inmediato incl. C2P, Crédito Inmediato) your account may use (for example, Pago Móvil only). Routed calls (C2P, VPOS, Pago Móvil verify / receiving account, merchant payouts and micro-deposits) automatically pick an allowed provider, and return 400 when none is. The advanced débito and crédito endpoints under /v1/payments (debit/otp, debit, credit, credit/account, credit/disburse, payouts, change) return **403** when that method is not enabled on your account. In Test mode the débito endpoints are never restricted, but the direct crédito endpoints (credit, credit/account, credit/disburse, payouts, change) are always refused with 403 — send funds with POST /v1/payouts instead. ## Plan for rotation A rotated key invalidates the previous key for that mode only (Live or Test). Update the secret in each environment atomically and verify with GET /v1/banks. --- # Go live with real payments > New accounts start in test mode. VEX Pay reviews your integration before live keys can move real money. Human docs: /going-live ## How activation works Every account gets a Live and a Test key. Test works immediately. Live stays locked until VEX Pay reviews your integration and activates it — until then, live keys return **403** with `live_mode_not_activated`, hosted payment links for the live account are unavailable, and the portal cannot create, rotate, or reveal live keys. 1. **Integrate in test mode** — Use your Test key end to end: create payments, handle webhooks, and reconcile with GET /v1/payments/by-ref/:externalRef. 2. **Complete a test payment** — Finish at least one payment with the Test key and confirm your webhook endpoint received the event (Portal → Webhooks shows deliveries). 3. **Request go-live** — In the portal, click **Request go-live** on the banner. The VEX Pay team is notified and reviews your account. 4. **Switch keys** — Once activated you receive a `tenant.live_status_changed` webhook, the banner disappears, and you can create live keys. Swap API_URL/VEXPAY_API_KEY in production. ## Handling live_mode_not_activated ### 403 response ```json { "error": "live_mode_not_activated", "message": "Live mode is not activated for this account. Use your test API key, or request go-live review from the portal." } ``` > **NOTE: Not retryable** > > Retrying will not help. Keep using your Test key until activation, then deploy with the live key. VEX Pay may also suspend live mode on an active account (same error); contact support if that happens. --- # Seller, marketplace and split payments > Every account is a Seller or a Marketplace. A seller sells its own things; a marketplace collects for its sellers, and split payments divide each charge between the seller and your commission. Human docs: /business-models ## Two business models Your account has one business model. It decides who the money belongs to and what the portal walks you through. Split payments are not a third model: they are how a marketplace charges. | | Seller | Marketplace | | --- | --- | --- | | Who you charge for | Yourself — you sell your own products or services | Your sellers — people or businesses that sell through your platform | | Where the money lands | Your balance | Split: your commission in your balance, the seller’s net in the seller’s balance | | Main tools | Portal payment links, product links, checkout sessions, payments API | Merchants (sellers), split payments on charges and checkout sessions, seller payouts | | Example | An online store | A coaching platform where each trainer is a seller | > **NOTE: Changing your model** > > VEX Pay sets the business model when your account is created. Ask us to change it if your business changes; your keys, balance and payments stay the same. ## The words we use | Term | Meaning | In the API | | --- | --- | --- | | Platform | You, when you run a marketplace | Your account (API key) | | Seller | Someone you collect for | `merchant` — `/v1/merchants`, ids `mrc_…` | | Commission | The part of each sale you keep | `applicationFeePercent` (or `applicationFeeVes`) | | Seller net | What the seller receives: the amount, minus the VEX Pay fee, minus your commission | The seller’s `pendingVes`, then `availableVes` | | Split payment | A charge or link that names a seller, so the split happens on its own | `merchantId` on the charge or checkout session | ## How a split payment works 1. **Register the seller** — Create the seller with `POST /v1/merchants` and verify their Pago Móvil payout destination. Optionally set their commission (or a default commission in **Portal → Merchants**). 2. **Charge with the seller** — Send `merchantId` (and optionally `applicationFeePercent`) on a C2P, card or débito charge — or create a checkout session with them and send the buyer its `url`. 3. **The payment completes** — Your commission stays in your balance. The seller net moves to the seller’s pending balance. 4. **Pay the seller** — After the hold, pay out from the seller’s balance with `POST /v1/payouts` and `fromMerchantBalance: true`. | Example: Bs 2,000 Pago Móvil, 3% commission | Amount | | --- | --- | | Buyer pays | Bs 2,000.00 | | VEX Pay fee (Pago Móvil, from the seller net) | per your rates — see /pricing | | Your commission (3%) | Bs 60.00 → your balance | | Seller net | Bs 2,000.00 − VEX Pay fee − Bs 60.00 → seller’s pending balance | > **WARNING: The VEX Pay fee comes out of the seller net** > > A 3% commission means you keep exactly 3% of the amount; the seller receives the rest after the VEX Pay fee. Factor the fee in when you tell sellers what they earn. ## A split payment link To send a buyer a link instead of building a payment screen, create a checkout session with the seller. This one accepts only Pago Móvil and keeps 3% for you: ### curl ```bash curl --request POST "${API_URL}/v1/checkout/sessions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": 20.00, "methods": ["pago_movil"], "merchantId": "MERCHANT_ID", "applicationFeePercent": 3, "reference": "class-1042" }' ``` - Split links offer bolívar methods only: `pago_movil`, `c2p` (Débito Inmediato) and `vpos` (card). Asking for USDT, USDC or COP with a seller answers 400. - Omit `applicationFeePercent` to use the seller’s commission, then your default commission. - The checkout page shows the seller’s public name, because the buyer is paying the seller. - Portal payment links are for Seller accounts; a marketplace creates its split links through the API (or the SDKs and MCP). > **NOTE: Go deeper** > > The full flow — onboarding sellers, verification, holds and payouts — is in the marketplace recipe and at /marketplace-settlement and /merchants-payouts. --- # Integrate with @vexpay/node > Official TypeScript/Node SDK with typed resources, safe retries, and webhook verification. Human docs: /node-sdk ## Install ### npm ```bash npm install @vexpay/node ``` ### JavaScript ```javascript import VexPay from '@vexpay/node'; const vexpay = new VexPay(process.env.VEXPAY_API_KEY, { // baseUrl: 'http://localhost:3010', // local gateway }); ``` ## C2P payment ### JavaScript ```javascript const intent = await vexpay.payments.c2p.request({ usdAmount: 12.5, debtorId: 'V12345678', debtorCellPhone: '584121234567', debtorBankCode: 102, externalRef: 'order_1042', }); const receipt = await vexpay.payments.c2p.execute({ intentId: intent.intentId, usdAmount: 12.5, debtorId: 'V12345678', debtorCellPhone: '584121234567', debtorBankCode: 102, token: customerToken, externalRef: 'order_1042', }); ``` > **NOTE: Automatic Idempotency-Key** > > Every POST sends a UUID Idempotency-Key unless you pass `{ idempotencyKey }` in the request options. Retries reuse the same key. ## Checkout session ### JavaScript ```javascript const session = await vexpay.checkout.sessions.create({ amountUsd: 25, reference: 'order-1042', allowedOrigins: ['https://shop.example'], }); // Give session.clientSecret to @vexpay/js in the browser. // Confirm fulfillment with GET or payment.* webhooks — never from browser events alone. ``` ## Verify webhooks See Webhooks for the full signature contract. Use `vexpay.webhooks.constructEvent(rawBody, header, secret)`. --- # Integrate with vexpay (Python) > Official Python SDK with sync and async clients, matching the Node resource surface. Human docs: /python-sdk ## Install ### pip ```bash pip install vexpay ``` ### Python ```python from vexpay import VexPay, AsyncVexPay client = VexPay(api_key=os.environ["VEXPAY_API_KEY"]) # async: AsyncVexPay(api_key=...) ``` ## C2P payment ### Python ```python intent = client.payments.c2p.request( usd_amount=12.5, debtor_id="V12345678", debtor_cell_phone="584121234567", debtor_bank_code=102, external_ref="order_1042", ) receipt = client.payments.c2p.execute( intent_id=intent.intent_id, usd_amount=12.5, debtor_id="V12345678", debtor_cell_phone="584121234567", debtor_bank_code=102, token=customer_token, external_ref="order_1042", ) ``` ## Verify webhooks ### Python ```python from vexpay import Webhook event = Webhook.construct_event( request.body, request.headers["VexPay-Signature"], os.environ["VEXPAY_WEBHOOK_SECRET"], ) ``` --- # Integrate with vexpay/vexpay-php > Official framework-agnostic PHP 8.1+ SDK with typed responses, safe retries, webhook verification, and an in-memory test client. Human docs: /php-sdk ## Install ### Composer ```bash composer require vexpay/vexpay-php ``` | Requirement | Supported | | --- | --- | | PHP | 8.1 or later | | HTTP client | Guzzle 7 or 8 (default), or any PSR-18 client | | Frameworks | None required — works in plain PHP, Symfony, Slim, WordPress, and others | | Package | vexpay/vexpay-php on Packagist (packagist.org/packages/vexpay/vexpay-php) | ### PHP ```php use VexPay\VexPayClient; $vexpay = new VexPayClient(getenv('VEXPAY_API_KEY')); // new VexPayClient(['api_key' => ..., 'base_url' => 'http://localhost:3010']) for a local gateway $quote = $vexpay->quotes->retrieve(['usdAmount' => 25]); ``` Request bodies are arrays with the API field names (`usdAmount`, `debtorBankCode`, …). Responses are typed readonly objects; enum fields hold a backed enum, or the raw string when the API sends a value newer than your SDK. Call `->toArray()` for the raw response. Using Laravel? Install `vexpay/laravel` instead (see Laravel). ## C2P payment ### PHP ```php $payer = [ 'usdAmount' => 12.5, 'debtorId' => 'V12345678', 'debtorCellPhone' => '584121234567', 'debtorBankCode' => 102, 'externalRef' => 'order_1042', ]; $intent = $vexpay->payments->c2p->request($payer); $receipt = $vexpay->payments->c2p->execute($payer + [ 'intentId' => $intent->intentId, 'token' => $customerToken, ]); ``` > **NOTE: Automatic Idempotency-Key** > > Every POST sends a UUID Idempotency-Key unless you pass `['idempotency_key' => ...]` as request options. Retries reuse the same key. ## Checkout session ### PHP ```php $session = $vexpay->checkout->sessions->create([ 'amountUsd' => 25, 'reference' => 'order-1042', 'allowedOrigins' => ['https://shop.example'], ]); // Redirect to $session->url, or give $session->clientSecret to @vexpay/js in the browser. // Confirm fulfillment with GET or payment.* webhooks — never from browser events alone. ``` ## Verify webhooks ### PHP ```php use VexPay\Exception\SignatureVerificationException; use VexPay\Webhook; try { $event = Webhook::constructEvent( file_get_contents('php://input'), $_SERVER['HTTP_VEXPAY_SIGNATURE'] ?? null, getenv('VEXPAY_WEBHOOK_SECRET'), ); } catch (SignatureVerificationException) { http_response_code(400); exit; } if ($event->event === 'payment.completed') { $payment = $event->payment(); // fulfill from $payment — then respond 2xx } ``` ## Test without the network `VexPay\Testing\FakeHttpClient` answers every operation with a valid response (echoing the fields you sent), records requests, and accepts stubs keyed by operationId. ### PHP ```php use VexPay\Testing\FakeHttpClient; use VexPay\VexPayClient; $http = new FakeHttpClient(['Payouts_create' => FakeHttpClient::error(409, 'external_ref_conflict')]); $vexpay = new VexPayClient(['api_key' => 'vk_test', 'http_client' => $http]); $vexpay->checkout->sessions->create(['amountUsd' => 25, 'reference' => 'order-1042']); $http->recorded('CheckoutSessions_create')[0]->body['amountUsd']; // 25 ``` --- # Integrate with vexpay/laravel > Laravel 12/13 package: facade, verified webhooks as events, Billable checkouts with a synced payment record, marketplace sellers, Blade checkout, and test fakes. Human docs: /laravel ## Install ### Composer ```bash composer require vexpay/laravel php artisan vexpay:install php artisan migrate ``` | Requirement | Supported | | --- | --- | | Laravel | 12 or 13 (every release still receiving security fixes) | | PHP | 8.2 or later (Laravel 13 needs 8.3) | | HTTP client | The Guzzle 7 or 8 your app already has | | Package | vexpay/laravel on Packagist (packagist.org/packages/vexpay/laravel); installs vexpay/vexpay-php | ### .env ```bash VEXPAY_API_KEY=vk_test_replace_me VEXPAY_WEBHOOK_SECRET=whsec_replace_me ``` Register `https://your-app.example/vexpay/webhook` as a webhook endpoint in the portal, then check delivery with `php artisan vexpay:webhook-test`. The `VexPay` facade (or an injected `VexPay\VexPayClient`) exposes the full PHP SDK. ## Accept payments with Billable ### PHP ```php use VexPay\Laravel\Billable; class Order extends Model { use Billable; } // In a controller: redirects (303) to the hosted checkout, or returns // { id, url, clientSecret } for JSON requests. return $order->checkout($order->total_usd, [ 'description' => "Pedido #{$order->number}", 'successUrl' => route('orders.thanks', $order), ]); ``` `checkout()` creates a checkout session and stores a `PENDING` row in `vexpay_payments` linked to the model. Embed instead of redirecting with ``, which sends only the session client secret to the browser. ## Fulfill from billing events Verified `payment.*` webhooks update the local record. Status only moves forward (`PENDING` → `COMPLETED` / `FAILED` / `CANCELED`, `COMPLETED` → `REVERSED`), so retries and out-of-order deliveries are harmless and billing events fire exactly once per transition. ### PHP ```php use VexPay\Laravel\Events\Billing\PaymentSucceeded; Event::listen(function (PaymentSucceeded $event) { $event->billable()->markPaid($event->payment->payment_id); }); ``` > **NOTE: Raw webhook events** > > Every verified delivery also dispatches `WebhookReceived` and one class per event name (e.g. `Webhooks\PaymentCompleted`, `Webhooks\PayoutFailed`). Those fire again on retries — keep their listeners idempotent. ## Marketplace sellers ### PHP ```php use VexPay\Laravel\HasVexPayMerchant; class Seller extends Model { use HasVexPayMerchant; } $seller->createAsVexPayMerchant([ 'name' => 'María Pérez', 'identification' => 'V12345678', 'contactEmail' => 'maria@example.com', 'contactPhone' => '04141234567', ]); $seller->payout(1523.40, 'Venta #991', 'order-991'); // same reference never pays twice ``` ## Testing ### PHP ```php use VexPay\Laravel\Facades\VexPay; use VexPay\Laravel\Testing\InteractsWithVexPay; VexPay::fake(); $this->post(route('orders.pay', $order))->assertRedirect(); VexPay::assertCheckoutCreated(25.00); $this->postVexPayPaymentWebhook($order->vexpayPayments()->first(), 'payment.completed') ->assertNoContent(); ``` --- # Connect AI agents with @vexpay/mcp > Official MCP server: let Claude Code, Claude Desktop, Cursor and other agents read balances, payments, payouts and subscriptions and create checkout sessions, payment links and send_invoice subscriptions. Nothing in it moves money. Human docs: /mcp ## Install Use your **Test** key while you try it out. The server runs locally over stdio and needs Node.js 20 or newer. ### Claude Code ```bash claude mcp add vexpay --env VEXPAY_API_KEY=your_test_key -- npx -y @vexpay/mcp ``` ### Claude Desktop / Cursor ```json { "mcpServers": { "vexpay": { "command": "npx", "args": ["-y", "@vexpay/mcp"], "env": { "VEXPAY_API_KEY": "your_test_key" } } } } ``` | Variable | Required | Description | | --- | --- | --- | | VEXPAY_API_KEY | Yes | Your API key. Never shown in tool output or logs. | | VEXPAY_BASE_URL | No | API origin. Defaults to https://api.vexpay.app. The earlier host https://api.pay.vexwallet.co keeps working. | | VEXPAY_MCP_ALLOW_LIVE | No | Set to 1 to enable write tools on a live account. | ## Test and live accounts On startup the server asks VEX Pay whether the key belongs to a test or a live account. On a test account every tool is available. On a live account only read tools are available unless you set `VEXPAY_MCP_ALLOW_LIVE=1`. If the mode cannot be determined, the server assumes live. > **NOTE: No money movement** > > Payouts, charges, reversals and executed conversions are not exposed as tools under any setting. Use the API or a server SDK for those. ## Tools | Tool | Type | What it does | | --- | --- | --- | | `vexpay_get_balance` | Read | VES platform balance | | `vexpay_get_stablecoin_balances` | Read | USDT and USDC balances | | `vexpay_list_banks` | Read | Venezuelan banks and supported services | | `vexpay_get_fx_quote` | Read | USD → VES at your Bolívar rate | | `vexpay_get_payment` | Read | One payment by id or externalRef | | `vexpay_list_payouts / vexpay_get_payout` | Read | Payouts (paged) and one payout by id or externalRef | | `vexpay_list_conversions / vexpay_get_conversion` | Read | VES → USDT conversions | | `vexpay_get_cop_payment / vexpay_get_cop_balance` | Read | Colombian peso payments and balance | | `vexpay_list_stablecoin_networks` | Read | Enabled networks, fees and availability | | `vexpay_get_checkout_session` | Read | One checkout session | | `vexpay_list_products / vexpay_list_payment_links` | Read | Products and their hosted payment links | | `vexpay_list_webhook_endpoints` | Read | Your webhook endpoints | | `vexpay_list_customers / vexpay_get_customer` | Read | Billing customers (paged) and one customer by id | | `vexpay_list_customer_payment_methods / vexpay_get_payment_method` | Read | A customer’s domiciliación payment methods and one by id (status, bankCode, last 4 phone digits) | | `vexpay_list_prices / vexpay_get_price` | Read | Recurring USD prices and one price by id | | `vexpay_list_subscriptions / vexpay_get_subscription` | Read | Subscriptions with status, collection method, period and latest invoice | | `vexpay_list_invoices / vexpay_get_invoice` | Read | Subscription invoices with collection attempts and the hosted invoice URL | | `vexpay_get_setup_session` | Read | One domiciliación setup session: open, complete or expired | | `vexpay_create_checkout_session` | Write | Checkout session with a hosted payment URL | | `vexpay_create_product / vexpay_create_payment_link` | Write | Product and its hosted payment link | | `vexpay_create_deposit_address` | Write | Stablecoin deposit address for a customer | | `vexpay_quote_conversion` | Write | VES → USDT rate locked 60 s (nothing executes) | | `vexpay_send_test_webhook` | Write | notification.test delivery to your endpoints | | `vexpay_create_customer` | Write | Billing customer to subscribe to a price | | `vexpay_create_price` | Write | Recurring USD price on a product | | `vexpay_create_subscription` | Write | send_invoice subscription: invoices are emailed to the customer. Never charges automatically; use the API for charge_automatically | | `vexpay_create_setup_session` | Write | 24-hour page where a customer authorizes domiciliación (nothing is charged) | 37 tools: 27 read and 10 write. Billing tools are covered in /subscriptions and /domiciliacion. Write tools accept an optional `idempotencyKey`. Reuse it when retrying so the record is created only once. Failed calls return the HTTP status, error code, message and request id. --- # Supported banks and logos > Load the current bank catalog — including optional logo images — and use its codes in payments, merchants, and payouts. Human docs: /banks ## List banks GET /v1/banks returns the persisted bank catalog (refreshed weekly from the national bank directory). Each item includes `code` (4-digit SIMF), `name`, `services`, and `logoUrl`. Banks tagged as hidden in ops are omitted. Build selectors from this response instead of hard-coding the list. > **SUCCESS: Bank logos for easier identification** > > Each bank may include `logoUrl`: a public 100×100 PNG you can show next to the bank name in dropdowns and payment UIs. When `logoUrl` is null, fall back to the bank name (and optionally the code). Prefer these hosted logos over shipping your own bank icon pack — they stay in sync as ops uploads new artwork. ### curl ```bash curl "${API_URL}/v1/banks" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### Response shape ```json [ { "code": "0102", "name": "Banco de Venezuela", "services": [], "logoUrl": "https://pub-xxxxx.r2.dev/vebanking/banks/0102.png" }, { "code": "0134", "name": "Banco Ejemplo", "services": [], "logoUrl": null } ] ``` ### UI tip ```javascript const banks = await fetch(`${process.env.API_URL}/v1/banks`, { headers: { 'x-api-key': process.env.VEXPAY_API_KEY }, }).then((r) => r.json()); // Show logo + name so customers spot their bank faster banks.map((b) => ({ value: b.code, label: b.name, image: b.logoUrl, // null → render initials / name only })); ``` > **NOTE: Keep the list current** > > Refresh the catalog instead of hard-coding bank names, institution codes, or logo assets. Use the same `code` values for C2P, débito, merchant registration (`bankCode`), and related flows. --- # Quote USD to VES at your Bolívar rate > Convert a USD amount to VES at your account's Bolívar rate (BCV or market), plus the official BCV rate and a median across BCV sources. Human docs: /quote ## Request a quote GET /v1/quote converts a USD amount to VES at your account's Bolívar rate: the official BCV rate by default, or the market rate if you chose it (see below). Pass usdAmount as a query parameter and authenticate with your tenant x-api-key. ### curl ```bash curl "${API_URL}/v1/quote?usdAmount=25" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### JavaScript ```javascript const response = await fetch( `${process.env.API_URL}/v1/quote?usdAmount=25`, { headers: { 'x-api-key': process.env.VEXPAY_API_KEY } } ); if (!response.ok) throw new Error(`API error: ${response.status}`); const quote = await response.json(); ``` ## Response fields | Field | Meaning | | --- | --- | | rate | Rate your payments are priced at (Bs per $1): bcvRate for BCV accounts, the market rate for MARKET accounts | | rateSource | Your Bolívar rate setting: BCV or MARKET | | vesAmount | usdAmount converted at rate: what a payment created now would charge | | bcvRate | Official VEX FX BCV rate (always BCV, for reference) | | medianRate | Median of available BCV sources (sources.vexFx and sources.bank when configured) | | medianVesAmount | usdAmount converted at medianRate | | sources.vexFx | VEX FX Official BCV rate (same as bcvRate) | | sources.bank | Bank BCV rate when configured, or { error: "BANK_NOT_CONFIGURED" } | | fetchedAt | ISO timestamp when the authoritative rate was fetched | ### Response shape ```json { "usdAmount": 25, "rate": 36.5, "rateSource": "BCV", "bcvRate": 36.5, "vesAmount": 912.5, "medianRate": 36.55, "medianVesAmount": 913.75, "source": "bcv", "fetchedAt": "2026-07-20T15:00:00.000Z", "sources": { "vexFx": { "bcvRate": 36.5, "fetchedAt": "2026-07-20T15:00:00.000Z" }, "bank": { "bcvRate": 36.6, "fechavalor": "2026-07-20", "fetchedAt": "2026-07-20T15:00:00.000Z" } } } ``` > **NOTE: Settlement uses rate** > > Payment create and execute flows convert USD to VES with rate (your Bolívar rate). Use medianRate for display, comparison, or your own pricing logic—not as the settlement rate unless you convert amounts yourself before calling payment endpoints. ## Choose your Bolívar rate: BCV or market In the portal, **Rates → Bolívar rate** sets which rate converts your USD prices to bolívares: **BCV** (official, the default) or **Market** (Binance P2P, the same base rate your USDT conversions use, without the conversion spread). It applies to payment links, the hosted checkout and API charges that send usdAmount. Charges that send vesAmount keep that exact Bs amount; their usdAmount is derived at your rate. Every payment records rate, rateSource and the official bcvRate, and buyers see **Tasa BCV** or **Tasa de mercado**. | A $100 product | BCV | Market | | --- | --- | --- | | Rate (example) | Bs 876.80 per $1 | Bs 1,009.00 per $1 | | Buyer pays | Bs 87,679.76 | Bs 100,899.90 | | Payment usdAmount | $100.00 | $100.00 | > **WARNING: No fallback to BCV** > > On the market rate, if no fresh market rate is available, bolívar charges return 503 rate_unavailable and the hosted checkout pauses bolívar methods (USDT and COP stay available). The charge is never priced at BCV instead. A change to the setting applies to payments created afterwards; payments already started keep their amount. ## How the median is calculated - Successful numeric BCV rates from available sources are collected. - One rate → that rate is the median. - Two rates → the average of the two (median of an even set). - If sources.bank is unavailable, medianRate equals bcvRate. > **WARNING: Rates are cached briefly** > > BCV sources are cached for about five minutes. Quotes are not a guaranteed lock for a later payment; the payment endpoints fetch (or reuse the cached) rate again at create time. --- # Sell with a payment link > No website needed: create a link in the portal for a fixed amount, share it, and get paid through the VEX Pay hosted checkout. Human docs: /payment-links ## How it works A payment link is a VEX Pay checkout page for one fixed amount in USD. Your customer opens it on their phone, sees your business name, the description and the amount in USD and VES at your Bolívar rate (BCV or market), and pays with the methods your account accepts. The money goes to your own balance, net of your fee — the same as any other payment. 1. **Create the link** — In the portal, open **Payment links**. Enter the amount in USD and what it is for (your customer sees this). Optionally add a private reference and an expiry date. 2. **Share it** — **Copy link** to paste it in WhatsApp or social media, **Share** to use your phone share sheet, or **QR code** to show or print a code your customer scans with their camera. 3. **Get paid** — When your customer pays, the link turns **Paid**, the payment appears on the **Payments** page, and your `payment.*` webhooks fire as usual. ## Link statuses | Status | Meaning | | --- | --- | | Active | Waiting for payment. | | Paid | Paid once. Each link accepts a single payment; anyone opening it afterwards sees that it was already paid. | | Expired | Its expiry passed before anyone paid. It no longer accepts payments. | | Cancelled | You cancelled it. It no longer accepts payments. A paid link cannot be cancelled. | > **NOTE: Need to change the amount?** > > Links cannot be edited. Cancel the link and create a new one. ## Your business profile In the portal, **Business profile** sets how your business appears at the top of the payment page and on the receipt: your logo, business name, RIF, and an optional WhatsApp number and email. Buyers see them under **Pagas a**, followed by **Estás pagando** with the description and a breakdown of the amount, the rate (Tasa BCV or Tasa de mercado) and the total. - Every field is optional. Without a profile the page shows your account name. - Logos can be PNG, JPEG or WebP up to 2 MB; they are shown as a circle, so a square logo looks best. - WhatsApp and email are public — buyers can tap them to contact you. Leave them empty if you prefer not to share them. - Your test account uses the same profile as your live account, and you can set it up before going live. ## Returning buyers pay in one tap On the bolívar methods of the hosted checkout (Débito Inmediato and Pago Móvil) the phone comes first. When a buyer who paid any VEX Pay checkout before, and agreed to be remembered, types their phone, VEX Pay first sends a 6-digit code by WhatsApp to that phone: "Te enviamos un código por WhatsApp al 0414-•••4567". Nothing about the buyer is shown, and their saved details cannot be used, until the right code is entered. Then the page lists each bank they have paid from (up to 5) with the full cédula, name and bank, the most recent one filled into the form. They check it, switch account or edit, and pay with one tap. It works on payment links, product links and checkout sessions, embedded or not, with no change to your integration. | When | What the buyer sees | | --- | --- | | A remembered phone on a new device | The code card: the 6-digit field, **Verificar**, **Reenviar código** (after 60 seconds) and **Pagar sin código**. Nothing else about the buyer. | | After the right code | Every saved account in full, the selected one filled into editable fields, **Quitar** per account and **No soy yo**. This browser is trusted for that phone for 30 days. | | A trusted device (code entered in the last 30 days, in this browser) | No code. The saved banks with the cédula masked as `V-••••5678` and the name as `Ana P.`, payable in one tap, plus **Ver mis datos completos** (asks for a code), **Usar otros datos**, **Olvidar este dispositivo** and **No soy yo**. | | The phone is not on WhatsApp, or WhatsApp is down | A one-line notice and the normal form. | | A phone nobody remembered | The normal form, as before. | | Action | What it does | | --- | --- | | Pay button | Pays from the selected account. Débito Inmediato still asks for the bank OTP; Pago Móvil still has to come from that phone. | | **Pagar sin código** | Closes the code card and leaves the empty form. The payment does not use the saved details (it can still save new ones if the box is ticked). | | **Quitar** | Removes that one saved bank. Removing the last one forgets the buyer. | | **Usar otros datos** | Opens the fields empty. Whatever the buyer types is used; what they leave blank comes from the saved details. | | **Olvidar este dispositivo** | This browser stops skipping the code for that phone. | | **No soy yo · Olvidar mis datos** | Deletes the saved details and every trusted device at once. That phone is no longer recognized at any checkout. | - **Opt-in.** The form has a **Recordar mis datos para la próxima vez** checkbox, ticked by default, with the full consent sentence printed under it: "Guardamos tu cédula, nombre y banco para que tu próximo pago con VEX Pay, en cualquier comercio, sea más rápido." - **What is stored.** The phone, the cédula/RIF, the account holder name (Débito Inmediato only) and the bank code, saved only when a payment with the box ticked **completes**, so the values are ones a bank accepted. Each bank (and cédula) is its own saved account: paying again from it refreshes it, paying from a new bank adds one, and past 5 the least recently used is dropped. - **Across merchants.** A buyer remembered at one business is recognized at every VEX Pay checkout in the same mode (live or test). Live and test details never mix. A trusted device is remembered per browser; on your site in an embedded checkout it can need its own code. - **Code limits.** At most 3 codes per phone and 10 per buyer IP an hour, 60 seconds apart; a code lasts 10 minutes and allows 5 tries. - **Never shared with you.** Saved details are not in your portal, your API reads or your webhooks; your `payment.*` webhooks look exactly as before. - **Forgetting.** The buyer uses **No soy yo**, or unticks the box on their next payment (the details are deleted when it completes). VEX Pay support can also delete them on request, and details unused for 12 months (per saved bank) are deleted automatically. - **Card, USDT, USDC and COP** do not use saved details, and payments created through the payments API never read or change them. > **NOTE: Switched on by VEX Pay** > > Returning buyers are a platform setting. While VEX Pay has it off, the checkout shows no checkbox and recognizes nobody; the only visible change is the phone-first order. Recognition needs WhatsApp sending: without it nobody is recognized, but ticked payments are still remembered for later. ## Who can use payment links Payment links are available to **seller** accounts. Marketplace accounts collect on behalf of their merchants and do not see this page. A live account can create links once it is activated (see Going live); in test mode, links are payable only with test methods and move no real money. > **WARNING: Live links need a verified payout account** > > VEX Pay does not keep your money: each live sale is settled to your verified Pago Móvil payout account as soon as the bank confirms it. Until that account is verified (Portal → Payouts), creating a live link answers 409 `payout_account_required` with `payoutAccountStatus`, and buyers who open one of your links see that it is not available yet. Your links take payments again once the account is verified. Live links charge bolívares by Pago Móvil or C2P only, at your Bolívar rate. Card, stablecoin and peso payments are available in test mode. > **NOTE: Integrating with code instead?** > > To create a checkout per order from your own server, use checkout sessions (POST /v1/checkout/sessions) or the SDKs. Portal payment links are created only from the portal. --- # Collect a C2P payment > C2P is a three-step tenant flow: create an intent (bank SMS when supported), collect the customer’s token, then execute. Human docs: /c2p ## Check which methods you can offer GET /v1/payment-methods lists the bolívar methods your account can take right now — `pago_movil`, `c2p` and `vpos` — each with `available` and, when false, a `reason`: `not_enabled`, `receiving_account_not_configured` (Pago Móvil) or `provider_not_configured`. Cache it for a few minutes and hide what is not available. ### curl ```bash curl "${API_URL}/v1/payment-methods" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### Response ```json { "livemode": true, "methods": [ { "method": "pago_movil", "available": true }, { "method": "c2p", "available": true }, { "method": "vpos", "available": false, "reason": "not_enabled" } ] } ``` ## Three-step lifecycle 1. **Request an intent** — Send the amount, customer identity (cédula), phone, and bank code to POST /v1/payments/c2p/request. When supported, the gateway instructs the payer bank to SMS an OTP (`otpRequested: true`). 2. **Collect the token** — Ask the customer for the 6–8 digit OTP they received from their bank (or generated in their bank app when otpRequested is false). 3. **Execute the charge** — Send the token with the same payment details and returned intentId to POST /v1/payments/c2p. Usually the response is COMPLETED. With some banks the debit is confirmed a little later: the response is then status PENDING, and the final result arrives as payment.completed or payment.failed (usually within minutes, at most 24 hours). Treat PENDING as "processing" and fulfil the order only on payment.completed. ## 1. Request an intent ### curl ```bash curl --request POST "${API_URL}/v1/payments/c2p/request" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "usdAmount": 12.50, "debtorId": "V12345678", "debtorCellPhone": "584121234567", "debtorBankCode": 102, "externalRef": "order_demo_1042" }' ``` > **NOTE: Testing with a Test key** > > With a Test key, C2P never reaches a real bank: it runs on VEX Pay’s sandbox (or the bank’s test environment where one exists). Use the current code from Portal → Sandbox (Authenticator OTP) as the token; any other token fails the payment. Test webhooks go to endpoints registered with your Test key and carry livemode: false. > **NOTE: Lock a bolívar amount with vesAmount** > > Send vesAmount instead of usdAmount to charge an exact bolívar amount (for example one you quoted at your own rate); usdAmount is then derived at your Bolívar rate. The intent keeps that amount: executing it with intentId charges exactly the same Bs even if the BCV rate changes within the 15 minutes. On execute, amounts are optional; if you send them they must match the intent (±0.01), otherwise 400 invalid_data. > **NOTE: Bank OTP** > > A successful intent returns otpRequested: true when the bank was instructed to SMS the customer. If OTP generation fails, the intent is marked FAILED and the API returns the bank error. > **NOTE: Intent lifecycle** > > Send externalRef on checkout orders. Creating another C2P intent with the same externalRef cancels prior PENDING intents for that order (cancelReason: superseded) and fires payment.canceled. Unused PENDING intents expire after 15 minutes (cancelReason: expired). Always execute with the latest intentId. ## 2. Execute with the token ### curl ```bash curl --request POST "${API_URL}/v1/payments/c2p" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "intentId": "00000000-0000-4000-8000-000000000000", "usdAmount": 12.50, "debtorId": "V12345678", "debtorCellPhone": "584121234567", "debtorBankCode": 102, "token": "123456", "externalRef": "order_demo_1042" }' ``` ### JavaScript ```javascript const payment = await fetch( `${process.env.API_URL}/v1/payments/c2p`, { method: 'POST', headers: { 'content-type': 'application/json', 'x-api-key': process.env.VEXPAY_API_KEY, }, body: JSON.stringify({ intentId, usdAmount: 12.5, debtorId: 'V12345678', debtorCellPhone: '584121234567', debtorBankCode: 102, token: customerProvidedToken, externalRef: 'order_demo_1042', }), } ); ``` > **WARNING: Correlation is not idempotency** > > externalRef helps correlate your order with a payment. It is not an idempotency key: each request creates a new intent and supersedes prior PENDING ones for that ref. Persist the returned intentId and execute only that intent. Once a payment with that externalRef is COMPLETED, a new C2P, VPOS or débito charge with the same externalRef is refused with 409 external_ref_already_paid (the body carries the paid paymentId); retries after FAILED, CANCELED, REVERSED or expired are allowed, and repeated amounts are fine. --- # Accept a VPOS card payment > Submit card details from a PCI-appropriate server flow. Human docs: /vpos ## Create a payment > **WARNING: Card payments are temporarily unavailable** > > Card payments (VPOS) are temporarily unavailable. The endpoint answers 400 until they return. > **WARNING: Card data is sensitive** > > Do not log card numbers, CVV, PIN, or request bodies. Confirm your PCI DSS scope before collecting card data. ### curl ```bash curl --request POST "${API_URL}/v1/payments/vpos" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "usdAmount": 24.00, "cardNumber": "4111111111111111", "expirationMonth": 12, "expirationYear": 2030, "cvv": "123", "cardHolderName": "CLIENTE PRUEBA", "cardHolderId": "V12345678", "accountType": 0, "cardType": 1, "externalRef": "order_demo_1043" }' ``` accountType accepts 0, 10, or 20. cardType accepts 1, 2, or 3. cardPin is optional (4 digits); when omitted the gateway sends 0000. Debit or credit pricing is determined from the card and the account type the buyer selects: accountType 10 or 20 is charged the debit rate and accountType 0 the credit rate, but a card VEX Pay knows to be a credit card is always charged the credit rate. Without an accountType, VEX Pay goes by the card, and a card it can’t identify is charged the credit rate (see /pricing). > **NOTE: Lock a bolívar amount with vesAmount** > > Pass either usdAmount (VES derived at your Bolívar rate) or vesAmount (locks the bank charge; USD derived). Use vesAmount when the customer must pay an exact Bs. figure — two-decimal USD cannot round-trip every VES amount (e.g. Bs. 50 → $0.07 → Bs. 52.86). > **NOTE: Declined for risk (429)** > > If our risk checks decline an attempt, the API returns **429** with code `CARD_VELOCITY_BLOCKED` and the payment is recorded as failed (a `payment.failed` webhook fires). The card was not charged. Ask the customer to try again later or use another payment method. The response does not say which check declined it. ## Test card With a Test key, real cards are declined and never charged. You have two kinds of test card: this Débito Maestro card, which is sent to the bank's test environment and always succeeds, and the test card scenarios below, which return each approval and decline. Both are shown in your portal under Sandbox. | Field | Value | | --- | --- | | Card brand | Débito Maestro | | cardNumber | 6276093058088765 | | expirationMonth / expirationYear | 12 / 2025 | | cvv | 467 | | cardPin | 1234 | | cardHolderName | Julian Esteves | | cardHolderId | V23000760 | | accountType | 20 | | cardType | 3 | ### curl ```bash curl --request POST "${API_URL}/v1/payments/vpos" \ --header "content-type: application/json" \ --header "x-api-key: YOUR_TEST_API_KEY" \ --data '{ "vesAmount": 32.95, "cardNumber": "6276093058088765", "expirationMonth": 12, "expirationYear": 2025, "cvv": "467", "cardPin": "1234", "cardHolderName": "Julian Esteves", "cardHolderId": "V23000760", "accountType": 20, "cardType": 3, "externalRef": "test_card_1" }' ``` > **WARNING: Test keys only** > > Never send a test card with a Live key (it is refused with 400 `test_card_in_live_mode`), and never send a real card with a Test key — Live charges move real money, Test charges never do. **Test card scenarios.** Like Stripe test cards: with a Test key, these numbers get a fixed answer from VEX Pay without reaching the bank, so you can drive every outcome your checkout must handle. Use any expiry in the future and any CVV. Send `cardPin` `1234` or no PIN. | cardNumber | Scenario | Result | | --- | --- | --- | | `4242424242424242` | Succeeds (credit card) | `COMPLETED` payment | | `4000056655665556` | Succeeds (debit card) | `COMPLETED` payment | | `4000000000009995` | Insufficient funds | 422 `G51` | | `4000000000005506` | Incorrect PIN | 422 `G55` | | `4000000000000382` | PIN tries exceeded | 422 `G38` | | `4000000000000069` | Expired card | 422 `G54` | | `4000000000009987` | Lost card | 422 `G41` | | `4000000000009979` | Stolen card | 422 `G43` | | `4100000000000019` | Suspected fraud | 422 `G59` | | `4000000000000366` | Restricted card | 422 `G36` | | `4000000000000580` | Transaction not permitted | 422 `G58` | | `4000000000000002` | Refer to issuing bank | 422 `G02` | | `4000000000000119` | Bank system malfunction | 422 `G96` | | `4000000000000689` | Late bank response | 422 `G68` | | `4000000000000259` | Succeeds, then is charged back | `COMPLETED`, then `payment.chargeback` | - A decline behaves exactly like a Live one: HTTP 422 with the bank code in `code`, the payment `FAILED` with the same `failureCode`, and a `payment.failed` webhook. - An approval completes like a Live charge: `payment.completed`, your ledger credit, and the fee for that card type (the debit card uses your debit rate, the others your credit rate). - On any test card, an expiry in the past declines with `G54`, and a `cardPin` other than `1234` declines with `G55`. - `4000000000000259` completes, then receives a full chargeback within about a minute: `payment.chargeback` and `payment.reversed` fire, and your Test balance is debited. - Declines count toward the card-testing protection: after 3 different failed cards for one `cardHolderId` within 24 hours, that payer gets 429 `CARD_VELOCITY_BLOCKED` for the next 24 hours. Use a different `cardHolderId` for each test run. - Hosted checkouts and payment links in Test show a "Tarjetas de prueba" list that fills in the card form. --- # Verify a Pago Móvil transfer > Show customers the account to pay into, then match their transfer reference against bank records. Human docs: /pago-movil ## Pago Móvil in the hosted checkout Hosted checkouts, payment links and checkout sessions can offer **Pago Móvil** next to card and **Débito Inmediato** (the bank debit with an OTP, `c2p`). The buyer sends the Pago Móvil from their own bank app and VEX Pay confirms it automatically — you do not call verify yourself. 1. **The buyer enters their details** — Cédula or RIF and the phone they will pay from. 2. **VEX Pay shows where to pay** — The bank, phone and RIF to send to, and the **exact** bolívar amount, each with a copy button. The amount is priced at your Bolívar rate (BCV or market) when the buyer starts. 3. **The buyer pays from their bank app** — From the same phone they entered. VEX Pay matches the incoming transfer on phone, amount and time, completes the payment and fires `payment.completed` — usually within seconds. 4. **Fallback: bank and reference** — If the buyer paid from another phone and nothing is confirmed after 5 minutes, they pick the bank they paid from and type the bank reference to confirm it. ### Only Pago Móvil ```bash curl --request POST "${API_URL}/v1/checkout/sessions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": 10.00, "methods": ["pago_movil"] }' ``` > **NOTE: 15 minutes to pay** > > An unpaid Pago Móvil expires after 15 minutes and fires `payment.failed` with failureCode `expired`. A transfer that arrives after that is not credited automatically — contact VEX Pay support with the reference. > **NOTE: Availability** > > `pago_movil` is offered by default once Pago Móvil is enabled on your account. Asking for it explicitly when it is not enabled returns 400 `invalid_data`. > **WARNING: Testing with a Test key** > > In Test mode the checkout shows placeholder receiving details — never send real money to them. Press **Simular pago recibido** on the waiting screen to complete the payment: you get `payment.completed` with `livemode: false` and a `TEST…` reference. Live payments need a real transfer. ## Show the customer where to pay Before the customer opens their banking app, show them the account to send the Pago Móvil to. The bank, phone and identification come from GET /v1/payments/pago-movil/receiving-account — never hard-code them. ### curl ```bash curl "${API_URL}/v1/payments/pago-movil/receiving-account" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### Node ```javascript const account = await vexpay.payments.pagoMovil.receivingAccount(); if (account.configured) { // Show: account.bankName (account.bankCode), account.phone, account.identification } ``` ### Python ```python account = vexpay.payments.pago_movil.receiving_account() if account.configured: # Show: account.bankName (account.bankCode), account.phone, account.identification ... ``` ### Response shape ```json { "provider": "…", "bankCode": "0000", "bankName": "Banco receptor", "phone": "04125555555", "identification": "13536734", "configured": true, "missing": [], "livemode": true } ``` > **NOTE: configured: false means do not offer Pago Móvil yet** > > If a receiving detail is not set up for your provider, the response is still 200 with configured: false, the unknown fields as null and missing listing them (for example ["phone"]). Hide the Pago Móvil option until configured is true and contact VEX Pay support — once VEX Pay saves the account it is returned on your next request, no redeploy needed. > **NOTE: Send USDT to your user instead** > > Add `onwardPayout` to the verify request and VEX Pay converts the payment's net VES to USDT and sends it to a wallet when the payment completes. See Pay in bolívars, receive USDT. The account follows your Pago Móvil routing: the same provider POST /v1/payments/pago-movil/verify uses for your enabled and default providers, skipping any provider not allowed Pago Móvil on your account. There is no override, so what you show is always the account verify checks. Fetch it at checkout time or cache it briefly; it changes only when your provider routing does. ## Verify the reference ### curl ```bash curl --request POST "${API_URL}/v1/payments/pago-movil/verify" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "usdAmount": 8.75, "reference": "12345678", "dateMovement": "2026-07-20", "externalRef": "order_demo_1044" }' ``` reference must contain 4–32 digits. dateMovement is optional and uses YYYY-MM-DD. Send the reference exactly as the customer’s bank receipt shows it, or at least its last 6 digits: banks number the same transfer differently, so when the transfer is confirmed from the bank’s notification, VEX Pay matches on the last 6 digits. If the customer sent more bolívars than requested, the payment completes for the amount actually received — read vesAmount and usdAmount from the receipt, not from your request. Sending less still fails with an amount mismatch. > **NOTE: Confirmation can lag a few seconds** > > Depending on the receiving bank, a transfer is confirmed either by a live query or by the bank’s own notification to VEX Pay, so right after a genuine transfer you can get "not found" for a few seconds while that notification is still in flight. On an HTTP 400 "not found" response (the payment is recorded as FAILED with failureCode MOVEMENT_NOT_FOUND), retry with backoff (e.g. every 3–5s for up to ~60–90s) before telling the customer to wait or contact support — retries cost nothing extra and cover the notification lag. An amount-mismatch error is safe to retry once the customer corrects the amount; a successful 200 is not — don’t call verify again for a reference that already succeeded, use GET /v1/payments/by-ref/:externalRef to re-check status instead. --- # Run an immediate debit > Debit bolívares from a payer’s bank account: request a bank OTP, collect it from your customer, execute the debit, and receive webhooks when a pending (AC00) operation settles. Human docs: /debito-inmediato ## What débito inmediato is Débito inmediato pulls bolívares from a payer’s bank account after the bank SMS’s a one-time code. Amounts are in Bs. (VES). The execute response uses the banking-network operation payload, and the gateway stores a payment you can recover by externalRef. When the bank returns AC00 (pending), the gateway polls ConsultarOperaciones and fires payment.completed or payment.failed when the operation settles. | Step | Endpoint | | --- | --- | | 1. Request OTP | POST /v1/payments/debit/otp | | 2. Execute debit | POST /v1/payments/debit | | 3. Optional manual poll | GET /v1/payments/operations/:id | > **NOTE: C2P vs débito inmediato** > > Prefer C2P when you want an intent lifecycle with OTP on the C2P path. Use débito inmediato for a direct bolívar debit with bank OTP. Both fire payment.completed / payment.failed webhooks when the payment settles. ## 01. Authenticate Call the gateway with your tenant API key. Keep the key on your server—never ship it in browser or mobile code. ### .env ```bash API_URL=https://api.vexpay.app VEXPAY_API_KEY=vk_live_replace_me ``` > **WARNING: Live banking network** > > OTP generation and debit execution reach the banking network for your commerce. Use approved test data when available, and treat every successful debit as a real transfer of funds. ## 02. Three-step lifecycle 1. **Request the debit authorization code** — POST /v1/payments/debit/otp with banco, monto (VES), telefono, and cedula. Success typically returns code 202. The payer’s bank SMS’s the OTP. 2. **Collect the OTP from the payer** — Ask the customer for the 6–8 digit code from their bank SMS (or bank app). Your application owns this step—the gateway does not forward the OTP to you. 3. **Execute the debit** — POST /v1/payments/debit with the same payer fields plus nombre, otp, concepto, and optional externalRef. ACCP means accepted (payment.completed webhook). AC00 means pending—the gateway polls until ACCP or a terminal Guía V3.0 reject code, then fires payment.completed or payment.failed. On timeout, recover with GET /v1/payments/by-ref/:externalRef. ## 1. Request OTP POST /v1/payments/debit/otp — send this JSON body. The payer bank SMS’s the code to telefono. | Field | Description | Example | | --- | --- | --- | | banco | Payer bank (SIMF), 4 digits | 0191 | | monto | Amount in Bs. (VES) | 50.00 | | telefono | Payer phone (584XXXXXXXXXX) | 584144555555 | | cedula | Payer ID document | V12345678 | ### Request body ```json { "banco": "0191", "monto": 50.00, "telefono": "584144555555", "cedula": "V12345678" } ``` ### curl ```bash curl --request POST "https://api.vexpay.app/v1/payments/debit/otp" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "banco": "0191", "monto": 50.00, "telefono": "584144555555", "cedula": "V12345678" }' ``` ## 2. Execute the debit POST /v1/payments/debit — same payer fields as OTP, plus nombre, otp (from the bank SMS), concepto, and optional externalRef for recovery lookup. | Field | Description | Example | | --- | --- | --- | | banco | Payer bank (SIMF), 4 digits | 0191 | | monto | Amount in Bs. (VES) | 50.00 | | telefono | Payer phone (584XXXXXXXXXX) | 584144555555 | | cedula | Payer ID document | V12345678 | | nombre | Payer name, max 20 chars | Maria Perez | | otp | Code from payer bank SMS, 6–8 digits | 19807849 | | concepto | Payment description, max 30 chars | pago Condominio1 | | externalRef | Optional correlation id for timeout recovery (max 64). Not an idempotency key, but a ref that already has a COMPLETED payment is refused (409 external_ref_already_paid). | fine_736a0b42-0b6e-454c-b87e-7f3c0e47057b | ### Request body ```json { "banco": "0191", "monto": 50.00, "telefono": "584144555555", "cedula": "V12345678", "nombre": "Maria Perez", "otp": "19807849", "concepto": "pago Condominio1", "externalRef": "fine_736a0b42-0b6e-454c-b87e-7f3c0e47057b" } ``` ### curl ```bash curl --request POST "https://api.vexpay.app/v1/payments/debit" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "banco": "0191", "monto": 50.00, "telefono": "584144555555", "cedula": "V12345678", "nombre": "Maria Perez", "otp": "19807849", "concepto": "pago Condominio1", "externalRef": "fine_736a0b42-0b6e-454c-b87e-7f3c0e47057b" }' ``` ### Accepted (ACCP) ```json { "code": "ACCP", "reference": "16142940", "id": "6785d97e-2092-49f0-9f7d-3d5921f0b13f", "paymentId": "3fd84b2d-9ad1-4f74-a2d9-0f2f56984db5", "externalRef": "fine_736a0b42-0b6e-454c-b87e-7f3c0e47057b" } ``` ### Pending (AC00) ```json { "code": "AC00", "message": "Operación en Espera de Respuesta del Receptor", "Id": "e63a7892-f00f-46a4-b7d1-a6e8ac7ab094", "paymentId": "3fd84b2d-9ad1-4f74-a2d9-0f2f56984db5", "externalRef": "fine_736a0b42-0b6e-454c-b87e-7f3c0e47057b" } ``` > **NOTE: Recover with externalRef** > > If execute times out (slow bank, redeploy mid-request), call GET /v1/payments/by-ref/:externalRef and adopt the debit that completed late. Without externalRef, a timeout leaves the payment in limbo until you match a receipt id manually. Same correlation pattern as C2P. > **NOTE: Operation id field** > > The response may include id or Id. Persist whichever is present. On AC00 the gateway polls that id automatically; you can also call GET /v1/payments/operations/:id for debugging. ## 3. Pending operations (AC00) When the debit returns AC00, the payment stays PENDING and you receive payment.pending. The gateway polls ConsultarOperaciones about once a minute until ACCP (payment.completed) or a terminal Guía V3.0 reject code (payment.failed)—there is no timeout, so slow bank settlement still completes and notifies. Subscribe to those webhook events—you do not need to poll yourself. > **NOTE: Terminal vs transient poll codes** > > Only catalog reject codes from the bank rails (for example AM04, BE01, RJCT) permanently fail the payment. Transient ConsultarOperaciones errors such as 108 (“No permitido” / Id not ready) keep the operation open so a later poll can still settle to ACCP. Treat payment.failed as final; ignore intermediate consult noise. > **NOTE: Optional manual poll** > > GET /v1/payments/operations/:id remains available for Lab and recovery. A successful settle from this endpoint also fires the same webhooks (idempotent—only the first PENDING → terminal transition notifies). ### curl ```bash curl "https://api.vexpay.app/v1/payments/operations/OPERATION_ID" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ## Recover by externalRef After a timeout or uncertain execute response, look up the latest payment for your correlation id. The receipt includes status, paymentId, bankReference, and the externalRef you sent. ### curl ```bash curl "https://api.vexpay.app/v1/payments/by-ref/fine_736a0b42-0b6e-454c-b87e-7f3c0e47057b" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ## How to read the outcome | code | Meaning | Next action | | --- | --- | --- | | 202 | OTP generation accepted | Collect the OTP from the payer, then debit | | ACCP | Debit (or poll) accepted | Fulfill; payment.completed webhook fires | | AC00 | Awaiting receiving bank | Wait for gateway poll + payment.completed or payment.failed | | HTTP 422 + bankCode | Bank rejected the operation | Inspect bankCode; do not retry unchanged | | HTTP 503 | Payment service unavailable | Retry later after confirming status via by-ref | > **NOTE: Webhooks and lookup** > > Each debit creates a payment record (method DEBITO_INMEDIATO). Subscribe to payment.pending, payment.completed, and payment.failed. Send externalRef so you can recover with GET /v1/payments/by-ref/:externalRef after timeouts. Reject codes for débito, crédito inmediato, and domiciliación. The API returns these as HTTP 422 with the bank code in bankCode, and stores failureCode on the payment. | code | Message | | --- | --- | | AB01 | Tiempo de espera agotado | | AB07 | Agente fuera de línea | | AC01 | Número de cuenta incorrecto | | AC04 | Cuenta cancelada | | AC06 | Cuenta bloqueada | | AC09 | Moneda no válida | | AG01 | Transacción Restringida | | AG09 | Pago no recibido | | AG10 | Agente suspendido o excluido | | AM02 | Monto de la transacción no permitido | | AM04 | Saldo insuficiente | | AM05 | Operación duplicada | | BE01 | Datos del cliente no corresponden a la cuenta | | BE20 | Longitud del nombre invalida | | CH20 | Número de decimales incorrecto | | CUST | Cancelación solicitada por el deudor | | DS02 | Operación Cancelada | | DT03 | Fecha de procesamiento no bancaria no válida | | DU01 | Identificación de mensaje duplicado | | ED05 | Liquidación Fallida | | FF05 | Código del producto incorrecto | | FF07 | Código del sub producto incorrecto | | MD01 | No posee afiliación | | MD09 | Afiliación inactiva | | MD15 | Monto incorrecto | | MD22 | Afiliación suspendida | | RC08 | Código del Banco no existe en compensación | | RJCT | Operación Rechazada | | TKCM | Código único de operación de débito incorrecto | | VE01 | Fuera del horario permitido | | TM01 | Rechazo técnico | ## Next steps - Configure webhook endpoints for payment.completed and payment.failed (/webhooks). - Compare with C2P when you need payment intents (/c2p). - See credit, disbursement, and change under Advanced payments (/advanced-payments). - Explore the interactive API reference at /api-reference. --- # Debit, credit, and disbursement > Authorize debits, send credits, disburse funds, and poll pending operations. Human docs: /advanced-payments ## Choose the right payment API Use the C2P flow for customer-authorized collections. Use the advanced payment endpoints for immediate debits, credits, disbursements, payouts, and change. > **WARNING: Per-account method limits** > > If VEX Pay ops have limited your account (for example, to Pago Móvil only), the débito endpoints return 403 when Débito Inmediato is not enabled, and the credit, disburse, payouts and change endpoints return 403 unless VEX Pay ops have explicitly enabled direct Crédito Inmediato on your account. No bank call is made. Test keys are never restricted on the débito endpoints, but the direct crédito endpoints always return 403 in Test — use POST /v1/payouts to send funds. > **NOTE: Débito inmediato walkthrough** > > For a step-by-step OTP → debit → webhook guide (including AC00 auto-poll), see Débito inmediato at /debito-inmediato. > **NOTE: Advanced operation responses** > > These operations return the banking-network operation payload. For débito AC00, the gateway polls and fires webhooks; manual GET /v1/payments/operations/:id remains optional. ## Available operations | Endpoint | Purpose | | --- | --- | | POST /v1/payments/debit/otp | Issue the customer debit authorization code | | POST /v1/payments/debit | Execute an immediate debit | | GET /v1/payments/operations/:id | Poll a pending payment operation | | POST /v1/payments/credit | Credit by phone and identity | | POST /v1/payments/credit/account | Credit a 20-digit bank account | | POST /v1/payments/credit/disburse | Disburse credits to multiple recipients | | POST /v1/payments/payouts | Disburse account payments | | POST /v1/payments/change | Send change to a customer | ### Generate debit authorization ```bash curl --request POST "${API_URL}/v1/payments/debit/otp" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "banco": "0191", "monto": 50, "telefono": "584121234567", "cedula": "V12345678" }' ``` --- # Embed checkout with @vexpay/js > Mount VEX Pay hosted checkout in an iframe so card and OTP data never touch your page. Human docs: /browser-checkout ## Create a session on your server Call `POST /v1/checkout/sessions` (or `vexpay.checkout.sessions.create`) with `amountUsd` and `allowedOrigins` for the pages that will embed the checkout. Return only `clientSecret` to the browser — never your API key. ## Mount in the browser ### JavaScript ```javascript import { checkout } from '@vexpay/js'; const cx = checkout({ clientSecret }); cx.on('ready', () => console.log('checkout ready')); cx.on('completed', ({ sessionId, paymentId }) => { // Advisory — confirm on your server before fulfilling }); cx.on('error', ({ code }) => console.error(code)); cx.mount('#pay'); // Pages that cannot iframe: redirectToCheckout({ clientSecret }) ``` > **WARNING: Server confirmation is authoritative** > > Browser events are advisory. Fulfill only after a payment.* webhook or GET /v1/checkout/sessions/:id shows paid. > **NOTE: Origin restriction** > > The checkout only renders when the embedding origin is listed in allowedOrigins. Unlisted origins get an origin_not_allowed error and no payment form. --- # Products and no-code payment links > Create products and shareable payment links for the hosted checkout at /pay/:slug. Buyers can pay with every method your account accepts (bolívares, card, USDT/USDC, COP — whichever are enabled); VEX Pay’s cut is captured as PLATFORM_FEE on payment.completed. Human docs: /products ## Endpoints > **WARNING: Card payments are temporarily unavailable** > > Card payments (VPOS) are temporarily unavailable. The endpoint answers 400 until they return. | Method | Path | Purpose | | --- | --- | --- | | POST | /v1/products | Create a product (name, priceUsd, optional description / imageUrl / active). | | GET | /v1/products | List products (cursor pagination; ?active=true\|false). | | GET | /v1/products/:id | Get a product and its payment links. | | PATCH | /v1/products/:id | Update fields — send only what changes; "" clears description / imageUrl. | | DELETE | /v1/products/:id | Delete product + its links. 409 product_has_sales if a checkout was paid. | | POST | /v1/products/:id/links | Create a payment link. Omit slug to auto-generate from the product name. | | GET | /v1/products/:id/links | List a product’s payment links. | | GET | /v1/payment-links/:id | Get one payment link. | | PATCH | /v1/payment-links/:id | Enable/disable (status), toggle allowQuantity, set maxQuantity / redirectUrl. | | DELETE | /v1/payment-links/:id | Delete a link. 409 product_has_sales if a checkout on it was paid — disable instead. | ### Create a product ```bash curl --request POST "${API_URL}/v1/products" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "name": "Camiseta VEX Pay", "priceUsd": "20.00" }' ``` ### Create a payment link ```bash curl --request POST "${API_URL}/v1/products/PRODUCT_ID/links" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "allowQuantity": true, "maxQuantity": 5 }' ``` ### Payment link response ```json { "id": "…", "productId": "…", "slug": "camiseta-vexpay-40753a", "hostedCheckoutPath": "/pay/camiseta-vexpay-40753a", "status": "active", "allowQuantity": true, "maxQuantity": 5, "redirectUrl": null, "createdAt": "…" } ``` > **NOTE: Selling** > > Share the hosted checkout URL — your checkout host + hostedCheckoutPath. The buyer flow (GET /checkout/:slug, POST /checkout/:slug/session, POST /checkout/:slug/confirm) is public and needs no API key. --- # Subscriptions and recurring billing > Charge customers every day, week, month or year. Prices are in dollars; each invoice is paid in bolívares at the day’s rate, by link or by automatic debit. VEX Pay issues the invoices, emails your customers, retries and cancels for you. Human docs: /subscriptions ## What you get Subscriptions turn a one-time sale into recurring revenue without building a billing system. You define the plan once; VEX Pay creates an invoice every period, sends it to your customer in your name, collects it, follows up when it is not paid, and tells your server about every step with webhooks. - **Prices in dollars, paid in bolívares.** A plan costs `10.00` USD; the customer pays the Bs equivalent at your account’s current rate (BCV or market, whichever your account uses) at the moment they pay, so your revenue does not lose value between periods. - **Two ways to collect.** `send_invoice` emails a payment link every period (Pago Móvil, Débito Inmediato, card, stablecoins or Colombian pesos — whatever your account accepts). `charge_automatically` debits the customer’s bank account by **domiciliación**: they authorize once, then pay nothing by hand. See /domiciliacion. - **A hosted invoice page.** Every invoice has its own payment page; you never handle payment screens for renewals. - **Emails in Spanish, sent in your name.** Invoices, reminders, receipts and charge notices go out as “ vía VEX Pay”, with replies going to your business email. - **Dunning built in.** Every invoice gets daily collection attempts: the first when it is issued, then one a day (3 in total by default, up to 15). If it is still unpaid after the last one, the subscription is canceled — and comes back on its own if the customer pays that invoice late. - **Trials, cancel at period end, metadata and cursor pagination**, with an API shaped like the billing APIs you already know. | Good fit | Example | | --- | --- | | Memberships | A gym charging $25 a month | | Classes and tutoring | A school charging $40 every 4 weeks | | Software and media | A SaaS plan at $15 a month, or $150 a year | | Services | Weekly cleaning, monthly maintenance, internet service | ## How it works | Object | What it is | Id | | --- | --- | --- | | Product | What you sell (you may already have it for payment links) | UUID | | Price | How much and how often: a USD amount and an interval (`day`, `week`, `month`, `year`) × `intervalCount` | `price_…` | | Customer | Who pays: name, email, and optionally phone, cédula/RIF and bank | `cus_…` | | Subscription | A customer on a price, with a collection method and status | `sub_…` | | Invoice | What is owed for one period, with its hosted payment page | `in_…` | | Setup session | A 24-hour link where the customer authorizes domiciliación | `seti_…` | | Payment method | The customer’s authorized domiciliación | `pm_…` | 1. **You create the subscription** — The first period starts now (or when the trial ends). VEX Pay issues the first invoice immediately. 2. **The invoice is collected** — With `send_invoice` the customer receives an email with the payment link. With `charge_automatically` VEX Pay debits their account. 3. **It is paid** — The invoice becomes `paid`, the money lands in your balance like any other payment, the customer gets a receipt, and you get `invoice.paid`. 4. **The next period starts** — At the end of each period the next one starts and a new invoice is issued. Periods are counted from the start date, so a subscription that starts on the 31st renews on the last day of shorter months. ## Quickstart: your first subscription Use your **Test key**: nothing is charged, and emails are only delivered to your own business-profile email (see Test mode below). Call the API from your server with curl or one of the SDKs. ### 1. Product ```bash curl --request POST "${API_URL}/v1/products" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "name": "Plan Pro", "priceUsd": "25.00" }' # → { "id": "PRODUCT_ID", ... } ``` ### 2. Price ```bash curl --request POST "${API_URL}/v1/prices" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "product": "PRODUCT_ID", "unitAmountUsd": 25, "recurring": { "interval": "month", "intervalCount": 1 }, "nickname": "Pro mensual" }' # → { "id": "price_…", "unitAmountUsd": "25.00", "currency": "USD", ... } ``` ### 3. Customer ```bash curl --request POST "${API_URL}/v1/customers" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "name": "Ana Pérez", "email": "ana@example.com", "phone": "04141234567", "idNumber": "V12345678", "metadata": { "userId": "u_981" } }' # → { "id": "cus_…", ... } ``` ### 4. Subscription ```bash curl --request POST "${API_URL}/v1/subscriptions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "customer": "cus_…", "price": "price_…", "collectionMethod": "send_invoice" }' ``` ### Node SDK ```javascript const product = await vexpay.products.create({ name: 'Plan Pro', priceUsd: '25.00' }); const price = await vexpay.prices.create({ product: product.id, unitAmountUsd: 25, recurring: { interval: 'month', intervalCount: 1 }, nickname: 'Pro mensual', }); const customer = await vexpay.customers.create({ name: 'Ana Pérez', email: 'ana@example.com', metadata: { userId: 'u_981' }, }); const subscription = await vexpay.subscriptions.create({ customer: customer.id, price: price.id, collectionMethod: 'send_invoice', }); ``` ### Python SDK ```python product = vexpay.products.create({"name": "Plan Pro", "priceUsd": "25.00"}) price = vexpay.prices.create({ "product": product.id, "unitAmountUsd": 25, "recurring": {"interval": "month", "intervalCount": 1}, "nickname": "Pro mensual", }) customer = vexpay.customers.create({ "name": "Ana Pérez", "email": "ana@example.com", "metadata": {"userId": "u_981"}, }) subscription = vexpay.subscriptions.create({ "customer": customer.id, "price": price.id, "collectionMethod": "send_invoice", }) ``` ### PHP SDK ```php $product = $vexpay->products->create(['name' => 'Plan Pro', 'priceUsd' => '25.00']); $price = $vexpay->prices->create([ 'product' => $product->id, 'unitAmountUsd' => 25, 'recurring' => ['interval' => 'month', 'intervalCount' => 1], 'nickname' => 'Pro mensual', ]); $customer = $vexpay->customers->create([ 'name' => 'Ana Pérez', 'email' => 'ana@example.com', 'metadata' => ['userId' => 'u_981'], ]); $subscription = $vexpay->subscriptions->create([ 'customer' => $customer->id, 'price' => $price->id, 'collectionMethod' => 'send_invoice', ]); ``` ### Response ```json { "id": "sub_3fd84b2d9ad14f74a2d90f2f56984db5", "object": "subscription", "customer": "cus_…", "price": { "id": "price_…", "unitAmountUsd": "25.00", "currency": "USD", "recurring": { "interval": "month", "intervalCount": 1 }, ... }, "status": "active", "collectionMethod": "send_invoice", "collectionAttempts": null, "paymentMethod": null, "currentPeriodStart": "2026-10-21T14:00:00.000Z", "currentPeriodEnd": "2026-11-21T14:00:00.000Z", "trialStart": null, "trialEnd": null, "cancelAtPeriodEnd": false, "canceledAt": null, "cancellationReason": null, "latestInvoice": "in_…", "methods": [], "metadata": {}, "createdAt": "2026-10-21T14:00:00.000Z", "livemode": false } ``` The first invoice exists already: read it with `GET /v1/invoices?subscription=sub_…` and open its `hostedInvoiceUrl` to see what your customer sees. In live mode Ana also receives it by email; in test mode the email is only delivered if the customer’s email is your business-profile email. > **NOTE: Try renewals in minutes, not months** > > Put the customer on a test clock (see Test clocks below) and move time forward: renewals, collection attempts, `past_due` and cancellation happen in seconds, with every webhook. > **SUCCESS: Prefer a guided walkthrough?** > > The subscriptions recipe (/recipe-subscriptions) builds a complete membership business step by step: plans, sign-up, webhooks, automatic charging and go-live. ## Prices A price belongs to a product and fixes the amount and the cycle. The same product can have several prices — monthly and yearly, for example. | Field | Rules | | --- | --- | | `unitAmountUsd` | Dollars, up to 2 decimals, at least your account’s minimum charge (otherwise 422 `amount_below_minimum`) and at most 100,000. | | `recurring.interval` | `day`, `week`, `month` or `year`. | | `recurring.intervalCount` | Default 1. The whole cycle can be at most one year: up to 365 days, 52 weeks, 12 months or 1 year. Every 2 weeks is `{ "interval": "week", "intervalCount": 2 }`. | | `nickname`, `metadata` | Optional; your own labels (metadata: up to 20 string pairs). | Amount, cycle and product never change once the price exists — changing them answers 400. To raise a price, create a new price and archive the old one with `POST /v1/prices/:id` and `{ "active": false }`. Existing subscriptions keep their price; new ones cannot use an archived price (`price_inactive`). ## Customers | Field | Why it matters | | --- | --- | | `email` | Required for `send_invoice` — it is where invoices go. `emailStatus` becomes `undeliverable` if the address bounces; update the email to try again. | | `phone`, `idNumber`, `bankCode` | Optional. They prefill the domiciliación authorization page, so the customer types less. | | `name`, `metadata` | Shown in your portal; use metadata to store your own user id. | Update with `POST /v1/customers/:id` (send `null` to clear a field). `DELETE /v1/customers/:id` removes a customer with no live subscription; otherwise it answers 409 `customer_has_active_subscriptions`. Find a customer by email with `GET /v1/customers?email=ana@example.com`. ## Subscriptions | Field | Meaning | | --- | --- | | `customer`, `price` | Required. The price must be active. | | `collectionMethod` | `send_invoice` (default) or `charge_automatically`. | | `collectionAttempts` | 1–15 daily attempts per invoice before the subscription is canceled. Omit (or `null`) to use your account default, 3 unless you change it in **Portal → Billing → Settings**. | | `paymentMethod` | `charge_automatically` only: the `pm_…` to debit. Default: the customer’s most recent domiciliación that is not inactive. | | `trialPeriodDays` or `trialEnd` | A free trial: 1–730 days, or an ISO date up to 730 days ahead. No invoice until it ends. | | `cancelAtPeriodEnd` | `true` ends the subscription when the current period finishes, with no new invoice. | | `methods` | Which hosted checkout methods its invoices offer: `pago_movil`, `c2p`, `vpos`, `usdt`, `usdc`, `cop`. Omit to offer every method your account accepts. | | `metadata` | Your own key/value pairs. | | Status | Meaning | | --- | --- | | `trialing` | In the free trial. | | `active` | Paid up, or its invoice was issued less than a day ago. | | `past_due` | An invoice is unpaid one day after it was issued. Collection attempts continue. | | `canceled` | Ended. `cancellationReason` is `requested` (by you or at period end) or `payment_failed` (no payment after the last attempt). | | To… | Call | | --- | --- | | List | `GET /v1/subscriptions?customer=cus_…&status=past_due&limit=25` — newest first; pass `nextCursor` as `cursor` for the next page. | | Cancel at period end | `POST /v1/subscriptions/:id` with `{ "cancelAtPeriodEnd": true }` (send `false` to undo). | | Cancel now | `DELETE /v1/subscriptions/:id`. Open invoices are voided. | | Switch collection method | `POST /v1/subscriptions/:id` with `{ "collectionMethod": "charge_automatically" }` (or back to `send_invoice`, which needs a customer email). Applies from the next invoice; the same checks as on create apply, including the per-charge limit (/domiciliacion#limit). | | Change the attempts or methods | `POST /v1/subscriptions/:id` with `collectionAttempts` or `methods`. Applies from the next invoice. | > **NOTE: Changing plans** > > Moving a subscription to another price is not supported yet (`plan_changes_not_supported`). Cancel at period end and create a new subscription on the new price. ## Invoices and the hosted invoice page Each period has one invoice, numbered per account with no gaps (`K7Q2M9XA-0001`, `-0002`, …). It is **due when issued**. Its `hostedInvoiceUrl` is a payment page in your name: the customer picks a method and pays the Bs amount at that moment’s rate. Emails show the amount in dollars only, because the bolívar amount depends on the day they pay. | Status | Meaning | Can still be paid? | | --- | --- | --- | | `open` | Waiting for payment | Yes | | `paid` | Paid. `paidAt`, `paymentId` and `billingFee` are set | — | | `uncollectible` | Gave up collecting (after the last attempt, or by you) | **Yes** — a late payment still counts | | `void` | Canceled; the payment page closes | No | | To… | Call | | --- | --- | | List | `GET /v1/invoices?subscription=sub_…` (also `customer`, `status`, `cursor`, `limit`). | | Void | `POST /v1/invoices/:id/void` — only an `open` invoice. | | Stop collecting | `POST /v1/invoices/:id/mark-uncollectible` — the page stays payable. | | Record a payment made outside VEX Pay | `POST /v1/invoices/:id/pay` with `{ "paidOutOfBand": true }` (cash, transfer). No money moves and no fee is charged. | | Email it again | **Portal → Billing → Invoices → Resend**, at most once every 10 minutes. | - `attemptsTotal`, `attemptCount` and `nextPaymentAttempt` show where the invoice is in its collection attempts. - When the invoice is paid through VEX Pay, `payment.completed` includes `invoice: { id, number, subscription }`, so your existing payment handler knows which subscription it was for. ## Collection, retries and cancellation Every invoice gets **N collection attempts, one a day**: attempt 1 the moment it is issued, attempt 2 a day later, and so on. N is the subscription’s `collectionAttempts` (1–15), else your account default (3 unless you change it). N is fixed on the invoice when it is issued (`attemptsTotal`), so changing it later applies from the next invoice. Each attempt either emails the invoice (`send_invoice`) or debits the customer (`charge_automatically`; if no debit can be made, the attempt emails the invoice instead). | When (from issue) | What happens | Webhooks | | --- | --- | --- | | Day 0 | Attempt 1: invoice email “Factura … de ”, or the first automatic debit | `invoice.created`, `invoice.payment_attempt` | | Day 1 | Still unpaid → the invoice is overdue and the subscription becomes `past_due`. Attempt 2: reminder email or a new debit | `invoice.overdue`, `customer.subscription.updated`, `invoice.payment_attempt` | | Days 2 … N−1 | One attempt a day. The last email says “Último aviso” | `invoice.payment_attempt` | | Day N | Still unpaid → its open invoices become `uncollectible`, the subscription is canceled with `cancellationReason: "payment_failed"`, and the customer receives the “Suscripción cancelada por falta de pago” email with a button to pay and reactivate | `invoice.marked_uncollectible`, `customer.subscription.deleted` | With the default N = 3 that is: attempts on days 0, 1 and 2, `past_due` on day 1, canceled on day 3. With N = 1 the invoice becomes overdue and the subscription is canceled at the same time, one day after issue. Paying at any point stops the remaining attempts, emails a receipt and returns a `past_due` subscription to `active`. A `past_due` subscription keeps renewing: if a period ends while an invoice is unpaid, the next invoice is still issued. > **SUCCESS: Late payment reactivates** > > If a subscription was canceled for non-payment and the customer later pays its latest invoice (it stays payable on its page), the **same subscription** becomes `active` again, with a new period starting at the moment of payment. You get `invoice.paid` and then `customer.subscription.reactivated`. No new sign-up, no lost history. Paying an older uncollectible invoice only marks that invoice paid, and a subscription you canceled yourself is never reactivated. Choosing N: 3 is a good default for monthly plans. Use more (up to 15) when your customers often pay late, and fewer for daily or weekly plans. Set the account default in **Portal → Billing → Settings**, or per subscription with `collectionAttempts`. ## Emails to your customers All emails are in Spanish, show your business name and logo from your business profile, come from `facturas@vexpay.app` as “ vía VEX Pay”, and replies go to your business email. Each one is sent once — retries never send duplicates. | Email | When | | --- | --- | | Factura … de | An invoice is issued (`send_invoice`), or an automatic debit could not be made | | Recordatorio / Último aviso | Each later collection attempt of an unpaid invoice that is not a successful debit, with “intento X de N”; the last one is the final notice before cancellation | | Pago recibido | An invoice is paid. For automatic debits it shows the Bs amount debited and the rate | | Aviso de cobro | 3 days before each automatic renewal (when the payment method can still be debited), with a Bs estimate at today’s rate | | Suscripción cancelada por falta de pago | After the last attempt, with a button to pay and reactivate | Invoice and reminder emails show the dollar amount, the invoice number, the date the subscription will be canceled if unpaid, and the button to the hosted invoice page. They never show a fixed Bs amount, because it is calculated when the customer pays. > **NOTE: Customers without email** > > A customer with no email (or a bouncing one) is simply not emailed; collection and webhooks continue. `send_invoice` subscriptions require an email. > **WARNING: Testing? Emails only reach your business email** > > In test mode an email is delivered only when the customer’s email is the email on your business profile. Every other address is suppressed: nothing is sent, so a tester using their own Gmail sees nothing. Give your test customer your business-profile email to receive every invoice, reminder and receipt. ## Trials and notices - A trial starts with status `trialing` and no invoice. When it ends, the first paid period starts and its invoice is issued. - `customer.subscription.trial_will_end` fires 3 days before a trial ends (for trials longer than 3 days) — a good moment to remind the customer. - `invoice.upcoming` fires 3 days before each renewal that will happen, with the amount and the next period. Automatic-debit customers also receive the “Aviso de cobro” email then. ## Fees and your balance An invoice paid through VEX Pay is a normal payment: its method’s fee applies as usual (see /pricing) and the money follows the usual balance hold (see /balances). On top of that, VEX Pay charges a **billing fee of 0.5%** of each paid invoice (unless your agreement says otherwise), in the currency the customer paid. It appears on the invoice as `billingFee` and in your balance movements. | Example: $25 plan paid by Pago Móvil at Bs 100/USD | Amount | | --- | --- | | Customer pays | Bs 2,500.00 | | Pago Móvil fee | per your rates — see /pricing | | Billing fee (0.5%) | Bs 12.50 | | You receive | Bs 2,500.00 − Pago Móvil fee − Bs 12.50 | An automatic debit (domiciliación) carries your bolívar pay-in rate, the same as Débito Inmediato (see /pricing), plus the billing fee. Invoices marked paid out of band (`paidOutOfBand: true`) move no money and carry no fee. ## Webhooks Subscribe your endpoint to the billing events you need (see /webhooks for registration and signature verification). Unless noted, `data` is the full object — the same JSON the API returns — plus `livemode`. | Event | When | `data` | | --- | --- | --- | | `customer.created` / `customer.updated` | A customer was created or updated | Customer | | `customer.deleted` | A customer was deleted | Customer + `deleted: true` | | `customer.subscription.created` | A subscription was created | Subscription | | `customer.subscription.updated` | A new period started, it went `past_due` or back to `active`, or you changed cancel-at-period-end, the collection method or the payment method | Subscription | | `customer.subscription.deleted` | Canceled — by you, at period end, or for non-payment (`cancellationReason`) | Subscription | | `customer.subscription.trial_will_end` | 3 days before the trial ends | Subscription | | `customer.subscription.reactivated` | A late payment brought a subscription canceled for non-payment back | Subscription | | `invoice.created` | An invoice was issued | Invoice | | `invoice.upcoming` | 3 days before a renewal | `subscription`, `customer`, `amountDueUsd`, `currency`, `renewsAt`, `periodStart`, `periodEnd` | | `invoice.payment_attempt` | Each collection attempt | `invoice`, `attempt`, `attemptsTotal`, `nextPaymentAttempt`, `collectionMethod`, `attemptedAt` | | `invoice.payment_failed` | An automatic debit was rejected, or the invoice is above the per-charge limit (`paymentId` is then `null`) | `invoice`, `attempt`, `attemptsTotal`, `nextPaymentAttempt`, `paymentId`, `failureCode`, `failureMessage` | | `invoice.overdue` | Still unpaid one day after issue | Invoice | | `invoice.paid` | Paid — through VEX Pay or marked paid out of band | Invoice | | `invoice.voided` | Voided by you or by an immediate cancel | Invoice | | `invoice.marked_uncollectible` | Marked uncollectible by you or after the last attempt | Invoice | | `payment_method.attached` | A customer authorized domiciliación | Payment method (`pending`) | | `payment_method.updated` | It became `active` (first debit accepted) or `inactive` (a debit showed the authorization was canceled or suspended at the bank) | Payment method | | `payment_method.detached` | You detached it | Payment method | | `test_clock.advancing` / `test_clock.ready` | A test clock started advancing / finished (test mode only) | Test clock | ### Register billing events ```bash curl --request POST "${API_URL}/v1/webhooks" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "url": "https://example.com/webhooks/vexpay", "events": [ "customer.subscription.created", "customer.subscription.updated", "customer.subscription.deleted", "customer.subscription.reactivated", "invoice.paid", "invoice.payment_failed", "invoice.overdue", "payment_method.attached", "payment_method.updated" ] }' ``` ### invoice.paid ```json { "event": "invoice.paid", "data": { "id": "in_3fd84b2d9ad14f74a2d90f2f56984db5", "object": "invoice", "number": "K7Q2M9XA-0001", "status": "paid", "customer": "cus_…", "subscription": "sub_…", "collectionMethod": "send_invoice", "amountDueUsd": "25.00", "amountPaidUsd": "25.00", "currency": "USD", "periodStart": "2026-10-21T14:00:00.000Z", "periodEnd": "2026-11-21T14:00:00.000Z", "dueDate": "2026-10-21T14:00:00.000Z", "attemptsTotal": 3, "attemptCount": 1, "nextPaymentAttempt": null, "paidAt": "2026-10-21T15:12:40.000Z", "paidOutOfBand": false, "paymentId": "9b2c…", "billingFee": { "amount": "12.50", "currency": "VES", "percent": "0.5" }, "hostedInvoiceUrl": "https://pay.vexpay.app/pay/in-…", "createdAt": "2026-10-21T14:00:00.000Z", "livemode": true }, "timestamp": "2026-10-21T15:12:41.000Z" } ``` > **NOTE: What to do on each event** > > Grant access on `invoice.paid`, and on `customer.subscription.reactivated`. Warn the user on `customer.subscription.updated` with status `past_due`. Remove access on `customer.subscription.deleted`. Because deliveries are not retried, reconcile with `GET /v1/subscriptions/:id` when in doubt. ## Test mode - Everything above works with your **Test key**, with the same webhooks. Test and live objects are separate. - **Emails go only to your business-profile email.** A test-mode email is delivered only when the customer’s email is the email on your business profile; every other address is suppressed. Use that address on your test customers to see exactly what your customers receive. - Pay test invoices on their hosted page with the test payment methods. - Automatic charging works in test mode without asking VEX Pay to enable it: a simulator stands in for the bank. See /domiciliacion#test-mode for the phone numbers that simulate each outcome. - **Test clocks** move time forward for up to 3 test customers, so you can watch trials, renewals and dunning in seconds. See Test clocks below. ## Test clocks A test clock freezes time for a few test customers and lets you move it forward, so trials, renewals, collection attempts and cancellations happen in seconds instead of months — each with its webhooks. Test mode only. - Create a clock with `POST /v1/test-clocks` and `{ "frozenTime": "…" }`, then create customers with `testClock` set to its id (at most 3 per clock). Everything those customers have — subscriptions, invoices, payment methods — lives on the clock’s time: a monthly subscription created on a clock frozen at 1 January runs 1 January to 1 February, whatever today is. - Advance with `POST /v1/test-clocks/:id/advance` and the new `frozenTime`. The clock turns `advancing` (`test_clock.advancing`), every event due up to the new time runs in time order with its webhooks, and the clock is `ready` again (`test_clock.ready`). Poll `GET /v1/test-clocks/:id` or wait for the webhook. - Each advance can go at most two intervals of the shortest subscription on the clock ahead (two months for a monthly plan). Advance again to go further. - Pay clock invoices on their hosted page with the test methods, or with `POST /v1/invoices/:id/pay` and `paidOutOfBand`. They are paid at the clock’s time; Bs amounts use today’s rate. - Clock customers are never emailed. Delete the clock with `DELETE /v1/test-clocks/:id` to remove it with its customers, subscriptions and invoices. ### curl ```bash # 1. A clock frozen on 1 January curl --request POST "${API_URL}/v1/test-clocks" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "frozenTime": "2026-01-01T00:00:00.000Z", "name": "Dunning test" }' # → { "id": "clock_…", "status": "ready", "frozenTime": "2026-01-01T00:00:00.000Z", ... } # 2. A customer on the clock, then a subscription as usual curl --request POST "${API_URL}/v1/customers" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "name": "Ana Pérez", "email": "ana@example.com", "testClock": "clock_…" }' # 3. Move it forward 4 days: attempts, past_due and cancellation happen now curl --request POST "${API_URL}/v1/test-clocks/clock_…/advance" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "frozenTime": "2026-01-05T00:00:00.000Z" }' # → { "status": "advancing", "targetTime": "2026-01-05T00:00:00.000Z", ... } ``` ### Node SDK ```javascript const clock = await vexpay.testClocks.create({ frozenTime: '2026-01-01T00:00:00.000Z', name: 'Dunning test' }); const customer = await vexpay.customers.create({ name: 'Ana Pérez', email: 'ana@example.com', testClock: clock.id }); await vexpay.subscriptions.create({ customer: customer.id, price: 'price_…' }); await vexpay.testClocks.advance(clock.id, { frozenTime: '2026-01-05T00:00:00.000Z' }); // Poll until it is ready (or wait for the test_clock.ready webhook) let current = await vexpay.testClocks.retrieve(clock.id); while (current.status === 'advancing') { await new Promise((r) => setTimeout(r, 1000)); current = await vexpay.testClocks.retrieve(clock.id); } await vexpay.testClocks.delete(clock.id); // removes its customers, subscriptions and invoices ``` ### Python SDK ```python import time clock = vexpay.test_clocks.create({"frozenTime": "2026-01-01T00:00:00.000Z", "name": "Dunning test"}) customer = vexpay.customers.create({"name": "Ana Pérez", "email": "ana@example.com", "testClock": clock.id}) vexpay.subscriptions.create({"customer": customer.id, "price": "price_…"}) vexpay.test_clocks.advance(clock.id, {"frozenTime": "2026-01-05T00:00:00.000Z"}) while vexpay.test_clocks.retrieve(clock.id).status == "advancing": time.sleep(1) vexpay.test_clocks.delete(clock.id) ``` ### PHP SDK ```php $clock = $vexpay->testClocks->create(['frozenTime' => '2026-01-01T00:00:00.000Z', 'name' => 'Dunning test']); $customer = $vexpay->customers->create(['name' => 'Ana Pérez', 'email' => 'ana@example.com', 'testClock' => $clock->id]); $vexpay->subscriptions->create(['customer' => $customer->id, 'price' => 'price_…']); $vexpay->testClocks->advance($clock->id, ['frozenTime' => '2026-01-05T00:00:00.000Z']); while ($vexpay->testClocks->retrieve($clock->id)->status === 'advancing') { sleep(1); } $vexpay->testClocks->delete($clock->id); ``` > **NOTE: What a 4-day advance shows** > > For a `send_invoice` monthly subscription with the default 3 attempts, advancing from 1 to 5 January without paying sends, in order: on the 2nd `invoice.overdue`, `invoice.payment_attempt` (2 of 3) and `customer.subscription.updated` (`past_due`); on the 3rd attempt 3 of 3; on the 4th `customer.subscription.deleted` (`payment_failed`) and `invoice.marked_uncollectible`; then `test_clock.ready`. Pay the invoice on its page afterwards to see `customer.subscription.reactivated`. ## Errors Errors use the usual shape: `{ "error": "", "message": "…" }`, plus `field` for invalid input. | Status | error | Meaning | | --- | --- | --- | | 400 | `invalid_data` | A field is missing or invalid; see `field` | | 400 | `customer_email_required` | `send_invoice` needs a customer with an email | | 400 | `price_inactive` | The price is archived | | 400 | `plan_changes_not_supported` | A subscription’s price cannot be changed | | 400 | `subscription_canceled` | The subscription is already canceled | | 400 | `invoice_not_open` | Only an open invoice can be voided, marked uncollectible or marked paid | | 400 | `method_not_allowed` | Domiciliación is not enabled for your account | | 400 | `automatic_charging_unavailable` | Automatic charging (and setup sessions) are not enabled yet for live accounts. Never returned in test mode | | 400 | `amount_exceeds_limit` | `charge_automatically` for a price above Bs 1,500,000 at today’s rate; the message gives the approximate USD maximum. Use `send_invoice` | | 400 | `payment_method_required` | The customer has not authorized domiciliación yet | | 400 | `payment_method_detached` | The payment method was detached | | 400 | `test_mode_only` | Test clocks (and `testClock` on a customer) are for test mode only | | 400 | `test_clock_customer_limit` | The test clock already has 3 customers | | 400 | `test_clock_advance_too_far` | An advance can go at most two intervals of the clock’s shortest subscription; `maxFrozenTime` gives the limit | | 400 | `test_clock_internal_failure` | The clock failed while advancing and cannot advance again; delete it | | 404 | `not_found` | No such object in this account (or in this mode) | | 409 | `customer_has_active_subscriptions` | Cancel the customer’s subscriptions before deleting it | | 409 | `test_clock_advancing` | The test clock is still advancing; wait until it is `ready` | | 422 | `amount_below_minimum` | The price is below your minimum charge | Full request and response schemas for every billing endpoint are in the API reference (/reference). --- # Automatic charging with domiciliación > Your customer authorizes once; every invoice is then debited from their bank account in bolívares at the day’s rate. No links to chase, no manual payments. Human docs: /domiciliacion ## How it works **Domiciliación** is a standing authorization the customer gives their bank to pay you. With `collectionMethod: "charge_automatically"`, VEX Pay debits each invoice from the customer’s bank account in bolívares, at your account’s current rate (BCV or market) at the moment of the debit, without the customer doing anything. Prices stay in dollars. 1. **Send the authorization link** — Create a setup session for the customer and send them its `url` (by WhatsApp, email or a redirect from your app). 2. **The customer authorizes** — On the page “Domiciliación bancaria” they confirm their name, cédula/RIF, phone and bank and accept the authorization text. VEX Pay sends the request to their bank and attaches a payment method in status `pending`. 3. **The customer accepts in online banking** — The last step happens at their bank: they open online banking and accept the domiciliación request. The page tells them so. Once accepted it is active right away and does not expire: it stays in place until the customer cancels it at their bank. 4. **Subscribe with automatic charging** — Create the subscription with `charge_automatically`. Each invoice is debited on its collection attempts; the first accepted debit makes the payment method `active`. > **WARNING: Availability** > > Automatic charging works in test mode today, with no approval needed. On live accounts it is not switched on yet: until VEX Pay enables it, live `POST /v1/setup-sessions` and `charge_automatically` requests answer 400 `automatic_charging_unavailable` — use `send_invoice` meanwhile. If domiciliación is not enabled for your account at all, the answer is `method_not_allowed`. The customer’s bank must offer domiciliación; when it does not, the page tells the customer they will receive each invoice by email instead. ## 01. Create the authorization link ### curl ```bash curl --request POST "${API_URL}/v1/setup-sessions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "customer": "cus_…", "successUrl": "https://example.com/cuenta/listo" }' ``` ### Node SDK ```javascript const session = await vexpay.setupSessions.create({ customer: 'cus_…', successUrl: 'https://example.com/cuenta/listo', }); // Send session.url to the customer now: it is only returned here. ``` ### Python SDK ```python session = vexpay.setup_sessions.create({ "customer": "cus_…", "successUrl": "https://example.com/cuenta/listo", }) ``` ### PHP SDK ```php $session = $vexpay->setupSessions->create([ 'customer' => 'cus_…', 'successUrl' => 'https://example.com/cuenta/listo', ]); ``` ### Response ```json { "id": "seti_3fd84b2d9ad14f74a2d90f2f56984db5", "object": "setup_session", "url": "https://pay.vexpay.app/billing/setup/7c1e…", "customer": "cus_…", "status": "open", "paymentMethod": null, "successUrl": "https://example.com/cuenta/listo", "expiresAt": "2026-10-22T14:00:00.000Z", "createdAt": "2026-10-21T14:00:00.000Z", "livemode": false } ``` - The `url` is valid for **24 hours** and only once, and it is returned **only in this response** — send it right away. `GET /v1/setup-sessions/:id` returns the session without it. - `status` is `open`, `complete` (authorized; `paymentMethod` is set) or `expired`. Create a new session if it expired. Only the link expires: the domiciliación the customer authorizes with it does not. - Save the customer’s `phone`, `idNumber` and `bankCode` on the customer first, and the page arrives prefilled. - `successUrl` (https) adds a “Volver a ” button after the customer authorizes. ## 02. What the customer sees A page in your name titled **Domiciliación bancaria** with: holder name, cédula or RIF, the phone linked to their account, their bank, and this authorization, which they must tick: > **NOTE: Authorization text** > > “Autorizo a a cobrar de forma recurrente, mediante domiciliación bancaria, el monto de cada factura de mi suscripción desde la cuenta asociada a este teléfono. El monto en bolívares puede variar en cada período porque sigue la tasa de cambio del día del cobro. Puedo revocar esta autorización en cualquier momento desde mi banca en línea.” After **Autorizar domiciliación**, the page shows **Solicitud enviada** and reminds them to accept the request in online banking. VEX Pay keeps the accepted text, time, IP and browser as proof of consent. If the bank refuses the request, the page says which field to check (for example the cédula) and the customer can try again. You receive `payment_method.attached` with a `pm_…` in status `pending`. List a customer’s methods with `GET /v1/customers/:id/payment-methods`. ## 03. Subscribe with automatic charging ### curl ```bash curl --request POST "${API_URL}/v1/subscriptions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "customer": "cus_…", "price": "price_…", "collectionMethod": "charge_automatically" }' ``` ### Node SDK ```javascript const subscription = await vexpay.subscriptions.create({ customer: 'cus_…', price: 'price_…', collectionMethod: 'charge_automatically', }); ``` ### Python SDK ```python subscription = vexpay.subscriptions.create({ "customer": "cus_…", "price": "price_…", "collectionMethod": "charge_automatically", }) ``` ### PHP SDK ```php $subscription = $vexpay->subscriptions->create([ 'customer' => 'cus_…', 'price' => 'price_…', 'collectionMethod' => 'charge_automatically', ]); ``` - Without `paymentMethod`, the subscription uses the customer’s most recent authorized method that is not inactive. With none, it answers 400 `payment_method_required`. - An email is optional for automatic charging, but recommended: it is how the customer receives charge notices, receipts and, if a debit fails, the invoice to pay by hand. - Switch an existing subscription with `POST /v1/subscriptions/:id` and `{ "collectionMethod": "charge_automatically" }`; it applies from the next invoice. - The price must fit the per-charge limit at today’s rate (see below), otherwise create and switch answer 400 `amount_exceeds_limit`. > **NOTE: Give the customer time to accept** > > The first invoice is debited as soon as the subscription is created. If the customer has not accepted in online banking yet, that debit fails with `affiliation_pending` and is retried the next day. Create the subscription after they confirm, start with a short trial, or raise `collectionAttempts` so the first invoice has room. ## Each debit - 3 days before a renewal the customer receives **Aviso de cobro**, with the dollar amount and a Bs estimate at today’s rate. - On each collection attempt the Bs amount is calculated at your account’s current rate (BCV or market) and debited with the concept “Factura ”. The amount follows the rate, so it can differ from one period to the next. - The bank usually confirms the debit within minutes. On success the invoice is paid, the payment method becomes `active`, and the receipt shows the Bs debited and the rate. No invoice email is sent for a successful debit. - Only one debit per invoice is in flight at a time: while one is pending, later attempts wait for it. - The money lands in your balance like any other bolívar payment, at your bolívar pay-in rate plus the billing fee (see /subscriptions#fees). ## Per-charge limit: Bs 1,500,000 A single automatic debit can be at most **Bs 1,500,000**. Because prices are in dollars, the check uses your account’s current rate: - **Up front.** Creating a `charge_automatically` subscription, or switching one to it, for a price that is already above Bs 1,500,000 at today’s rate answers 400 `amount_exceeds_limit`. The message gives the approximate USD maximum at today’s rate. Nothing is created or changed; use `send_invoice` for that price. - **At charge time.** If the rate moves and an invoice ends up above the limit, no debit is sent. You get `invoice.payment_failed` with `failureCode: "amount_exceeds_limit"` (and `paymentId: null`), the customer receives the invoice by email to pay on its page, and the remaining attempts for that invoice send reminders instead of debits. ## When a debit fails You receive `invoice.payment_failed` with a `failureCode`. The first time, the customer is also emailed the invoice so they can pay it another way. The next daily attempt debits again unless the method is inactive. | failureCode | Meaning | What happens next | | --- | --- | --- | | `affiliation_pending` | The customer has not accepted the domiciliación in online banking yet | Retried on the next attempt — ask the customer to accept it | | `insufficient_funds` | Not enough balance | Retried on the next attempt | | `payment_method_inactive` | The customer canceled the domiciliación at their bank, or the bank suspended it | The method becomes `inactive` (`payment_method.updated`) and is never debited again; later attempts email the invoice instead. Send a new setup link | | `amount_exceeds_limit` | The Bs amount is above Bs 1,500,000 at the current rate (no debit was sent) | No debits for this invoice; it is emailed and later attempts send reminders | | other | The bank rejected the debit; `failureMessage` has its reason in Spanish | Retried on the next attempt | If every attempt fails, the subscription is canceled for non-payment like any other — and a late payment of its invoice reactivates it. See /subscriptions#collection. ## Manage payment methods | Status | Meaning | | --- | --- | | `pending` | Authorized on the page; no accepted debit yet | | `active` | At least one debit was accepted | | `inactive` | The bank reported the authorization inactive; never debited again | - `GET /v1/payment-methods/:id` returns one method; it shows `phoneLast4` and `bankCode`, never the full phone or cédula. - `DELETE /v1/payment-methods/:id` detaches it: it is never debited again (`payment_method.detached`). Subscriptions that used it keep `charge_automatically` and their invoices are emailed until you set a new method with `POST /v1/subscriptions/:id` and `paymentMethod`. - A domiciliación does not expire. Customers can cancel it at any time in their online banking; the bank does not notify the cancellation, so you find out on the next debit: it fails with `payment_method_inactive`, the method becomes `inactive`, and you get `payment_method.updated`. ## Test mode With your Test key no bank is contacted and nothing needs to be enabled: setup sessions and `charge_automatically` always work, authorization always succeeds and each debit settles at once. The setup page shows “Modo de prueba”. The last 4 digits of the phone the customer enters on the setup page choose the outcome of every debit: | Phone ends in | Result | | --- | --- | | `0001` | `affiliation_pending` (not accepted yet) | | `0002` | `insufficient_funds` | | `0003` | `payment_method_inactive` | | anything else | Accepted: the invoice is paid | Combine a suffix with a daily test price (`"interval": "day"`) to watch failures, retries and cancellation play out over a few days. Test-mode emails only reach your business-profile email. --- # Accept and send USDT and USDC > Give each customer a stablecoin deposit address, accept USDT or USDC at checkout, and send them to external wallets. Each coin settles in itself — it is never converted to bolívares or to the other coin. Human docs: /usdt ## How USDT works - USDT has its own balance (`GET /v1/crypto/balance`), separate from your VES balance. 1 USDT is treated as 1 USD. - USDT you receive is held for 24 hours before it can be paid out: the balance reports it as `held` (`heldUsdt`) with `nextReleaseAt`, and `available` excludes it. See Balances, holds and payouts. - Receive with a static deposit address per customer, or with the `usdt` method on checkout sessions and payment links. - Send with `POST /v1/crypto/payouts`. Payouts within your limits go out automatically; larger ones are reviewed first. - Every movement is reported with signed webhooks: `payment.completed` for money in, `payout.completed` / `payout.failed` for money out. - Want USDT from the bolívares you collect? Convert your VES balance with `POST /v1/conversions` — see Convert VES to USDT. > **NOTE: Enable USDT first** > > USDT must be enabled on your account. Until it is, these endpoints answer 403 `method_not_allowed`. Ask VEX Pay to turn it on. ## Pricing | Movement | Fee | | --- | --- | | USDT received (deposits and checkout) | 2.5% + 0.50 USDT, deducted from the amount received (never more than the amount) | | USDT payout to an external address | The payout fee of the chosen network, shown by `GET /v1/crypto/networks` (and on /pricing) | | USDT payout to one of your own deposit addresses | Free — settled inside VEX Pay, nothing is sent on-chain | Example: a customer sends 40.00 USDT → fee 1.50 → 38.50 USDT credited. ## Networks List the enabled networks, their payout fee and whether a payout of a given amount can be sent right now. Prefer the cheaper networks (BEP20, Polygon) when your customer can use them; TRC20 is the most expensive to send. ### curl ```bash curl "${API_URL}/v1/crypto/networks?amountUsdt=50.00" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` | network | Chain | | --- | --- | | TRC20 | Tron | | BEP20 | BNB Smart Chain | | POLYGON | Polygon | | SOL | Solana | | TON | TON (needs a tag / memo) | | ARB1 | Arbitrum One | ## 01. Deposit addresses `customerRef` is your id for the customer. Calling again for the same customer and network returns the same address, so you can call it every time you show the deposit screen. ### curl ```bash curl -X POST "${API_URL}/v1/crypto/deposit-addresses" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "customerRef": "user_123", "network": "BEP20" }' ``` ### Node SDK ```javascript const address = await vexpay.crypto.depositAddresses.create({ customerRef: 'user_123', network: 'BEP20', }); // address.address, address.tag (TON only) ``` ### Python SDK ```python address = vexpay.crypto.deposit_addresses.create({"customerRef": "user_123", "network": "BEP20"}) ``` > **WARNING: TON needs the tag** > > When `tagRequired` is true, show the `tag` next to the address — deposits without it cannot be matched to your customer. When USDT arrives you receive `payment.completed` with `method: "USDT"`, `customerRef`, `amountUsdt`, `feeUsdt`, `network` and `txHashes`. Credit your customer `amountUsdt − feeUsdt`, once per `paymentId`. **Test mode:** make a deposit arrive with `POST /v1/crypto/deposit-addresses/simulate` and the Test key. Send the `customerRef`, `network` and `currency` of an address you already requested, plus an `amount` (greater than 0, at most 10,000, at most 2 decimals). It creates a `COMPLETED` payment, charges your fee, credits your Test balance and sends `payment.completed` with `customerRef` and `livemode: false`, exactly like a real deposit. Each call is a new deposit. No processor call is made and no funds move. A Live key gets 403 `test_mode_only`; an address you never requested gets 404; a bad amount gets 400 `invalid_data`. The portal USDT page has the same as **Simulate deposit** in Test mode. ### curl (Test key) ```bash curl -X POST "${API_URL}/v1/crypto/deposit-addresses/simulate" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "customerRef": "user_123", "network": "BEP20", "amount": "40.00" }' ``` ### Node SDK ```javascript const deposit = await vexpay.crypto.simulateDeposit({ customerRef: 'user_123', network: 'BEP20', amount: '40.00', }); // deposit.paymentId, deposit.fee, deposit.livemode === false ``` ### Python SDK ```python deposit = vexpay.crypto.simulate_deposit({"customerRef": "user_123", "network": "BEP20", "amount": "40.00"}) ``` ## 02. USDT at checkout Add `usdt` to `methods` when you create a checkout session (or leave `methods` empty to offer everything your account accepts). The buyer picks a network on the hosted page and pays the exact amount; the session becomes `paid` when the payment arrives. ### curl ```bash curl -X POST "${API_URL}/v1/checkout/sessions" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "amountUsd": 25.00, "methods": ["usdt", "c2p"], "reference": "order-1042" }' ``` The `payment.completed` webhook for a session payment carries `checkoutSession: { id, reference, metadata }` — match your order on `checkoutSession.reference` (the payment's own `externalRef` belongs to the session). The VEX Pay WooCommerce plugin already offers USDT this way whenever it is enabled on your account. > **NOTE: Underpaid** > > If the buyer sends less than the amount, what arrived is still credited (net of the fee) and `payment.completed` carries `underpaid: true`, but the session is not marked `paid`. Decide in your system how to handle the difference. ## 03. USDT payouts Amount + fee are reserved from your available USDT balance immediately (USDT still under the 24h hold cannot be paid out). `idempotencyKey` is required: repeating the same request returns the same payout (200); reusing the key with different details answers 409 `idempotency_key_reused`. ### curl ```bash curl -X POST "${API_URL}/v1/crypto/payouts" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "network": "POLYGON", "address": "0x9f3c4e1b2a7d6c5e4f3a2b1c0d9e8f7a6b5c4d3e", "amountUsdt": "50.00", "customerRef": "user_123", "idempotencyKey": "withdrawal_8812" }' ``` ### Node SDK ```javascript const payout = await vexpay.crypto.payouts.create({ network: 'POLYGON', address: '0x9f3c…', amountUsdt: '50.00', idempotencyKey: 'withdrawal_8812', }); ``` | status | Meaning | | --- | --- | | pending | Reserved; waiting for review (over your limits) or for network capacity | | processing | Sent to the network | | completed | Delivered — `txHash` is set (`internal: true` when settled inside VEX Pay) | | failed | Not sent — amount + fee returned to your balance; see `failureReason` | Errors: 422 `insufficient_balance` (with `held`, `heldUsdt` and `nextReleaseAt` when part of your balance is still on hold), 422 `amount_below_minimum`, 400 `invalid_address`, 400 `unsupported_network`. ## 04. USDC USDC works exactly like USDT, with the same endpoints, fees, webhooks and payout review. Pass `currency: "USDC"` (body) or `?currency=USDC` (query); without it every endpoint keeps working in USDT, unchanged. - Networks: POLYGON and BASE only. BASE carries USDC only; a USDT request on BASE answers 400 `unsupported_network`. - Separate balance: USDC has its own balance (`GET /v1/crypto/balance?currency=USDC`). USDC payouts never draw on USDT and USDT payouts never draw on USDC. `GET /v1/crypto/balances` returns both. - Enabled separately: USDC must be enabled on your account on its own. Having USDT does not enable USDC; until it is enabled, USDC requests answer 403 `method_not_allowed`. - Same pay-in fee as USDT (2.5% + 0.50, charged in USDC). USDC payouts cost 0.75 USDC on BASE and Polygon (0.50 network fee + 0.25); `GET /v1/crypto/networks?currency=USDC` lists them. - Payout limits are shared: USDT and USDC payouts count together, 1:1 in USD, against the same per-payout and daily limits. - Any other `currency` value answers 400 `unsupported_currency`. ### Deposit address ```bash curl -X POST "${API_URL}/v1/crypto/deposit-addresses" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "customerRef": "user_123", "network": "POLYGON", "currency": "USDC" }' ``` ### Payout ```bash curl -X POST "${API_URL}/v1/crypto/payouts" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "currency": "USDC", "network": "BASE", "address": "0x9f3c4e1b2a7d6c5e4f3a2b1c0d9e8f7a6b5c4d3e", "amount": "50.00", "idempotencyKey": "withdrawal_8813" }' ``` ### Node SDK ```javascript const usdc = await vexpay.crypto.balance.retrieve({ currency: 'USDC' }); const all = await vexpay.crypto.balances.list(); await vexpay.crypto.payouts.create({ currency: 'USDC', network: 'BASE', address: '0x9f3c…', amount: '50.00', idempotencyKey: 'withdrawal_8813', }); ``` Use `amount` for USDC payouts. `amountUsdt` is accepted only as an alias for USDT payouts; sending both with different values answers 400 `invalid_data`. Every crypto response now includes `currency`, `amount` and `fee` for both assets; the `*Usdt` fields are returned for USDT only, with their existing meaning. A payout's `currency` is part of its idempotency check: reusing an `idempotencyKey` with another currency answers 409 `idempotency_key_reused`. At checkout, add `usdc` to `methods` (or leave `methods` empty). When both stablecoins are available the buyer picks the coin, then the network. A link or session limited to `["usdt"]` never offers USDC. > **WARNING: Wrong-coin deposits** > > A deposit is credited in the coin that actually arrived, not the coin the address was requested for. On Polygon one customer can get the same address for USDT and USDC. If they send USDC to their USDT address, it is credited as USDC (`payment.completed` with `currency: "USDC"`) when USDC is enabled on your account. Otherwise it is not credited automatically, and VEX Pay contacts you to resolve it. Always credit your customer in the `currency` the webhook reports. ## Webhooks | Event | When | Key fields | | --- | --- | --- | | payment.completed | USDT or USDC received (deposit address or checkout) | method and currency ("USDT" / "USDC"), amount, fee, network, txHashes, customerRef, underpaid; USDT also amountUsdt, feeUsdt | | payout.completed | Payout delivered | payoutId, currency, amount, fee, txHash, internal, idempotencyKey; USDT also amountUsdt, feeUsdt | | payout.failed | Payout not sent; refunded | payoutId, currency, failureReason, idempotencyKey | ## Testing With a test key, the hosted USDT page shows test buttons (confirm / cancel / insufficient) so you can drive each outcome without real funds. Test payments never credit a live account. Test payouts complete right away with `payout.completed` (no `txHash`): nothing is sent on-chain and no limits or approval apply. --- # Convert your VES or COP balance to USDT > Turn the bolívares or Colombian pesos you collect with VEX Pay into USDT — from the portal or with the API, on demand or automatically for each COP payment. Quote a rate, accept it, and receive the USDT in your VEX Pay USDT balance. Human docs: /convert-usdt ## How it works Every payment you collect in bolívares adds to your available VES balance (`GET /v1/balance`). A conversion moves part of that balance into your USDT balance (`GET /v1/crypto/balance`) at a rate you see and accept first. No bank transfer is involved and you never send VEX Pay anything: the VES is already in your VEX Pay balance. 1. **Have USDT enabled** — Conversions are on automatically for every account that has USDT enabled. Without USDT every conversion endpoint answers 403 `conversions_not_enabled`. 2. **Quote** — Ask for a quote with the VES you want to spend or the USDT you want to receive. The quote shows the exact rate and both amounts, and is valid for 60 seconds. 3. **Convert** — Accept the quote. The VES leaves your balance immediately — conversions may use bolívares that are still under the 24h hold; the USDT bought with them stays held until that hold ends. The conversion is often `COMPLETED` in the same response; otherwise it is `PENDING` until VEX Pay delivers the USDT. The amounts are fixed — later market moves never change them. 4. **Receive the USDT** — VEX Pay delivers the USDT into your USDT balance, the conversion becomes `COMPLETED` and you receive the `conversion.completed` webhook. 5. **Use it** — The USDT stays in your VEX Pay USDT balance. Send it to any wallet with a USDT payout (`POST /v1/crypto/payouts`) whenever you want. > **NOTE: Colombian pesos too** > > Everything on this page works the same for COP: add `"sourceCurrency": "COP"` to the quote. See Convert COP to USDT and Auto-convert COP payments below. > **NOTE: Completion can be immediate or take a while** > > In live mode a conversion often completes in the same request: the `POST /v1/conversions` response already has `status: "COMPLETED"`. Some conversions stay `PENDING` for a while until VEX Pay delivers the USDT. Handle both: check the status in the response, and react to the `conversion.completed` / `conversion.canceled` webhooks rather than blocking a user or a request. In test mode conversions always complete immediately. ## Statuses and your balances | Status | What it means | Your VES | Your USDT | Webhook | | --- | --- | --- | --- | --- | | PENDING | You accepted a quote; VEX Pay is delivering the USDT (skipped when it completes in the same request) | Already debited | Not yet credited | — (the POST response) | | COMPLETED | The USDT was delivered (final) | Debited | Credited with targetAmountUsdt | conversion.completed | | CANCELED | You canceled it, or VEX Pay could not fulfil it (final) | Returned in full | Unchanged | conversion.canceled | Example with a 2% spread and a market rate of 979.2450 (rate 998.8299), converting 10,000.00 VES: | Moment | availableVes | convertedVes | USDT available | | --- | --- | --- | --- | | Before | 25,000.00 | 0.00 | 0.00 | | After POST /v1/conversions (PENDING) | 15,000.00 | 10,000.00 | 0.00 | | After conversion.completed | 15,000.00 | 10,000.00 | 10.01 | | …or after conversion.canceled | 25,000.00 | 0.00 | 0.00 | `convertedVes` in `GET /v1/balance` is the net VES you have converted (canceled conversions are subtracted back). Conversions and VES payouts draw on the same available balance and are debited atomically, so the two can never spend the same bolívares. ## The rate and what it costs - `rate` is VES per 1 USDT: the current market USDT/VES rate (`marketRate`) plus your spread (`spreadPercent`). It is not the BCV official rate. - The spread is the whole price of the conversion — there is no separate fee. What the quote shows is exactly what you pay and receive. - USDT you receive is rounded down to the cent; VES you pay is rounded up to the cent. - If no current market rate is available, quoting answers 503 `rate_unavailable` — retry in a few minutes. - Your account may have a minimum per conversion (`amount_below_minimum`) and a daily VES limit (`daily_limit_exceeded`, counted from 00:00 Caracas time). Example: market 979.2450 + 2% → rate 998.8299. 10,000.00 VES → 10.01 USDT. 50.00 USDT → 49,941.50 VES. ## Convert COP to USDT The pesos you collect in Colombia sit in your COP balance (`GET /v1/cop/balance`). Convert them with the same endpoints: add `"sourceCurrency": "COP"` and send `sourceAmount` (whole pesos) or `targetAmountUsdt`. Your account needs USDT and COP enabled. ### curl ```bash curl -X POST "${API_URL}/v1/conversions/quotes" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "sourceCurrency": "COP", "sourceAmount": "1000000" }' ``` ### Node SDK ```javascript const quote = await vexpay.conversions.quotes.create({ sourceCurrency: 'COP', sourceAmount: '1000000' }); const conversion = await vexpay.conversions.create({ quoteId: quote.id }, { idempotencyKey: 'convert-cop-001' }); ``` ### Python SDK ```python quote = vexpay.conversions.quotes.create({"sourceCurrency": "COP", "sourceAmount": "1000000"}) ``` ### PHP SDK ```php $quote = $vexpay->conversions->quotes->create(['sourceCurrency' => 'COP', 'sourceAmount' => '1000000']); ``` ### Response (201) ```json { "id": "0c7d3f2e-8a1b-4c5d-9e6f-1a2b3c4d5e6f", "object": "conversion_quote", "rate": "4037.6000", "marketRate": "3920.0000", "spreadPercent": "3.0000", "rateSource": "market", "sourceCurrency": "COP", "sourceAmount": "1000000", "sourceAmountVes": null, "targetAmountUsdt": "247.67", "expiresAt": "2026-10-09T15:01:00.000Z", "createdAt": "2026-10-09T15:00:00.000Z" } ``` - `rate` is COP per 1 USDT: the market USDT/COP rate plus your COP spread (it can differ from your VES spread). - COP you pay is rounded up to the whole peso; USDT you receive is rounded down to the cent. Example: market 3,920 + 3% → rate 4037.6000; 1,000,000 COP → 247.67 USDT; 50.00 USDT → 201,880 COP. - Accepting debits your available COP at once (`GET /v1/cop/balance` drops). Cancel a pending conversion and the COP comes back. The daily COP limit counts from 00:00 Bogotá time. - `sourceAmountVes` is `null` on COP quotes and conversions; read `sourceCurrency` and `sourceAmount` instead. `GET /v1/conversions?sourceCurrency=COP` lists only COP conversions. - A COP refund still needs enough available COP. Pesos you already converted are not available for refunds, so keep some COP if you expect refunds. ## Auto-convert COP payments Instead of quoting yourself, let VEX Pay convert a share of every COP payment as it completes. Set a whole-number percentage from 0 (off, the default) to 100. When a COP payment completes, VEX Pay converts that share of the net amount (after the COP fee) at the current rate plus your spread. ### curl ```bash curl -X PATCH "${API_URL}/v1/conversions/settings" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "autoConvert": { "COP": { "percent": 50 } } }' ``` ### Node SDK ```javascript await vexpay.conversions.settings.update({ autoConvert: { COP: { percent: 50 } } }); const settings = await vexpay.conversions.settings.retrieve(); ``` ### Python SDK ```python vexpay.conversions.settings.update({"autoConvert": {"COP": {"percent": 50}}}) ``` ### PHP SDK ```php $vexpay->conversions->settings->update(['autoConvert' => ['COP' => ['percent' => 50]]]); ``` - Example: a 100,000 COP payment with the 4.5% + COP 1,500 fee nets 94,000 COP. At 50%, 47,000 COP is converted (11.64 USDT at a rate of 4037.6000) and 47,000 COP stays in your COP balance. - You receive `payment.completed` first, then `conversion.created` with `origin: "auto"` and the `paymentId`, usually within a minute. Then `conversion.completed`, as for any conversion. Auto-convert never delays or changes the payment. - It applies only to payments completed after you turn it on. A payment whose share is below your USDT minimum, or that would go over your daily COP limit, is not converted: the pesos stay in COP. - If no market rate is available, VEX Pay retries for up to 24 hours. After that, the pesos stay in COP. - You can cancel a pending auto-conversion like any other conversion. - `GET /v1/conversions/settings` also shows your spreads, minimum, daily limits and which currencies you can convert. Only `autoConvert` can be changed through the API; contact VEX Pay for the rest. - In the portal, open COP: the "Auto-convert COP payments" card sets the same percentage. ## From the portal (no code) 1. **Open USDT (or COP)** — In the VEX Pay portal, open USDT. When USDT is enabled you see the "Convert VES → USDT" card with your available VES and your minimum. For pesos, open COP: the "Convert COP → USDT" card works the same way. 2. **Enter an amount** — Choose "Spend VES" or "Receive USDT", type the amount and click Get quote. 3. **Confirm within 60 seconds** — Check the rate and both amounts, then click Confirm conversion. If the countdown runs out, click Refresh quote. 4. **Follow it** — The conversion appears in the history below the card as pending, then completed (the USDT shows in your USDT balance) or canceled (the VES is back). You can cancel it from there while it is pending. ## 01. Quote Send exactly one of `sourceAmountVes` (VES to spend) or `targetAmountUsdt` (USDT to receive), as a string with up to 2 decimals. ### curl ```bash curl -X POST "${API_URL}/v1/conversions/quotes" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "sourceAmountVes": "10000.00" }' ``` ### Node SDK ```javascript const quote = await vexpay.conversions.quotes.create({ sourceAmountVes: '10000.00' }); // or: { targetAmountUsdt: '50.00' } ``` ### Python SDK ```python quote = vexpay.conversions.quotes.create({"sourceAmountVes": "10000.00"}) ``` ### PHP SDK ```php $quote = $vexpay->conversions->quotes->create(['sourceAmountVes' => '10000.00']); ``` ### Response (201) ```json { "id": "6f1c2b0e-4c1d-4a8e-9a51-0f4a1e9a0001", "object": "conversion_quote", "rate": "998.8299", "marketRate": "979.2450", "spreadPercent": "2.0000", "rateSource": "market", "sourceAmountVes": "10000.00", "targetAmountUsdt": "10.01", "expiresAt": "2026-10-03T15:01:00.000Z", "createdAt": "2026-10-03T15:00:00.000Z" } ``` A quote is a price, not a reservation: it does not hold your VES. Show it to the person deciding, and accept it only when they confirm. ## 02. Convert Accept the quote before `expiresAt`. Always send an `Idempotency-Key` header (the SDKs send one per call for you): if your request times out, retry with the same key and you get the same conversion back instead of converting twice. ### curl ```bash curl -X POST "${API_URL}/v1/conversions" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "Idempotency-Key: convert-2026-10-03-001" \ --header "content-type: application/json" \ --data '{ "quoteId": "6f1c2b0e-4c1d-4a8e-9a51-0f4a1e9a0001", "reference": "treasury-2026-10-03" }' ``` ### Node SDK ```javascript const conversion = await vexpay.conversions.create( { quoteId: quote.id, reference: 'treasury-2026-10-03' }, { idempotencyKey: 'convert-2026-10-03-001' }, ); ``` ### Python SDK ```python conversion = vexpay.conversions.create( {"quoteId": quote.id, "reference": "treasury-2026-10-03"}, idempotency_key="convert-2026-10-03-001", ) ``` ### PHP SDK ```php $conversion = $vexpay->conversions->create( ['quoteId' => $quote->id, 'reference' => 'treasury-2026-10-03'], ['idempotency_key' => 'convert-2026-10-03-001'], ); ``` ### Response (201) ```json { "id": "b7e3a9d2-5f60-4c2b-8f0e-2d1c3b4a5e6f", "object": "conversion", "status": "PENDING", "reference": "treasury-2026-10-03", "rate": "998.8299", "marketRate": "979.2450", "spreadPercent": "2.0000", "rateSource": "market", "sourceAmountVes": "10000.00", "targetAmountUsdt": "10.01", "createdAt": "2026-10-03T15:00:20.000Z", "completedAt": null, "canceledAt": null, "cancelReason": null } ``` `reference` is optional and yours (up to 128 characters): use it to tie the conversion to your own record. It comes back on every read and webhook. ## 03. Handle the outcome Subscribe your webhook endpoint to `conversion.completed` and `conversion.canceled` (POST /v1/webhooks or the portal), and to `conversion.created` if you use auto-convert. Each carries the conversion in `data` (with `sourceCurrency`, `sourceAmount`, `origin` and `paymentId`), plus `livemode`, and is signed like every other VEX Pay webhook. ### conversion.completed ```json { "event": "conversion.completed", "data": { "id": "b7e3a9d2-5f60-4c2b-8f0e-2d1c3b4a5e6f", "object": "conversion", "status": "COMPLETED", "reference": "treasury-2026-10-03", "rate": "998.8299", "sourceAmountVes": "10000.00", "targetAmountUsdt": "10.01", "completedAt": "2026-10-03T16:12:05.000Z", "livemode": true }, "timestamp": "2026-10-03T16:12:05.000Z" } ``` | Event | What to do | | --- | --- | | conversion.completed | Mark the conversion done in your system. `targetAmountUsdt` is now in your USDT balance and can be paid out. | | conversion.created | A conversion started: you accepted a quote, or auto-convert converted part of a COP payment (`origin: "auto"`, `paymentId`). The source is already debited. | | conversion.canceled | Mark it canceled. `sourceAmount` is back in your available VES or COP. `cancelReason` is `canceled_by_tenant` when you canceled it, otherwise the reason VEX Pay could not fulfil it. Quote again if you still want USDT. | Each event is delivered once and is not retried, so also reconcile: list your pending conversions (`GET /v1/conversions?status=PENDING`) on a schedule and read any you have not seen finish (`GET /v1/conversions/{id}`). Process events idempotently by conversion `id`. Changed your mind? Cancel a pending conversion with `POST /v1/conversions/{id}/cancel` — the VES returns immediately. Once it is COMPLETED or CANCELED it can no longer be canceled (409 `conversion_not_cancelable`). ## Complete example Convert a fixed share of today's VES, store the conversion, and finish it from the webhook. ### Node (@vexpay/node) ```javascript import VexPay from '@vexpay/node'; const vexpay = new VexPay(process.env.VEXPAY_API_KEY); // 1. Convert (e.g. from a daily job) export async function convertVes(amountVes, runId) { const quote = await vexpay.conversions.quotes.create({ sourceAmountVes: amountVes }); console.log(`${quote.sourceAmountVes} VES → ${quote.targetAmountUsdt} USDT at ${quote.rate}`); const conversion = await vexpay.conversions.create( { quoteId: quote.id, reference: runId }, { idempotencyKey: `convert-${runId}` }, ); await db.conversions.insert({ id: conversion.id, status: conversion.status, usdt: conversion.targetAmountUsdt }); } // 2. Finish from the webhook app.post('/webhooks/vexpay', express.raw({ type: 'application/json' }), async (req, res) => { const event = vexpay.webhooks.constructEvent(req.body, req.headers['vexpay-signature'], process.env.VEXPAY_WEBHOOK_SECRET); if (event.event === 'conversion.completed' || event.event === 'conversion.canceled') { await db.conversions.update(event.data.id, { status: event.data.status }); } res.sendStatus(200); }); // 3. Reconcile (e.g. every hour) for await (const c of vexpay.conversions.list({ status: 'PENDING' })) { await db.conversions.update(c.id, { status: c.status }); } ``` ### Python (vexpay) ```python from vexpay import VexPay, Webhook vexpay = VexPay(os.environ["VEXPAY_API_KEY"]) def convert_ves(amount_ves: str, run_id: str): quote = vexpay.conversions.quotes.create({"sourceAmountVes": amount_ves}) conversion = vexpay.conversions.create( {"quoteId": quote.id, "reference": run_id}, idempotency_key=f"convert-{run_id}", ) db.save_conversion(conversion.id, conversion.status, conversion.targetAmountUsdt) def on_webhook(raw_body: bytes, signature: str): event = Webhook.construct_event(raw_body, signature, os.environ["VEXPAY_WEBHOOK_SECRET"]) if event.event in ("conversion.completed", "conversion.canceled"): db.update_conversion(event.data["id"], event.data["status"]) ``` ## After the conversion: using your USDT - The USDT is in your VEX Pay USDT balance (`GET /v1/crypto/balance` → `availableUsdt`), together with any USDT you received from customers. - Send it to any wallet with `POST /v1/crypto/payouts` (network fee applies; see USDT & USDC). Payouts within your limits go out automatically; larger ones are reviewed first. - A conversion never sends USDT to a wallet by itself, and USDT is never converted back to VES. ## Good practices - Quote right before you convert. On 410 `quote_expired`, request a new quote and show the new amounts — never accept a rate the user has not seen. - Use one Idempotency-Key per intended conversion (e.g. your run or order id) and reuse it on retries. - On 422 `insufficient_balance`, read `availableVes` in the error and quote a smaller amount; VES payouts and other conversions may have used the balance in between. - Treat the USDT as yours only after `conversion.completed`. - Keep your `reference` meaningful — it is the easiest way to match conversions to your books. ## Errors | Status | error | Meaning | | --- | --- | --- | | 400 | invalid_amount | Send exactly one positive amount with at most 2 decimals (COP: whole pesos). | | 400 | invalid_data | Unknown `sourceCurrency`, or a settings field you cannot change. | | 403 | conversions_not_enabled | Conversions (or USDT, or COP for COP conversions) are not enabled for your account. | | 403 | live_mode_not_activated | Your live account is not approved yet; use test mode. | | 404 | not_found | Unknown quote or conversion (or it belongs to another account). | | 409 | quote_used | That quote was already accepted. | | 409 | conversion_not_cancelable | Only a PENDING conversion can be canceled. | | 410 | quote_expired | More than 60 seconds passed — request a new quote. | | 422 | amount_below_minimum | Below your minimum USDT per conversion. | | 422 | insufficient_balance | Your available VES does not cover the amount. | | 422 | daily_limit_exceeded | The conversion would exceed your daily VES limit. | | 503 | rate_unavailable | No current market rate; retry shortly. | ## Testing Conversions are on for your test account as long as USDT is enabled. With a test key, conversions complete immediately: the test VES is debited, your test USDT balance is credited and `conversion.completed` is sent, so you can build and test the whole flow — including your webhook handler — before going live. Test conversions use the real market rate but never move real money. ## FAQ | Question | Answer | | --- | --- | | Is the rate the BCV rate? | No. It is the current market USDT/VES rate plus your spread. | | Can the amount change after I accept? | No. Both amounts are fixed when you accept the quote. | | Are there other fees? | No. The spread is the price of the conversion. Sending USDT out later costs the network fee of the payout. | | Can I convert USDT back to VES? | No. Conversions only go from VES or COP to USDT; there is no USDT → VES off-ramp. Pago Móvil and bank payouts (`POST /v1/payouts`) are paid only from your VES balance, which comes from the bolívares you collect, so USDT cannot fund them. If you need an off-ramp, contact VEX Pay. | | Can VEX Pay send the USDT straight to my wallet? | Not as part of the conversion. Once it is in your USDT balance, create a USDT payout. | | How do I get it enabled or change my spread or limits? | Contact VEX Pay. | --- # Pay in bolívars, send USDT to a wallet > Add an onward payout to a Pago Móvil or C2P pay-in: when it completes, VEX Pay converts its net VES to USDT and sends it to the wallet you gave — no further API calls. Human docs: /onward-usdt ## How it works Send `onwardPayout` with `POST /v1/payments/pago-movil/verify`, `POST /v1/payments/c2p/request` or `POST /v1/payments/c2p`. When the payment completes, VEX Pay chains two things you could also do yourself: a VES → USDT conversion of the payment's net VES (see Convert VES or COP to USDT), then a USDT payout of that USDT minus the network fee to the address (see USDT & USDC). 1. **Collect with an instruction** — Add `"onwardPayout": { "network": "BEP20", "address": "0x…" }` to the pay-in request. VEX Pay checks it before calling the bank: USDT and conversions must be enabled for your account, the network's payouts must be on, and the address must match the network's format. A bad instruction is answered with 400 and no money moves. 2. **Payment completes** — Exactly as without the instruction: `payment.completed`, your VES balance credited, fees as usual. 3. **Convert** — VEX Pay converts the payment's `netVes` (amount minus VEX Pay and application fees) at your usual conversion price: the market rate when the payment completes plus your spread. The rate is not shown in advance; the conversion object carries it. 4. **Send** — When the conversion completes, VEX Pay sends its USDT minus the network's payout fee to the address, as a normal USDT payout (`payout.completed` with `txHash`). > **WARNING: Check the address** > > Only the format of the address is checked. USDT sent to a valid address that is not your user's cannot be recovered. > **NOTE: Not with marketplace payments** > > `onwardPayout` cannot be combined with `merchantId`: a seller's share of a payment is not yours to convert. ## Statuses and the webhook The payment (`GET /v1/payments/:id` and every `payment.*` webhook) carries `onwardPayout`: `status`, `network`, `address`, `conversionId`, `payoutId`, `amountUsdt`, `feeUsdt`, `txHash`, `reason` and `updatedAt`. Every status change also sends `onward_payout.updated` with `paymentId`, `customerRef` and the same object — subscribe to it under "Onward payout". | status | Meaning | Your money | | --- | --- | --- | | pending | The payment has not completed yet | Nothing moved | | converting | The conversion exists and is not completed | VES debited, USDT not yet credited | | waiting_release | Converted; the USDT is under the 24h balance hold until `sendAfter` | USDT in your balance, held | | sending | The USDT payout exists and is not final | USDT reserved for the payout | | completed | The payout completed (`txHash` set) | Sent to the address | | held | Stopped before a step it could not take (`reason`) | Stays in your VES or USDT balance | | failed | The payout failed (`reason: payout_failed`) | USDT and fee back in your USDT balance | | canceled | Payment failed or reversed, or the conversion was canceled (`reason`) | VES back in (or never left) your VES balance | `completed`, `held`, `failed` and `canceled` are final: VEX Pay never continues after them. Funds left in your balance are yours to convert or pay out as usual. > **NOTE: It waits instead of failing** > > If the conversion cannot complete right away, or the payout is held for approval, the status stays `converting` or `sending` and continues on its own. While the converted USDT is under the 24h balance hold, the status is `waiting_release` and `sendAfter` says when the payout goes out. Nothing is refunded automatically. ## Minimums and holds | reason | When | Where the money is | | --- | --- | --- | | below_conversion_minimum | The net VES is worth less than your conversion minimum | VES balance | | below_payout_minimum | The USDT minus the network fee is below the network's payout minimum | USDT balance | | daily_limit_exceeded | Your daily conversion cap is reached | VES balance | | insufficient_balance | Your available balance no longer covers the step | VES or USDT balance | | onward_payout_unavailable | USDT or conversions were turned off for your account | VES balance | | payment_split | The payment is split between comercios (`splits`), so its net belongs to them. `onwardPayout` is refused with 400 on a split payment; this hold is the backstop | The comercios’ balances (each share) and your balance (the remainder) | Minimums and fees are the same as for any conversion and USDT payout: see `GET /v1/conversions/settings` and `GET /v1/crypto/networks`. ## Reversals A C2P payment can be reversed while its onward payout is still `pending` (the instruction is canceled). Once its conversion exists, `POST /v1/payments/:id/reverse` answers 409 `onward_payout_in_progress`. ## Example ### cURL ```bash curl --request POST "${API_URL}/v1/payments/pago-movil/verify" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "usdAmount": 20, "reference": "40010003", "externalRef": "topup-user-42", "onwardPayout": { "network": "BEP20", "address": "0x2f5c0000000000000000000000000000000000aa" } }' ``` ### Webhook (onward_payout.updated) ```json { "event": "onward_payout.updated", "data": { "paymentId": "6f1c…", "externalRef": "topup-user-42", "onwardPayout": { "status": "completed", "network": "BEP20", "address": "0x2f5c0000000000000000000000000000000000aa", "conversionId": "c1a2…", "payoutId": "9b7e…", "amountUsdt": "18.94", "feeUsdt": "0.75", "txHash": "0x8e1d…", "updatedAt": "2026-10-15T14:03:11.000Z" } } } ``` ## Testing With a test key the whole chain runs on the sandbox: the conversion and the payout complete at once and nothing is sent on-chain, so you receive `converting`, `sending` and `completed` within seconds of the payment. --- # Collect Colombian pesos > Charge buyers in Colombia by card, PSE, Bancolombia, Bre-B, Nequi or Daviplata. Payments settle in Colombian pesos in their own COP balance — never converted to bolívares or USD. Human docs: /cop ## How COP works - Create a payment with `POST /v1/cop/payments`, choosing a `channel`: `pse`, `bancolombia_transfer`, `bancolombia_qr`, `breb`, `nequi` or `daviplata`. Cards (`card`) are taken only on the hosted checkout. Amounts are whole pesos (`amountCop`), at least COP 20,000 per payment; less answers 400 `amount_below_minimum` with `minimumCop`. - `GET /v1/cop/channels` lists the channels your account can use right now, the PSE banks, and the terms links some channels require. Build your channel picker from it. - The response says what the buyer does next (`next.type`). The payment completes asynchronously — listen for `payment.completed` / `payment.failed`, or read it with `GET /v1/cop/payments/:id`. - Completed payments are credited to your COP balance (`GET /v1/cop/balance`) net of the COP fee. COP is kept apart from your VES and stablecoin balances. - New pesos are held for 24 hours: `GET /v1/cop/balance` reports `availableCop`, `heldCop` and `nextReleaseAt`. See Balances, holds and payouts. - COP payouts are sent by bank transfer in Colombia; contact VEX Pay to request one. You receive `payout.completed` with `currency: "COP"` when it is paid. The Node (`vexpay.cop`), Python (`vexpay.cop`), PHP (`$vexpay->cop`) and Laravel (`VexPay::cop()`) SDKs cover every COP endpoint: `payments.create`, `retrieve`, `submitOtp`, `cancel`, `refund` and `balance.retrieve`. > **NOTE: Enable COP first** > > COP must be enabled on your account. Until it is, these endpoints answer 403 `method_not_allowed`. Ask VEX Pay to turn it on. ## Channels | channel | Buyer does | Buyer data | Refund | | --- | --- | --- | --- | | `card` | Pays with Visa or Mastercard on the hosted checkout (1 installment) | Collected by the checkout | Full, within 24 hours | | `pse` | Is redirected to their bank and authorizes the debit | `buyer` + `firstName`, `lastName`, `personType`; `pse.bankCode` | Not through the API | | `bancolombia_transfer` | Is redirected to Bancolombia and authorizes the transfer | `buyer` | Not through the API | | `bancolombia_qr` | Scans a QR with the Bancolombia app | `buyer` | Not through the API | | `breb` | Scans the QR or enters the transfer key in any Colombian bank app (~15 min) | Optional | Full, within 96 hours | | `nequi` | Approves the push notification in the Nequi app (~5 min) | `buyer` | Depends on your account | | `daviplata` | Types an SMS code, or authorizes on a Daviplata page (follow `next.type`) | `buyer`; documentType CC, CE or TI | Depends on your account | `buyer` means `email`, `phone`, `documentType` and `documentNumber`. `buyer.phone` is a Colombian mobile number (10 digits starting with 3; `+57` optional). `documentType` is one of `CC`, `CE`, `TI`, `NIT`, `PP`. `personType` (PSE) is `natural` or `juridica`. Channels whose catalog entry has `needsTermsAcceptance: true` need the buyer to accept the payment network's terms: show the two `terms` links next to a checkbox and send `buyer.termsAccepted: true`. Without it the payment answers 400 `invalid_data` naming `buyer.termsAccepted`. ### curl ```bash curl "${API_URL}/v1/cop/channels" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### Response ```json { "channels": [ { "channel": "pse", "label": "PSE", "needsBuyer": true, "needsTermsAcceptance": true, "checkoutOnly": false, "minAmountCop": 20000 }, { "channel": "card", "label": "Tarjeta", "needsBuyer": true, "needsTermsAcceptance": true, "checkoutOnly": true, "minAmountCop": 20000 }, { "channel": "breb", "label": "Bre-B", "needsBuyer": false, "needsTermsAcceptance": false, "checkoutOnly": false, "minAmountCop": 20000 } ], "pseBanks": [{ "code": "1007", "name": "Bancolombia" }], "terms": { "termsUrl": "https://…", "personalDataUrl": "https://…" } } ``` ## Pricing | Movement | Fee | | --- | --- | | COP payment completed | 4.5% of the amount + COP 1,500, in pesos (never more than the amount) | | Full refund | The fee is returned with the refund | Example: a buyer pays 100.000 COP → fee 6.000 (4.500 + 1.500) → 94.000 COP credited. The minimum payment is 20.000 COP. ## Hosted checkout Payment links and checkout sessions can collect COP with no buyer UI on your side. The hosted page lets the buyer choose the currency (bolívares, crypto or Colombian pesos), shows the total in each, and runs the card, PSE, Bancolombia, Bre-B, Nequi or Daviplata step itself. Add `cop` to `methods` when you create a session, or leave `methods` empty: COP is offered whenever it is enabled on your account. ### curl ```bash curl -X POST "${API_URL}/v1/checkout/sessions" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "amountUsd": 25.00, "methods": ["c2p", "usdt", "cop"], "reference": "order-1042" }' ``` - The session is priced in USD. The peso amount is the USD amount × VEX Pay's USDT/COP rate plus a 2.5% FX margin, rounded up to whole pesos, and is fixed when the buyer starts paying. - When no current rate is available, the page hides the pesos option; bolívares and crypto keep working. - Cards are only taken here: the card number goes from the buyer's browser straight to the payment network, never to you or VEX Pay. A declined card lets the buyer try another card or channel. - PSE and Bancolombia send the buyer to their bank and back to the same checkout, which picks the payment up again and shows the result. - Marketplace seller (merchant) links offer COP too: the payment is credited to that seller's COP balance, net of the COP fee, after the later of your seller hold and the 24h balance hold. - COP is hidden when the peso total is under the COP 20,000 minimum (on a link where the buyer chooses a quantity, it stays visible but disabled until the total reaches it). - The COP fee applies as for any COP payment. `payment.*` webhooks for checkout payments also carry `amountUsd` and `copRate`, plus the usual `checkoutSession` block (`id`, `reference`, `metadata`). ## 01. Bre-B (QR or transfer key) Show the QR image (`next.qrPngBase64`, a base64 PNG) and the transfer key (`next.transferKey`) as a copyable fallback. They are returned only in this response. ### curl ```bash curl -X POST "${API_URL}/v1/cop/payments" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --header "Idempotency-Key: order-1042" \ --data '{ "amountCop": 100000, "channel": "breb", "reference": "order-1042" }' ``` ### Node SDK ```javascript const payment = await vexpay.cop.payments.create( { amountCop: 100000, channel: 'breb', reference: 'order-1042' }, { idempotencyKey: 'order-1042' }, ); // payment.next.qrPngBase64, payment.next.transferKey ``` ### Python SDK ```python payment = vexpay.cop.payments.create( {"amountCop": 100000, "channel": "breb", "reference": "order-1042"}, idempotency_key="order-1042", ) ``` ### PHP SDK ```php $payment = $vexpay->cop->payments->create( ['amountCop' => 100000, 'channel' => 'breb', 'reference' => 'order-1042'], ['idempotency_key' => 'order-1042'], ); ``` ### Response ```json { "id": "6f1c…", "status": "pending", "method": "COP", "channel": "breb", "amountCop": 100000, "reference": "order-1042", "metadata": {}, "expiresAt": "2026-10-07T20:15:00.000Z", "createdAt": "2026-10-07T20:00:00.000Z", "next": { "type": "show_qr", "qrPngBase64": "iVBORw0KGgo…", "transferKey": "BREB-…" } } ``` Render the QR with ``. ## 02. Nequi (push) ### curl ```bash curl -X POST "${API_URL}/v1/cop/payments" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "amountCop": 50000, "channel": "nequi", "buyer": { "email": "juan@example.com", "phone": "3001234567", "documentType": "CC", "documentNumber": "1234567890", "termsAccepted": true } }' ``` ### Node SDK ```javascript await vexpay.cop.payments.create({ amountCop: 50000, channel: 'nequi', buyer: { email: 'juan@example.com', phone: '3001234567', documentType: 'CC', documentNumber: '1234567890', termsAccepted: true }, }); ``` ### Python SDK ```python vexpay.cop.payments.create({ "amountCop": 50000, "channel": "nequi", "buyer": {"email": "juan@example.com", "phone": "3001234567", "documentType": "CC", "documentNumber": "1234567890", "termsAccepted": True}, }) ``` ### PHP SDK ```php $vexpay->cop->payments->create([ 'amountCop' => 50000, 'channel' => 'nequi', 'buyer' => ['email' => 'juan@example.com', 'phone' => '3001234567', 'documentType' => 'CC', 'documentNumber' => '1234567890', 'termsAccepted' => true], ]); ``` The response has `next: { "type": "approve_in_app", "phoneMasked": "****567" }`. Tell the buyer to open Nequi and approve. Send `termsAccepted: true` when the channel catalog says `needsTermsAcceptance` (it is ignored otherwise). ## 03. Daviplata (SMS code) Create the payment with `channel: "daviplata"` and a `buyer`. With `next.type: "submit_otp"`, the buyer receives a code by SMS; submit it to complete the payment. A wrong code answers 400 `invalid_otp` and the payment stays pending until it expires. Some accounts answer `next.type: "redirect"` instead: send the buyer to `next.url` as for PSE (the OTP endpoint then answers 409). ### curl ```bash curl -X POST "${API_URL}/v1/cop/payments/{id}/otp" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --data '{ "otp": "123456" }' ``` ### Node SDK ```javascript await vexpay.cop.payments.submitOtp(payment.id, { otp: '123456' }); ``` ### Python SDK ```python vexpay.cop.payments.submit_otp(payment.id, {"otp": "123456"}) ``` ### PHP SDK ```php $vexpay->cop->payments->submitOtp($payment->id, ['otp' => '123456']); ``` ## 04. PSE and Bancolombia (bank redirect) Create the payment, then send the buyer to `next.url` (`next.type: "redirect"`). The bank's URL can take a few seconds to exist: if `next.type` is `redirect_pending`, read the payment again (`GET /v1/cop/payments/:id`) until it carries the redirect. After authorizing, the buyer lands on a VEX Pay page that tells them they can close the tab; you learn the result by webhook. ### curl ```bash curl -X POST "${API_URL}/v1/cop/payments" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "content-type: application/json" \ --header "Idempotency-Key: order-1043" \ --data '{ "amountCop": 80000, "channel": "pse", "pse": { "bankCode": "1007" }, "buyer": { "firstName": "Juan", "lastName": "Pérez", "personType": "natural", "email": "juan@example.com", "phone": "3001234567", "documentType": "CC", "documentNumber": "1234567890", "termsAccepted": true } }' ``` ### Response ```json { "id": "9a2e…", "status": "pending", "method": "COP", "channel": "pse", "amountCop": 80000, "next": { "type": "redirect", "url": "https://…" } } ``` `bancolombia_transfer` works the same with only `buyer`. `bancolombia_qr` answers `next: { "type": "show_qr", "qrSvgBase64": "…" }`: render it with `` and wait for the webhook. ## Statuses, cancel and refunds | status | Meaning | | --- | --- | | `pending` | Waiting for the buyer. | | `completed` | Paid and credited to your COP balance (`feeCop` is set). | | `failed` | `failureCode: "expired"` (not paid in time) or `"rejected"` (buyer, bank or card issuer declined). | | `canceled` | You canceled it with `POST /v1/cop/payments/:id/cancel` before it was paid. | | `refunded` | Fully refunded with `POST /v1/cop/payments/:id/refund`, or a card chargeback (`failureCode: "chargeback"`). | Cancel works while the payment is pending. For bank-redirect channels (PSE, Bancolombia) the cancel is recorded at VEX Pay; if the bank approves it anyway, VEX Pay reviews it and refunds the buyer or credits you. Refunds are full only, and depend on the channel (see the Channels table): cards within 24 hours, Bre-B within 96 hours (409 `refund_window_expired` after that). A channel that cannot be refunded through the API answers 409 `refund_not_supported`; contact VEX Pay to return the money to the buyer. The amount credited to you is debited from your COP balance (a sale still under the 24h hold is taken from the hold) and the fee is returned; if available plus held pesos do not cover it the answer is 409 `insufficient_balance`. A refund can also answer 503 `processor_unavailable` (temporarily unavailable) shortly after the payment — nothing is debited; retry later. > **WARNING: A 502 is not a failure** > > `processor_unavailable` (502) means the payment network did not answer. Read the payment before retrying, or retry with the same `Idempotency-Key`. ## Webhooks COP payments send `payment.completed`, `payment.failed`, `payment.canceled` and `payment.reversed` (refund, or `reason: "chargeback"` when a card buyer disputes the charge with their bank — the amount is debited from your COP balance). The payload carries `method: "COP"`, `channel`, `amountCop`, `feeCop`, `reference` and `metadata`. Card payments (in webhooks and `GET /v1/cop/payments/:id`) also carry `card: { brand, last4 }`. ### payment.completed ```json { "event": "payment.completed", "data": { "paymentId": "6f1c…", "status": "completed", "method": "COP", "currency": "COP", "channel": "nequi", "amountCop": 100000, "feeCop": 6000, "reference": "order-1042", "metadata": {}, "livemode": true } } ``` ## Test mode Test API keys (and test-mode tenants) send COP payments to the processor sandbox. Use these values: | Channel | Buyer data | What happens | | --- | --- | --- | | `breb` | None | The sandbox returns a QR and a transfer key. Confirm by polling `GET /v1/cop/payments/:id` or by webhook. | | `nequi` | Phone `3991111111`, plus any valid document and email | Completes on its own within about a minute. `3992222222` is declined. | | `daviplata` | Same as Nequi; `documentType` `CC`, `CE` or `TI` only | With `next.type: "submit_otp"`, OTP `123456`, `000000` or `111111` completes it; any other code answers 400 `invalid_otp`. With `redirect`, open `next.url` and follow the test page. | | `card` (checkout) | Card `4242 4242 4242 4242`, any future expiry, any CVC | Approved. `4111 1111 1111 1111` is declined. | | `pse` | Any valid buyer data | Bank code `1` approves, `2` declines. | | `bancolombia_transfer` | Any valid buyer data | Open `next.url` and pick the outcome on the test page. | > **WARNING: Never send real money in test mode** > > Sandbox Bre-B keys are reachable from real Colombian banks. Pesos transferred to a test QR or key are not credited to you and cannot be refunded from VEX Pay. The hosted checkout shows a warning on test-mode COP payments. Document numbers and phones are only format-checked in the sandbox: `phone` is 10 digits starting with 3 (`+57` optional), `documentNumber` 3–20 letters, digits or dashes. --- # Verify merchants and send payouts > Register merchants with one or more Pago Móvil payout methods, confirm micro-deposit amounts per method, then pay verified destinations with exact VES amounts and item-level idempotency. Human docs: /merchants-payouts ## Three golden rules - Payout amounts are always explicit tenant strings with exactly two decimals — the gateway never calculates or converts FX for payouts. - Idempotency is enforced per externalRef at item level before any bank credit is sent. - Every CreditoInmediato AC00 response is reconciled through the same ConsultarOperaciones poller used for débito inmediato. ## externalRef rules You always choose externalRef. The API never generates one. Send your own stable id (user id, settlement id, order number) so you can look records up later. | Rule | Detail | | --- | --- | | Required | Required on POST /v1/merchants, POST /v1/payouts, and each POST /v1/payouts/batch item. | | Length | 1–64 characters after trim. | | Scope | Unique per tenant. The same string may exist under another tenant. | | Ownership | Client-supplied only. Portal Generate is a UI helper for manual testing; production integrations must send their own value in the JSON body. | | Replay (same payload) | Returns the existing merchant or payout (200) and does not re-hit the bank. | | Conflict (different payload) | Returns 409 external_ref_conflict — unless the merchant has no payout methods left (e.g. after a BE01 mismatch cleanup or a shell create), in which case POST /v1/merchants with bankCode+phone attaches a new method (200), or POST without them updates the shell identity (200). | | Recovery | GET /v1/merchants?externalRef=…, GET /v1/merchants/:id, GET /v1/payouts/by-ref/:externalRef, GET /v1/payouts/:id | > **WARNING: Different meaning on payments** > > On C2P, VPOS, Pago Móvil, and débito, externalRef is optional correlation for lookup — not an idempotency key. C2P, VPOS and débito refuse a new charge whose externalRef already has a COMPLETED payment (409 external_ref_already_paid, with paymentId). On merchants and payouts, the same field is the idempotency key. ## Merchant verification | Step | Endpoint | | --- | --- | | 1. Register merchant | POST /v1/merchants (optional bankCode + phone creates the first payout method; omit both for a shell merchant) | | 2. Add another method (optional) | POST /v1/merchants/:id/payout-methods | | 3. Start micro-deposits | POST /v1/merchants/:id/payout-methods/:methodId/verify/start | | 4. Confirm amounts | POST /v1/merchants/:id/payout-methods/:methodId/verify | | 5. List methods | GET /v1/merchants/:id/payout-methods | | 6. Set default method | POST /v1/merchants/:id/payout-methods/:methodId/default | | 7. Delete a method | DELETE /v1/merchants/:id/payout-methods/:methodId | | 8. Read status | GET /v1/merchants/:id or GET /v1/merchants?externalRef=… | | 9. List payout-ready | GET /v1/merchants?status=verified&isActive=true&limit=25 | | 10. Deactivate / reactivate | PATCH /v1/merchants/:id `{ "isActive": false\|true }` | | 11. Delete (no payouts) | DELETE /v1/merchants/:id — 409 merchant_has_payouts if history exists | > **NOTE: Multiple Pago Móvil methods** > > A merchant can have many 11-digit local Pago Móvil destinations (bankCode + phone). Each method is verified separately. Top-level bankCode/destination on the merchant mirror the default method. POST …/default switches that mirror; DELETE removes a destination and promotes another method when needed (verified preferred). Legacy POST /v1/merchants/:id/verify* routes target the default method. The gateway secretly generates two distinct 0.XX amounts on verify/start; never expose them in logs or webhooks. > **SUCCESS: Bank codes and logos** > > Set `bankCode` from GET /v1/banks (4-digit SIMF). That response also includes `logoUrl` — show the logo next to the bank name in your merchant onboarding UI so people can identify the destination bank at a glance. > **NOTE: Merchant externalRef** > > Map externalRef to your user or account id (e.g. usr_7f3a). Re-registering the same ref with the same payload returns 200 with the existing merchant; a different payload returns 409 external_ref_conflict. Resolve later with GET /v1/merchants?externalRef=… (see Find a merchant by externalRef below). > **NOTE: Optional bankCode + phone** > > POST /v1/merchants accepts bankCode and phone together to create the first Pago Móvil method, or omit both to create a merchant shell. When payoutMethods is empty, the response includes message: "No payout method exists…" — add one with POST /v1/merchants/:id/payout-methods before verify or payout. Providing only one of bankCode/phone returns 422 invalid_data. > **WARNING: Deactivate merchants — delete methods** > > Merchants are attached to payout history. DELETE /v1/merchants/:id hard-deletes a merchant (and its payout methods) only when it has no payouts — freeing externalRef for re-registration (409 merchant_has_payouts otherwise). Prefer set `isActive: false` to block new payouts while keeping history. Individual payout methods can be removed with DELETE /v1/merchants/:id/payout-methods/:methodId. Reactivate a merchant with `isActive: true` (no re-verification). Payout create requires an active merchant and a verified payout method; otherwise 409 `merchant_inactive` / `payout_method_not_verified` or 422 `no_verified_payout_method`. ### Register ```bash curl --request POST "${API_URL}/v1/merchants" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "externalRef": "usr_7f3a", "name": "Maria Perez", "identification": "V12345678", "contactEmail": "maria@mail.com", "contactPhone": "04141234567", "bankCode": "0134", "phone": "04145555555" }' ``` ### Register (no method) ```bash curl --request POST "${API_URL}/v1/merchants" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "externalRef": "usr_7f3a", "name": "Maria Perez", "identification": "V12345678", "contactEmail": "maria@mail.com", "contactPhone": "04141234567" }' # → payoutMethods: [], message: "No payout method exists…" ``` ### List / add methods ```bash curl "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods" \ --header "x-api-key: ${VEXPAY_API_KEY}" curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "bankCode": "0105", "phone": "04141234567" }' ``` ### Verify method ```bash curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods/METHOD_ID/verify/start" \ --header "x-api-key: ${VEXPAY_API_KEY}" curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods/METHOD_ID/verify" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amount1": "0.37", "amount2": "0.82" }' ``` ### Default / delete ```bash curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods/METHOD_ID/default" \ --header "x-api-key: ${VEXPAY_API_KEY}" curl --request DELETE "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods/METHOD_ID" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### List / status ```bash curl "${API_URL}/v1/merchants?status=verified&isActive=true&limit=25" \ --header "x-api-key: ${VEXPAY_API_KEY}" curl "${API_URL}/v1/merchants?externalRef=usr_7f3a" \ --header "x-api-key: ${VEXPAY_API_KEY}" curl "${API_URL}/v1/merchants/MERCHANT_ID" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### Deactivate ```bash curl --request PATCH "${API_URL}/v1/merchants/MERCHANT_ID" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "isActive": false }' ``` ### Delete merchant ```bash curl --request DELETE "${API_URL}/v1/merchants/MERCHANT_ID" \ --header "x-api-key: ${VEXPAY_API_KEY}" # 200 → { "deleted": true, "merchantId": "…", "externalRef": "…" } # 409 → { "error": "merchant_has_payouts", "payoutCount": N } ``` ## Delete a merchant Hard-delete a merchant (and its payout methods) when it has never received a payout. This frees the tenant-scoped externalRef so you can re-register the same seller id. Prefer PATCH isActive:false when payout history exists. | Outcome | Detail | | --- | --- | | DELETE /v1/merchants/:id | Tenant-scoped by x-api-key. Path id is the gateway merchant UUID. | | 200 OK | `{ "deleted": true, "merchantId", "externalRef" }` — merchant and payout methods removed; externalRef is free. | | 404 | Merchant not found for this tenant. | | 409 merchant_has_payouts | At least one payout exists (`payoutCount`). Deactivate with PATCH `{ "isActive": false }` instead. | > **WARNING: Delete vs deactivate** > > Delete is irreversible and only allowed with zero payouts. Deactivate keeps history, blocks new payouts, and can be reversed with isActive:true (no re-verification). Deleting a payout method (DELETE …/payout-methods/:methodId) is separate and does not remove the merchant. ### curl ```bash curl --request DELETE "${API_URL}/v1/merchants/00000000-0000-4000-8000-000000000000" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### 200 response ```json { "deleted": true, "merchantId": "00000000-0000-4000-8000-000000000000", "externalRef": "usr_7f3a" } ``` ### 409 response ```json { "error": "merchant_has_payouts", "payoutCount": 3 } ``` ## Find a merchant by externalRef Within a tenant, each merchant is uniquely identified by the externalRef you sent on register. Prefer looking up by that ref when your system stores the seller/user id, not the gateway merchantId. Auth is the tenant API key (`x-api-key`) — the lookup is always scoped to that tenant. | Endpoint | Returns | | --- | --- | | GET /v1/merchants?externalRef={ref} | Single merchant detail (same shape as GET /v1/merchants/:id), including payoutMethods[] | | GET /v1/merchants/:id | Same detail when you already have the gateway UUID | | GET /v1/merchants | Paginated list (`items`, `nextCursor`) when externalRef is omitted | > **NOTE: Tenant-scoped uniqueness** > > externalRef is unique per tenant (`@@unique([tenantId, externalRef])`). The same string under another tenant is a different merchant. A missing ref returns 404. Passing externalRef switches the list endpoint into single-object lookup mode (not a filtered list). ### curl ```bash curl "${API_URL}/v1/merchants?externalRef=usr_7f3a" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### JavaScript ```javascript const merchant = await fetch( `${process.env.API_URL}/v1/merchants?externalRef=${encodeURIComponent('usr_7f3a')}`, { headers: { 'x-api-key': process.env.VEXPAY_API_KEY } } ).then((r) => r.json()); // merchant.merchantId, merchant.status, merchant.payoutMethods ``` ## Simple and batch payouts | Endpoint | Purpose | | --- | --- | | POST /v1/payouts | Pay one verified + active merchant (optional payoutMethodId) | | POST /v1/payouts/batch | Pay many merchants; results are per item | | GET /v1/payouts | List payouts (optional status filter) | | GET /v1/payouts/:id | Recover by payout id | | GET /v1/payouts/by-ref/:externalRef | Recover by externalRef | > **NOTE: Collect first, then settle** > > For marketplace flows (charge the buyer, retain a fee, pay the seller net, or split across merchants after payment.completed), see Settle marketplace payments at /marketplace-settlement. To split one payment between several comercios at charge time, with optional automatic comercio payouts, see /marketplace-splits. This page covers merchant verification and payout mechanics only. ### Simple payout ```bash curl --request POST "${API_URL}/v1/payouts" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "merchantId": "00000000-0000-4000-8000-000000000000", "payoutMethodId": "00000000-0000-4000-8000-000000000001", "monto": "1523.40", "concepto": "Liquidacion semana 30", "externalRef": "po_9c21" }' ``` POST /v1/payouts/batch pays many verified merchants in one request. Each item is its own payout (own externalRef, status, and webhooks). Failures are per item — they do not roll back siblings. ### Batch payout ```bash curl --request POST "${API_URL}/v1/payouts/batch" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "externalRef": "corte_semana_30", "items": [ { "merchantId": "00000000-0000-4000-8000-000000000000", "payoutMethodId": "00000000-0000-4000-8000-000000000001", "monto": "1523.40", "concepto": "Liquidacion semana 30", "externalRef": "po_9c21_seller" }, { "merchantId": "00000000-0000-4000-8000-000000000002", "monto": "210.00", "concepto": "Liquidacion semana 30", "externalRef": "po_9c21_partner" } ] }' ``` ### 201 response ```json { "batchId": "00000000-0000-4000-8000-000000000010", "items": [ { "payoutId": "00000000-0000-4000-8000-000000000011", "status": "completed", "reference": "12345678", "failureCode": null, "externalRef": "po_9c21_seller", "merchantId": "00000000-0000-4000-8000-000000000000", "payoutMethodId": "00000000-0000-4000-8000-000000000001", "merchantName": "Maria Perez", "monto": "1523.40", "concepto": "Liquidacion semana 30", "bankCode": "0134", "destination": "…5555", "operationId": null, "createdAt": "2026-07-28T16:00:00.000Z", "settledAt": "2026-07-28T16:00:01.000Z" }, { "payoutId": "00000000-0000-4000-8000-000000000012", "status": "pending", "reference": null, "failureCode": null, "externalRef": "po_9c21_partner", "merchantId": "00000000-0000-4000-8000-000000000002", "payoutMethodId": "00000000-0000-4000-8000-000000000003", "merchantName": "Socio CA", "monto": "210.00", "concepto": "Liquidacion semana 30", "bankCode": "0102", "destination": "…1234", "operationId": "AC00-OP-EXAMPLE", "createdAt": "2026-07-28T16:00:00.000Z", "settledAt": null } ] } ``` ### List / status ```bash curl "${API_URL}/v1/payouts?status=pending&limit=25" \ --header "x-api-key: ${VEXPAY_API_KEY}" curl "${API_URL}/v1/payouts/PAYOUT_ID" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` > **WARNING: Replay safety** > > Repeating the same externalRef with the same payload returns the existing payout (200) and never re-executes the bank credit. A conflicting payload returns 409 external_ref_conflict. ## Webhook events - merchant.verified / merchant.rejected - merchant.deactivated / merchant.reactivated - payout.completed / payout.failed - Envelope remains { event, data, timestamp } with X-Webhook-Signature over the exact raw body. > **WARNING: merchant.rejected on data mismatch** > > When the bank rejects verification because bank/phone/cédula do not match (e.g. BE01), data includes failureCode, reason (Spanish bank copy), and action: payout_method_deleted (method removed so the merchant can re-register corrected details) or merchant_deactivated (method already had payout history). Re-subscribe to merchant.rejected to learn the destination is unusable. After payout_method_deleted, POST /v1/merchants again with the same externalRef and corrected details returns 200 with a new pending method (or POST …/payout-methods on the existing merchantId). ### merchant.rejected (deleted) ```json { "event": "merchant.rejected", "data": { "merchantId": "292d478b-a1fb-4d27-ab5c-8701ed14da88", "externalRef": "47b53d97-489f-4f8e-8843-6c24045e168d", "payoutMethodId": "0064456b-7a6a-4b7e-b0b5-d9b27b0dfa5c", "failureCode": "BE01", "reason": "Datos del cliente no corresponden a la cuenta", "action": "payout_method_deleted" }, "timestamp": "2026-07-23T18:12:05.000Z" } ``` --- # Settle marketplace payments (fee + payout) > Collect from a buyer into the tenant commerce account, retain a platform fee in your app, then pay verified seller Pago Móvil destinations with simple or batch payouts. Human docs: /marketplace-settlement ## What this workflow is Use this pattern when a seller registers a VES Pago Móvil destination, a buyer pays with their own Pago Móvil (bid or order amount), and your tenant must keep a fee before paying the seller — optionally splitting the credit across more than one verified merchant. > **NOTE: Seller balances (Connect-style)** > > Optional merchantId + applicationFeeVes (or applicationFeePercent) on payment create auto-credits the seller pending/available ledger on payment.completed. Transfer manually with POST /v1/merchants/:id/transfers. Read balances via GET /v1/merchants/:id/balance and GET /v1/balance. Payout from seller available with fromMerchantBalance: true. Classic paymentId remaining-net payouts remain supported. > **NOTE: Per-merchant commission** > > Set a default commission in the Tenant Portal (Merchants → Default commission) and override it per merchant (Commission column, or PATCH /v1/merchants/:id with applicationFeePercent; null = use the default). A charge with merchantId and no applicationFeeVes / applicationFeePercent uses the merchant rate, else the default. The rate is snapshotted on the payment, so later edits only affect new charges. An explicit fee on the request always wins. > **WARNING: Manual splits still supported** > > Without merchantId on the charge, collection and payout remain separate APIs. Pass optional paymentId on POST /v1/payouts or POST /v1/payouts/batch to link settlement legs to the funding payment and enforce remaining-net caps. > **NOTE: Several comercios in one payment?** > > Send `splits` (up to 10 comercios) on débito inmediato, C2P, Pago Móvil verify or VPOS instead of one merchantId: VEX Pay credits each comercio its share minus your commission and its part of the fee when the payment completes. See Marketplace: split one payment between comercios (/marketplace-splits). > **SUCCESS: Run it in Postman** > > Download the marketplace settlement collection and API environment from /postman. Import both files (baseUrl https://api.vexpay.app), set your tenant apiKey, then follow the run order (merchants → Débito 100.00 → payout smoke test). > **NOTE: Platform ledger fees follow the tenant’s rates** > > Completed collections also debit the tenant’s VEX Pay fee (feePercent + feeFixedUsd, minus reserve). See /pricing for the standard rates. Marketplace seller payouts are separate: you still retain your app fee by paying the seller less than you collected. ## End-to-end steps 1. **Register and verify the seller** — POST /v1/merchants with the seller’s bankCode + phone (and your seller id as externalRef), then run micro-deposit verify on the payout method. Details: Merchants & payouts (/merchants-payouts). 2. **Resolve the merchant before payout** — When settling, look up the seller under your tenant with GET /v1/merchants?externalRef={yourSellerId} — same auth as every other call (`x-api-key`). Prefer this over storing only the gateway merchantId. See /merchants-payouts#lookup-by-ref. 3. **Charge the buyer** — Collect into the tenant commerce account with C2P (recommended: POST /v1/payments/c2p/request then POST /v1/payments/c2p) or débito inmediato (POST /v1/payments/debit/otp then POST /v1/payments/debit). Send a stable payment externalRef for your order/bid. 4. **Wait for payment.completed** — Subscribe to payment.completed / payment.failed. On uncertain responses, recover with GET /v1/payments/by-ref/:externalRef before fulfilling or paying out. 5. **Compute fee and net VES** — Preferred: send merchantId with applicationFeePercent (or applicationFeeVes) on the charge — or on POST /v1/checkout/sessions — and VEX Pay keeps your fee and credits the seller’s net to its balance automatically. Without merchantId, compute it in your app (fee = collected × rate or fixed, net = collected − fee) and retain the fee by paying the seller less than you collected. 6. **Pay the seller (or split)** — POST /v1/payouts with the seller merchantId, exact net monto, and paymentId from the completed collection — or POST /v1/payouts/batch with paymentId plus one item per destination. Each payout item needs its own idempotent externalRef. Multiple partial payouts are allowed until remaining net is 0. ## Fee and split rules | Rule | Detail | | --- | --- | | Fee ownership | Prefer applicationFeeVes / applicationFeePercent on the charge (platform retains fee; seller net goes to pending). Manual retain-by-paying-less still works without merchantId. | | Seller ledger | GET /v1/merchants/:id/balance returns pendingVes + availableVes. POST /v1/merchants/:id/transfers moves tenant float → seller pending. fromMerchantBalance payouts debit seller available. | | Seller release | A seller sale (bolívares, USDT or COP) becomes available after the later of your seller hold (sellerHoldBusinessDays) and the 24h balance hold — a seller hold of 0 does not release a fresh sale immediately. | | Platform balance | GET /v1/balance returns platformAvailableVes, sellerObligationsVes, sellerPendingVes, sellerAvailableVes. | | Payout amounts | Exact two-decimal VES strings (e.g. "1523.40"). The gateway never FX-converts payouts. | | paymentId link | Optional on POST /v1/payouts and POST /v1/payouts/batch. Links legs to the funding payment for ops and remaining-net enforcement. | | Remaining net | remaining = vesAmount − feeVes − sum(PENDING\|COMPLETED payouts for that paymentId). FAILED legs free remaining. Exceeding remaining → 422 payment_split_exceeded. | | Multi-partial | Several payouts/batches may reference the same paymentId until remaining is 0. Same externalRef still idempotent-replays. | | Batch split | POST /v1/payouts/batch pays many verified merchants in one request. Results are per item — not all-or-nothing. Batch paymentId applies to every item. | | Commerce float | Classic payouts debit the tenant commerce account. Seller-balance payouts debit merchant available (tenant already reserved via SELLER_TRANSFER). | | Idempotency | Payment externalRef is correlation only (a ref already COMPLETED refuses new C2P/VPOS/débito charges with 409 external_ref_already_paid). Merchant and payout externalRef are required idempotency keys; paymentId is included in the payout request hash. | ## Minimal examples After the seller is verified and the buyer charge has completed, settle the net (or a multi-party split) with the payouts API. ### Seller register ```bash curl --request POST "${API_URL}/v1/merchants" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "externalRef": "seller_laganga_7f3a", "name": "Maria Perez", "identification": "V12345678", "contactEmail": "maria@mail.com", "contactPhone": "04141234567", "bankCode": "0134", "phone": "04145555555" }' ``` ### Charge buyer (C2P) ```bash curl --request POST "${API_URL}/v1/payments/c2p" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "intentId": "00000000-0000-4000-8000-000000000000", "usdAmount": 12.50, "debtorId": "V87654321", "debtorCellPhone": "584121234567", "debtorBankCode": 102, "token": "123456", "externalRef": "bid_1042" }' ``` ### Net payout ```bash curl --request POST "${API_URL}/v1/payouts" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "merchantId": "00000000-0000-4000-8000-000000000000", "paymentId": "00000000-0000-4000-8000-000000000010", "monto": "1371.06", "concepto": "Bid 1042 net", "externalRef": "po_bid_1042_seller" }' ``` ### Batch split ```bash curl --request POST "${API_URL}/v1/payouts/batch" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "externalRef": "settle_bid_1042", "paymentId": "00000000-0000-4000-8000-000000000010", "items": [ { "merchantId": "00000000-0000-4000-8000-000000000000", "monto": "1200.00", "concepto": "Seller net", "externalRef": "po_bid_1042_seller" }, { "merchantId": "00000000-0000-4000-8000-000000000002", "monto": "171.06", "concepto": "Partner share", "externalRef": "po_bid_1042_partner" } ] }' ``` > **NOTE: Fee stays in the tenant account** > > In the net-payout example, if settlement VES was 1523.40 and fee was 152.34, you pay "1371.06" to the seller and leave the fee in the tenant float. Only add a batch item for the fee if you must credit a separate verified fee merchant. ## Webhooks and recovery - Use paymentId on payouts to link settlement to the collection; use payment externalRef for your order id and payout / batch item externalRef for safe retries. - Subscribe to payment.completed / payment.failed before fulfilling the bid or order. - Subscribe to payout.completed / payout.failed after you trigger settlement. - Merchant verification and payout field rules: /merchants-payouts. Signature verification and delivery: /webhooks. --- # Look up and reverse payments > Reconcile by gateway ID or correlation reference, and reverse eligible C2P payments. Human docs: /payments ## Payment lookup ### By payment ID ```bash curl "${API_URL}/v1/payments/PAYMENT_ID" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### By external reference ```bash curl "${API_URL}/v1/payments/by-ref/order_demo_1042" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` > **NOTE: Use IDs for durable reconciliation** > > On payments, externalRef is a tenant-scoped correlation value only—not an idempotency key. Store the gateway payment ID returned at creation. Merchants and payouts treat externalRef as the idempotency key instead (see Merchants & payouts). ## Reverse a C2P payment POST /v1/payments/:id/reverse is supported for C2P payments only. Banking-network rules and payment state determine whether a reversal can complete. ### curl ```bash curl --request POST "${API_URL}/v1/payments/PAYMENT_ID/reverse" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` > **WARNING: C2P only** > > Do not call the reversal endpoint for VPOS or Pago Móvil verification records. ## Payment statuses | Status | Meaning | Next action | | --- | --- | --- | | PENDING | Intent created or operation awaiting completion | Wait for execution or reconcile by payment ID. | | COMPLETED | The banking network confirmed the payment | Fulfill once your business checks pass. | | FAILED | The charge or verification failed | Inspect failureCode and decide whether to ask for corrected details. | | CANCELED | C2P intent superseded by a newer attempt, or expired after 15 minutes | Do not fulfill. Use cancelReason (superseded \| expired). Listen for payment.canceled. | | REVERSED | A completed payment was reversed (C2P reversal, full card chargeback, or money that never reached the bank). A refunded COP payment reads as `refunded` instead. | Update the order and preserve reversal references; reversalType tells which. | --- # Receive signed webhooks > Verify HMAC signatures before applying payment state changes. Human docs: /webhooks ## Register an endpoint ### curl ```bash curl --request POST "${API_URL}/v1/webhooks" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "url": "https://merchant.example.com/webhooks/vexpay", "events": ["payment.pending", "payment.completed", "payment.failed", "merchant.verified", "merchant.rejected", "merchant.deactivated", "merchant.reactivated", "payout.completed", "payout.failed"] }' ``` ### Envelope ```json { "event": "payout.completed", "data": { "payoutId": "00000000-0000-4000-8000-000000000000", "externalRef": "po_a1", "reference": "16142941", "livemode": true }, "timestamp": "2026-07-20T15:00:00.000Z" } ``` ### merchant.rejected ```json { "event": "merchant.rejected", "data": { "merchantId": "292d478b-a1fb-4d27-ab5c-8701ed14da88", "externalRef": "seller_47", "payoutMethodId": "0064456b-7a6a-4b7e-b0b5-d9b27b0dfa5c", "failureCode": "BE01", "reason": "Datos del cliente no corresponden a la cuenta", "action": "payout_method_deleted", "livemode": true }, "timestamp": "2026-07-23T18:12:05.000Z" } ``` > **WARNING: Store the secret at creation** > > If you omit secret, the API generates one and returns it only in the create response. GET /v1/webhooks never returns secrets. > **NOTE: livemode** > > Every webhook `data` object includes `livemode` (true for Live keys, false for Test/sandbox twins). Register separate webhook URLs on the Live and Test twins when you need isolated staging delivery. > **NOTE: Verification mismatch** > > On merchant.rejected, reason is the Spanish bank reject message. When action is payout_method_deleted, the bad destination was removed so the merchant can re-register corrected bank/phone/cédula. When action is merchant_deactivated, the method had payout history so the merchant was deactivated instead (also emits merchant.deactivated). Update subscribed events later with PATCH /v1/webhooks/:id — sending events replaces the full list. You can also change url or isActive; the signing secret cannot be rotated via PATCH. ### curl ```bash curl --request PATCH "${API_URL}/v1/webhooks/ENDPOINT_ID" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "events": ["payment.completed", "payment.failed", "payout.completed", "payout.failed"] }' ``` Use POST /v1/notifications/test after registering an endpoint. Deliveries include `VexPay-Signature`, `VexPay-Event-Id`, and the legacy `X-Webhook-Event` / `X-Webhook-Signature` headers. ## Event catalog | Event | When | Key fields in data | | --- | --- | --- | | payment.pending | A payment was created and awaits completion | paymentId, method, externalRef | | payment.completed | The payment was confirmed and credited to your balance | paymentId, method, vesAmount / amountCop / amountUsdt, fee | | payment.failed | The charge failed or expired | paymentId, failureCode | | payment.canceled | An intent was canceled (superseded, expired or by you) | paymentId, cancelReason | | payment.reversed | A completed payment was reversed: a C2P reversal, a COP refund, a full card chargeback, or money that never reached the bank | paymentId, reversalType (reversal \| chargeback \| bank_not_received), reversalRef. A COP refund carries method "COP", status "refunded", amountCop and feeCop, and no reversalType. | | payment.chargeback | The bank charged back a card (VPOS) payment; your VES balance was debited | chargebackId, paymentId, amountVes, feeVes, reason, ledgerEntryIds | | payment.chargeback_closed | A chargeback was decided: won (money returned) or lost | chargebackId, paymentId, outcome, ledgerEntryIds | | payout.completed / payout.failed | A payout was paid or failed (failed payouts return the money) | payoutId, currency, failureReason. Bolívar and VEX Wallet payouts carry channel: PAGO_MOVIL, BANK_ACCOUNT (checking account, with the masked destination ••••6789) or WALLET. | | conversion.created | A VES or COP→USDT conversion started (including auto-convert of a COP payment) | conversionId | | conversion.completed / conversion.canceled | A VES or COP→USDT conversion finished or was canceled | conversionId | | merchant.* | Merchant lifecycle and balances (marketplaces) | merchantId, externalRef | | tenant.* | Your account status, live activation and API keys | — | | customer.* · customer.subscription.* · invoice.* · payment_method.* | Subscriptions and recurring billing — see /subscriptions#webhooks | The customer, subscription, invoice or payment method | | notification.test | POST /v1/notifications/test | — | Every movement of your VES balance — including chargebacks and adjustments that are not a normal payment or payout — is listed in `GET /v1/balance/transactions`. See Reconcile your balance. ## Delivery behavior - Each event is attempted once. Failed deliveries are not retried. - Your endpoint has 10 seconds to respond. - Event ordering is not guaranteed; compare payment status instead of arrival order. - Return a 2xx response only after the event is accepted for durable processing. - Reconcile missed or uncertain events through the payment lookup endpoints. > **WARNING: Single attempt, no retry** > > Queue verified events quickly and process them asynchronously. Your own reconciliation job should cover downtime and timeout scenarios. ## Verify the signature Prefer the `VexPay-Signature` header (`t=,v1=`). The `v1` value is HMAC-SHA256 of `.` with your endpoint secret. Reject deliveries whose `t` is outside your tolerance (official SDKs default to 300 seconds). Use `VexPay-Event-Id` to deduplicate. ### Node (@vexpay/node) ```javascript import VexPay from '@vexpay/node'; const vexpay = new VexPay(process.env.VEXPAY_API_KEY); app.post('/webhooks/vexpay', express.raw({ type: 'application/json' }), (req, res) => { const event = vexpay.webhooks.constructEvent( req.body, req.headers['vexpay-signature'], process.env.VEXPAY_WEBHOOK_SECRET, ); // fulfill from event.data — then res.sendStatus(200) }); ``` ### Python (vexpay) ```python from vexpay import Webhook event = Webhook.construct_event( request.body, # raw bytes request.headers["VexPay-Signature"], os.environ["VEXPAY_WEBHOOK_SECRET"], ) ``` > **NOTE: Legacy header (still sent)** > > Deliveries also include `X-Webhook-Signature: sha256=`. Existing verifiers keep working; new integrations should use `VexPay-Signature` for replay protection. > **NOTE: Preserve the raw body** > > JSON parse/stringify can change whitespace or key ordering. Verify the bytes received on the wire. --- # Balances, holds and payouts > What is available, what waits for bank confirmation and why, how automatic settlement works, what payouts cost, and how to reconcile it all. Human docs: /balances ## The parts of a balance Each currency (bolívares, USDT, USDC, Colombian pesos) has its own balance. Inside each one, your money is in one of these states: | State | What it is | Can be paid out? | | --- | --- | --- | | Available | Released money you can withdraw, pay out or convert | Yes | | Awaiting bank confirmation (Bs only) | Bolívar payments the bank has not confirmed yet (`unconfirmedVes`) | Not yet — it becomes available on its own once the bank confirms it | | Held | A balance hold VEX Pay set for your account, if any (none by default) | Not yet — it becomes available on its own | | Reserve (Bs only) | A safety buffer set by VEX Pay for your account, if any | No | | Pending payout | Reserved by payouts that are on their way | Already leaving | ### Bolívares ```bash curl "${API_URL}/v1/balance" --header "x-api-key: ${VEXPAY_API_KEY}" # availableVes = ledgerNetVes − reserveVes − heldVes − unconfirmedVes ``` ### USDT / USDC ```bash curl "${API_URL}/v1/crypto/balances" --header "x-api-key: ${VEXPAY_API_KEY}" # each: available, held, nextReleaseAt, pendingPayout (USDT also availableUsdt, heldUsdt) ``` ### Pesos ```bash curl "${API_URL}/v1/cop/balance" --header "x-api-key: ${VEXPAY_API_KEY}" # availableCop, heldCop, nextReleaseAt, pendingPayoutCop ``` ## Bank confirmation (no 24h hold) There is no time-based hold by default (`balanceHoldHours` is 0). A bolívar payment counts toward `availableVes` once the bank confirms the money arrived; until then it is in `unconfirmedVes`. Nothing needs to happen on your side and no webhook is sent when it clears. USDT and pesos are available as soon as they are credited, except USDT bought (converted) with bolívares still awaiting bank confirmation: it shows as held (`heldUsdt`, with no `nextReleaseAt`) and becomes available once the bank confirms every payment it was paid from. | Movement | Waits for the bank? | | --- | --- | | Completed bolívar payments, net of the VEX Pay fee | Yes — until the bank confirms the payment | | Bolívar payments the bank cannot find | Yes — they stay out of available until VEX Pay resolves them | | USDT, USDC and peso payments | No | | Money coming back: failed payouts, canceled conversions, fee reversals | No — it returns exactly as it left | | While bolívares await the bank, you can… | Rule | | --- | --- | | Pay out to your bank or a seller | No — payouts spend bank-confirmed money only | | Convert to USDT | Yes | | Transfer to a seller | Yes | | Refund or reverse the payment | Yes, when your balance covers it | > **NOTE: Test mode** > > Test payments are never checked against a bank, so test credits are available at once. Test mode never sends money and is never settled automatically. ## Automatic settlement In live mode, as soon as the bank confirms a payment VEX Pay sends your whole available bolívar balance to your verified payout account as an instant payout, usually within a minute. A run every 15 minutes catches anything the first attempt missed. Each payout is split in two when your balance arrived through more than one bank, since each payout leaves in one bank transfer. It goes through the same path as `POST /v1/payouts/instant`: your instant payout fee applies, the payout appears in `GET /v1/payouts`, and you receive the usual `payout.*` webhooks. | Detail | Value | | --- | --- | | What is sent | All of `availableVes`, in at most two payouts at a time; each one is sent once it reaches the minimum (`settlement.minimumVes`, Bs 100.00 by default), and a smaller part waits for the next payment or run | | How to recognize it | `externalRef` starts with `auto_settle_` (followed by the payment id, or by the run time for the 15-minute run); the bank concept reads “Liquidacion VEX Pay” | | If it fails | The money returns to your balance and the next run tries again | | No verified payout account | Nothing is sent, and your live payment links and checkouts are paused until you add and verify one | | Your status | `settlement` on `GET /v1/balance`: `enabled` and `status` (`active`, `no_payout_account`, `payout_account_unverified`, `payout_account_cooling`, `paused`, `disbursements`, `test_mode`) | You can still withdraw yourself with `POST /v1/payouts/instant`. Automatic settlement cannot be turned off: VEX Pay does not keep your bolívares. Accounts that pay their end users from their balance (disbursements) are not settled automatically. ## When a payout is refused A payout larger than the available part answers 422 `insufficient_balance` with the amounts you need to decide what to do: ### 422 insufficient_balance ```json { "error": "insufficient_balance", "availableVes": "3000.00", "requestedVes": "4000.00", "heldVes": "0.00", "unconfirmedVes": "4342.50", "nextReleaseAt": null, "maxPayoutVes": "3000.00" } ``` - Pay out at most the available amount now. `unconfirmedVes` becomes available as the bank confirms each payment. - A Bs payout is sent as one bank transfer and is never split, so the most a single payout can take is `maxPayoutVes`, which can be lower than `availableVes`. Send that amount, then the rest in a second payout. - Do not retry in a loop — nothing changes until the bank confirms a payment or new money arrives. - USDT payouts answer the same way with `availableUsdt`, `heldUsdt` and `nextReleaseAt`; ops COP payouts with `availableCop` and `heldCop`. ## What payouts cost | Payout | Fee | | --- | --- | | To your own bank account (instant withdrawal) | Your bolívar percentage on the amount withdrawn | | To your verified sellers | Free (a seller payout fee may apply by agreement) | | USDT to an external wallet | The network’s payout fee, shown by GET /v1/crypto/networks | | USDC to an external wallet | The network’s payout fee, shown by GET /v1/crypto/networks | | To one of your own deposit addresses | Free — settled inside VEX Pay | `GET /v1/crypto/networks` returns the exact payout fee per network before you send. The fee is reserved together with the amount and returned if the payout fails. ## Reconcile it 1. **Walk the movements** — GET /v1/balance/transactions lists every bolívar movement. The sum equals ledgerNetVes. 2. **Account for bank confirmation** — Sum minus reserveVes minus heldVes minus unconfirmedVes equals availableVes. Automatic settlements are payouts with an externalRef starting with auto_settle_. 3. **Alert on drift** — If your books disagree, the missing movement is in that list — match it by id. --- # Reconcile your balance > List every movement of your VES balance, rebuild it exactly, and handle card chargebacks automatically. Human docs: /reconcile ## Balance movements `GET /v1/balance/transactions` lists every movement of your VES balance, newest first: payments, fees, payouts, reversals, card chargebacks, adjustments, seller transfers and conversions. Each movement has a stable `id`, a `type`, a signed `amountVes` (negative = money out) and the linked `paymentId` / `payoutId` / `chargebackId`. ### curl ```bash curl "${API_URL}/v1/balance/transactions?limit=100" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### Node SDK ```javascript let total = 0; for await (const m of vexpay.balance.transactions.list({ limit: 100 })) { total += Number(m.amountVes); } const balance = await vexpay.balance.retrieve(); // total === Number(balance.ledgerNetVes) ``` ### Response ```json { "items": [ { "id": "6b1f…", "type": "chargeback", "amountVes": "-4000.00", "paymentId": "a3c9…", "chargebackId": "c71e…", "externalRef": "order-1042", "description": "Card chargeback (fraud)", "createdAt": "2026-10-08T14:02:11.000Z" }, { "id": "5e0a…", "type": "fee", "amountVes": "-140.00", "paymentId": "a3c9…", "description": "Platform fee", "createdAt": "2026-10-01T10:00:00.000Z" } ], "nextCursor": "MjAyNi0xMC0wMVQxMDowMDowMC4wMDBafDVlMGE…" } ``` - Pass `nextCursor` as `cursor` for older movements; `nextCursor: null` is the last page. New movements never shift the pages you are walking. - Filter with `type` (repeat or comma-separate), `paymentId`, `payoutId`, `from` (inclusive) and `to` (exclusive). - The sum of `amountVes` over all movements equals `ledgerNetVes` from `GET /v1/balance`; minus `reserveVes` and `heldVes` it equals `availableVes`. Movements still under the 24h balance hold carry `availableAt`. If your ledger disagrees, the movement you are missing is in this list. ## Card chargebacks When a cardholder disputes a card (VPOS) payment, the bank charges it back. VEX Pay debits the charged-back amount — plus a chargeback fee, when there is one — from your VES balance (from the payment’s held funds while that payment is still in its hold, otherwise from your available balance) and sends `payment.chargeback` (see Chargeback events below). The platform fee of the original payment is not returned. A chargeback for the full amount also marks the payment `REVERSED` and sends `payment.reversed` with `reversalType: "chargeback"`. - `ledgerEntryIds` are the ids of the movements the event created — find them in `GET /v1/balance/transactions?paymentId=…` to book the debit without guessing. - Your balance can go negative. While it is negative, payouts and conversions answer `insufficient_balance` until new collections cover it. - When the dispute is decided you receive `payment.chargeback_closed`: `outcome: "won"` returns the amount and fee (new `chargeback_reversal` movements, payment back to `COMPLETED`); `outcome: "lost"` changes nothing more. - Partial chargebacks are possible; a payment can have several, never more than its amount. > **NOTE: Subscribe to the events** > > Webhook endpoints receive only the events they list. Add `payment.chargeback` and `payment.chargeback_closed` with PATCH /v1/webhooks/:id. ## Chargeback events Both events use the standard signed envelope (`VexPay-Signature`, `VexPay-Event-Id`) and are only delivered to endpoints that list them. `data` has the same fields in both; `payment.chargeback_closed` adds `outcome` and `closedAt`. | Field | Type | Meaning | | --- | --- | --- | | chargebackId | string (uuid) | Stable id of the chargeback. Same value in both events. | | paymentId / externalRef | string | The card payment that was charged back and your reference for it. | | method | "VPOS" | Card payments only. | | status | "open" \| "won" \| "lost" | State of the chargeback when the event was sent. | | outcome | "won" \| "lost" | Only in payment.chargeback_closed. | | amountVes | string, 2 decimals | Charged-back amount (positive). Partial chargebacks are possible. | | feeVes | string, 2 decimals | Chargeback fee debited on top of the amount ("0.00" when none). | | reason | string | fraud \| not_recognized \| not_received \| duplicate \| other. | | bankDebitedAt | ISO 8601 | When the bank debited the chargeback. | | paymentStatus | string | Payment status after the event: REVERSED for a full chargeback (open or lost), COMPLETED for a partial one or after a won dispute. | | vesAmount / usdAmount | string, 2 decimals | Amounts of the original payment. | | ledgerEntryIds | string[] | Ids of the balance movements this event created (empty when closed as lost). Match them in GET /v1/balance/transactions. | | createdAt / closedAt | ISO 8601 | When the chargeback was recorded / decided. | | livemode | boolean | false for test-mode deliveries. | ## Example bodies A full Bs 4,000.00 chargeback with a Bs 50.00 fee on payment `order-1042`, then the dispute closed. `livemode` is added to every `data` object. ### payment.chargeback ```json { "event": "payment.chargeback", "data": { "chargebackId": "c71e2f4a-8d1b-4c3e-9a6f-2b5d7e9c1a03", "paymentId": "a3c9b8d2-5e4f-4a1b-8c7d-6e5f4a3b2c10", "externalRef": "order-1042", "method": "VPOS", "status": "open", "amountVes": "4000.00", "feeVes": "50.00", "reason": "fraud", "bankDebitedAt": "2026-10-07T00:00:00.000Z", "paymentStatus": "REVERSED", "vesAmount": "4000.00", "usdAmount": "100.00", "ledgerEntryIds": [ "6b1f0c2e-3d4a-4b5c-8d9e-0f1a2b3c4d5e", "7c2a1d3f-4e5b-4c6d-9e0f-1a2b3c4d5e6f" ], "createdAt": "2026-10-08T14:02:11.000Z", "livemode": true }, "timestamp": "2026-10-08T14:02:11.412Z" } ``` ### payment.chargeback_closed (won) ```json { "event": "payment.chargeback_closed", "data": { "chargebackId": "c71e2f4a-8d1b-4c3e-9a6f-2b5d7e9c1a03", "paymentId": "a3c9b8d2-5e4f-4a1b-8c7d-6e5f4a3b2c10", "externalRef": "order-1042", "method": "VPOS", "status": "won", "outcome": "won", "amountVes": "4000.00", "feeVes": "50.00", "reason": "fraud", "bankDebitedAt": "2026-10-07T00:00:00.000Z", "paymentStatus": "COMPLETED", "vesAmount": "4000.00", "usdAmount": "100.00", "ledgerEntryIds": [ "8d3b2e4a-5f6c-4d7e-0f1a-2b3c4d5e6f70", "9e4c3f5b-6a7d-4e8f-1a2b-3c4d5e6f7081" ], "createdAt": "2026-10-08T14:02:11.000Z", "closedAt": "2026-10-22T09:30:00.000Z", "livemode": true }, "timestamp": "2026-10-22T09:30:00.518Z" } ``` ### payment.chargeback_closed (lost) ```json { "event": "payment.chargeback_closed", "data": { "chargebackId": "c71e2f4a-8d1b-4c3e-9a6f-2b5d7e9c1a03", "paymentId": "a3c9b8d2-5e4f-4a1b-8c7d-6e5f4a3b2c10", "externalRef": "order-1042", "method": "VPOS", "status": "lost", "outcome": "lost", "amountVes": "4000.00", "feeVes": "50.00", "reason": "fraud", "bankDebitedAt": "2026-10-07T00:00:00.000Z", "paymentStatus": "REVERSED", "vesAmount": "4000.00", "usdAmount": "100.00", "ledgerEntryIds": [], "createdAt": "2026-10-08T14:02:11.000Z", "closedAt": "2026-10-22T09:30:00.000Z", "livemode": true }, "timestamp": "2026-10-22T09:30:00.518Z" } ``` ### payment.reversed (full chargeback) ```json { "event": "payment.reversed", "data": { "paymentId": "a3c9b8d2-5e4f-4a1b-8c7d-6e5f4a3b2c10", "externalRef": "order-1042", "status": "REVERSED", "method": "VPOS", "usdAmount": 100, "vesAmount": 4000, "bcvRate": 40, "feeVes": 140, "netVes": 3860, "cardLast4": "4242", "reversedAt": "2026-10-08T14:02:11.000Z", "reversalRef": "chargeback:c71e2f4a-8d1b-4c3e-9a6f-2b5d7e9c1a03", "reversalType": "chargeback", "chargebackId": "c71e2f4a-8d1b-4c3e-9a6f-2b5d7e9c1a03", "chargebacks": [ { "chargebackId": "c71e2f4a-8d1b-4c3e-9a6f-2b5d7e9c1a03", "status": "open", "amountVes": "4000.00", "feeVes": "50.00", "reason": "fraud", "bankDebitedAt": "2026-10-07T00:00:00.000Z" } ], "createdAt": "2026-10-01T10:00:00.000Z", "livemode": true }, "timestamp": "2026-10-08T14:02:11.430Z" } ``` ### GET /v1/balance/transactions?paymentId=… ```json { "items": [ { "id": "7c2a1d3f-4e5b-4c6d-9e0f-1a2b3c4d5e6f", "type": "chargeback_fee", "amountVes": "-50.00", "paymentId": "a3c9b8d2-5e4f-4a1b-8c7d-6e5f4a3b2c10", "chargebackId": "c71e2f4a-8d1b-4c3e-9a6f-2b5d7e9c1a03", "externalRef": "order-1042", "description": "Chargeback fee", "createdAt": "2026-10-08T14:02:11.000Z" }, { "id": "6b1f0c2e-3d4a-4b5c-8d9e-0f1a2b3c4d5e", "type": "chargeback", "amountVes": "-4000.00", "paymentId": "a3c9b8d2-5e4f-4a1b-8c7d-6e5f4a3b2c10", "chargebackId": "c71e2f4a-8d1b-4c3e-9a6f-2b5d7e9c1a03", "externalRef": "order-1042", "description": "Card chargeback (fraud)", "createdAt": "2026-10-08T14:02:11.000Z" }, { "id": "5e0a9b8c-7d6e-4f5a-8b9c-0d1e2f3a4b5c", "type": "fee", "amountVes": "-140.00", "paymentId": "a3c9b8d2-5e4f-4a1b-8c7d-6e5f4a3b2c10", "externalRef": "order-1042", "description": "Platform fee", "createdAt": "2026-10-01T10:00:00.000Z" }, { "id": "4d9f8a7b-6c5d-4e4f-9a8b-7c6d5e4f3a2b", "type": "payment", "amountVes": "4000.00", "paymentId": "a3c9b8d2-5e4f-4a1b-8c7d-6e5f4a3b2c10", "externalRef": "order-1042", "description": "Payment collected", "createdAt": "2026-10-01T10:00:00.000Z" } ], "nextCursor": null } ``` `ledgerEntryIds` of `payment.chargeback` are the `chargeback` and `chargeback_fee` movements above. When the dispute is won, `payment.chargeback_closed` carries the ids of two new `chargeback_reversal` movements (+4,000.00 and +50.00). When it is lost, `ledgerEntryIds` is empty and nothing else moves. > **NOTE: Handle retries safely** > > Deduplicate on `VexPay-Event-Id`, and book each movement once by its id from `ledgerEntryIds` — the same chargeback never creates its movements twice. --- # Safe retries with Idempotency-Key > Retry mutating API calls without creating duplicate payments or payouts. Human docs: /idempotency ## Send Idempotency-Key on POST All tenant-authenticated `POST` routes under `/v1/*` accept an optional `Idempotency-Key` header (1–255 printable ASCII). Keys are scoped per tenant environment (live and test twins do not share keys). Requests without the header behave exactly as before. - Same key + same method/path/body within 24h → replay the stored response with `Idempotent-Replayed: true`. - Same key + different body → 409 `idempotency_key_reused`. - Same key while the first request is still in flight → 409 `idempotency_request_in_progress` (retry later). - 5xx and interrupted requests are not stored — retry with the same key is safe. > **NOTE: Official SDKs** > > `@vexpay/node`, `vexpay` (Python), and `vexpay/vexpay-php` automatically send a UUID `Idempotency-Key` on every POST and reuse it across network retries. Pass your own key when you want to correlate with an order id. ## Relationship to externalRef On payments, `externalRef` remains correlation-only. On merchants and payouts, `externalRef` stays the resource-level idempotency key and works independently of `Idempotency-Key`. --- # Handle errors and limitations > Design for validation failures, service availability, limits, and uncertain network outcomes. Human docs: /errors ## Status codes | Status | Meaning | Action | | --- | --- | --- | | 400 | Invalid request input | Correct the request; do not retry unchanged. | | 401 | Missing, invalid, or inactive API key | Check x-api-key and key rotation. | | 403 | `live_mode_not_activated` — live account pending VEX Pay review or suspended | Use your Test key; request go-live from the portal (see Going live). Do not retry. | | 403 | This method is not enabled on your account (advanced débito/crédito endpoints) | Use a routed endpoint or ask VEX Pay ops to allow the method; do not retry unchanged. | | 404 | Payment or resource not found for tenant | Check the ID and tenant scope. | | 409 | `payout_account_required` — live links and checkout sessions need a verified Pago Móvil payout account (`payoutAccountStatus`: `missing`, `pending_verification`, `verifying`, `rejected` or `locked`) | Save and verify the payout account in Portal → Payouts, then retry. | | 422 | The banking network rejected the operation | Inspect the error code and do not retry unchanged. | | 422 | `seller_limit_reached` / `seller_ticket_limit` — the sale would pass the seller’s monthly or per-sale limit (every VEX Pay seller except internal accounts). Body: `message` (Spanish, buyer-safe), `limitUsd`, `usedUsd` (monthly only), `level` | Show the message to the buyer; the seller raises the limit by verifying. See Seller levels & limits. Do not retry unchanged. | | 422 | `insufficient_balance` — the payout is larger than your available balance; part of it may be on the 24h hold (`heldVes` / `heldUsdt` / `heldCop`, `nextReleaseAt`). A Bs payout goes out as one transfer, so it can also be refused below `availableVes`: `maxPayoutVes` is the most one payout can take | Pay out at most `maxPayoutVes` (Bs) or the available amount, or retry after `nextReleaseAt`. See Balances, holds and payouts. | | 503 | Payment service unavailable | Retry later after confirming the original payment status. | | 5xx | Gateway or banking-network failure | Treat the outcome as uncertain; look up the payment. | ## Current limitations - C2P reversal is the only supported reversal flow. - Webhook delivery is one attempt with no automatic retry and a 10-second timeout. - On payments, externalRef is correlation only; use Idempotency-Key for safe retries. A C2P, VPOS or débito charge whose externalRef already has a COMPLETED payment is refused with 409 external_ref_already_paid (paymentId in the body). On merchants and payouts externalRef is required and is the resource idempotency key (max 64, unique per tenant). - The tenant application gathers C2P tokens; the backend does not message customers. ## Recover safely 1. **Record the attempt** — Persist your order reference and any returned gateway payment ID. 2. **Resolve uncertainty** — Look up by payment ID, or externalRef when no ID was received. 3. **Retry deliberately** — Only submit another mutation after confirming the original did not complete. --- # Seller verification levels and limits > Every VEX Pay seller collects up to a monthly and per-sale limit set by its verification level. VEX Pro raises them. Human docs: /seller-levels ## How levels work > **NOTE: Every seller** > > Limits are enforced for every VEX Pay seller, including accounts created before self-serve sign-up (November 2026). Only VEX Pay’s own internal accounts have no level. An existing live account with an approved verification started with at least level 1 limits. A **seller** is any live VEX Pay account (a person with a personal RIF, or a company with a J RIF), however it was created, or a VEX Wallet seller. Each seller has a level from 0 to 3. The level comes from verification items; points (0–100) only show progress. A seller keeps a level while every item it needs stays done: a revoked item lowers the level at once. | Level | Name | Needs | | --- | --- | --- | | 0 | Registrado | Sign-up only (test mode; no live sales) | | 1 | Identidad verificada | Email and WhatsApp, identity (ID and selfie, a Didit check, or a linked VEX Wallet KYC), RIF on SENIAT, a payout account in the seller’s name | | 2 | Vendedor verificado | Level 1, plus proof of address, business details, and a sales track record or reviewed online presence | | 3 | Negocio registrado | Level 2, plus the business registration (firma personal; companies meet it with their KYB) | Each level has a monthly limit and a per-sale limit, which grow with the level. A seller sees its own limits, this month’s usage and when it resets in the portal and in VEX Wallet; VEX Pay does not publish them. The month is the calendar month in Caracas time. Usage is the sum of the seller’s live sales in the month, each counted at its US dollar amount fixed when the sale was created (Bs at the BCV rate, USDT one to one, COP at the day’s rate). Failed, expired, canceled and fully reversed sales, top-ups and test mode do not count. VEX Pay ops can set a different level or custom limits for a seller, always with a written reason. ## Raise your limits 1. **Open Verificación** — In the portal, **Verification** shows your level, points, limits, this month’s usage and when it resets, and what each item still needs. 2. **Complete the items** — Upload your documents (ID, selfie, SENIAT RIF certificate with its QR, proof of address, firma personal registration), verify a Pago Móvil payout account in your name, and tell us what you sell. 3. **Wait for the review** — Most items update on their own. Proof of address, the firma personal and online presence are reviewed by VEX Pay. The level rises as soon as the items are done. Sellers get an email and a WhatsApp message once a month when they reach 80% and 100% of their monthly limit. ## A RIF to sell, and the sworn declaration Every seller needs a verified RIF to sell. A person signs up with a V or E RIF (or a passport, as a foreign seller); a company with its J or G RIF. A person who uploads a J or G RIF is asked to open a company account instead. USDT (conversions to USDT, USDT payouts and withdrawals, saving a USDT payout wallet) can be limited to sellers with a verified RIF. When that applies, the call answers `403 rif_required_for_usdt` and bolívares keep settling to the seller’s Pago Móvil. **Sworn declaration of funds.** Every seller accepts a short sworn declaration of the origin and destination of its funds (in Spanish) before selling live, again when the text changes, every 12 months, and the first time in a month its collections reach US$1,000. Sellers from before the declaration have a grace period. A seller who declares being a politically exposed person (PEP) is reviewed by VEX Pay before selling live. While a declaration is owed, new live sales answer `422 declaration_required`. A payment the buyer already sent is never refused. ## Errors | Status | Code | When | Body | | --- | --- | --- | --- | | 422 | `seller_limit_reached` | The sale would take the seller past its monthly limit. Returned before any bank call, on every rail (C2P, card, débito inmediato, domiciliación, Pago Móvil instructions, USDT and COP). | `message` (Spanish, safe to show the buyer), `limitUsd`, `usedUsd`, `level` | | 422 | `seller_ticket_limit` | The sale, or a payment link at creation, is above the seller’s per-sale limit. | `message`, `limitUsd`, `level` | | 422 | `declaration_required` | The seller owes the sworn declaration of funds, or a PEP declaration is in review. | `message` (buyer-safe), `reason` | | 403 | `rif_required_for_usdt` | A seller without a verified RIF tried a USDT conversion, a USDT payout or withdrawal, or to save a USDT payout wallet. | `message` | | 409 | `rif_taken` | Sign-up: the RIF is already the tax ID of another business. `company_rif_taken` is the deprecated name, still sent while sign-up is for companies only; accept both. With identity keys on, the body also has `matched` (see One seller account). | `message`, `field`, `matched`? | | 409 | `identity_taken` | Sign-up or KYB submission: the cédula or WhatsApp number already belongs to another seller account (rolling out). | `message`, `field`, `matched` (`rif`, `cedula` or `phone`) | | 409 | `registration_taken` | Firma personal upload: this Registro Mercantil entry (office, tomo and número) is already another seller’s. Nothing is stored. | `message`, `field` | | 409 | `registration_rif_mismatch` | Firma personal upload: the RIF on the registration is not the seller’s RIF. Nothing is stored. | `message`, `field` | ### 422 seller_limit_reached ```json { "error": "seller_limit_reached", "message": "Este vendedor alcanzó su límite de cobros de este mes. Intenta otro método o contacta al vendedor.", "limitUsd": "250.00", "usedUsd": "240.00", "level": 1 } ``` > **NOTE: Money already sent is never refused** > > A Pago Móvil or a USDT deposit the buyer already sent is credited even when it passes the limit. It counts in the month’s usage and VEX Pay ops review it. ## One seller account (app and portal) > **NOTE: Rolling out** > > Identity keys are switched on in steps: first VEX Pay only records duplicates, then it refuses them. A person or business has **one seller account**, whether they started in the VEX Pay app (Vender con VEX) or on the portal. VEX Pay keeps one record per RIF, per cédula (including the cédula inside a personal V or E RIF; a company representative’s cédula is not counted) and per verified WhatsApp number. Signing up again with one of them does not create a second account: the portal answers `409 rif_taken` (or `identity_taken`, or `phone_taken`), and the app answers `409 SELLER_ACCOUNT_EXISTS`. The answer never names the other account, and each refusal counts toward the sign-up limit per IP. To use the same business from the app and the portal, its owner connects it from the VEX Pay app with the business code (see The business owner uses the VEX Pay app). If that is not possible, VEX Pay support links the logins by hand after checking the person. ### 409 rif_taken ```json { "error": "rif_taken", "message": "No pudimos crear la cuenta con este RIF. Si ya usas VEX Pay, inicia sesión o escríbenos a soporte.", "field": "rif" } ``` ## The business owner uses the VEX Pay app > **NOTE: Rolling out** > > The owner rule is switched on in steps: first VEX Pay only logs what it would refuse, then it refuses. Existing businesses get a notice with their code and 30 days to connect. Every live business has an **owner**: a person verified in the VEX Pay app (Didit). After you confirm your email and WhatsApp on the portal, the portal shows a 6-character code and a QR. Open the app, verify your identity and enter the code (“Tengo un código de negocio”), or scan the QR. The app shows “Conectar con ”; confirming links the business. Until then you can use test mode, but you can’t send your verification, request go-live or create live keys: the answer is `409 owner_not_linked`. 1. **Personal business (V or E RIF)** — The cédula in the RIF and the name must match your verified identity in the app. 2. **Company (J or G RIF)** — You must be its legal representative: your document and name must match the representative in the verification. With no representative yet, confirming makes you the representative, and your name and document come from the app (shown as “Verificado en la app”, read-only). Your ID and selfie uploads are then not required. 3. **Starting in the app** — “Abrir cuenta de negocio” in the app creates the business with you as owner and opens the portal, signed in, on the verification step. | Status | Code | When | Body | | --- | --- | --- | --- | | 409 | `owner_not_linked` | The business has no app owner yet (KYB submit, go-live request, live keys, new payment links). An approved business whose 30 days ended has `reason: "grace_expired"`; its links pause, payouts of its balance keep working. | `message`, `reason`? | | 409 | `owner_mismatch` | In the app: the verified identity does not match the RIF or the legal representative. Nothing is linked; there is no override. | `message` | ## Verify your identity with Didit Sellers who are people (signed up on the portal, in the VEX Pay app or created by VEX Pay) can complete the identity item in the portal with **Verificar con Didit** (in KYB → Documentos): a photo of the cédula or passport and a selfie with a liveness check. When Didit approves and the document number matches your personal RIF and the name matches the applicant, identity is done without waiting for VEX Pay review. Otherwise the item stays in review and VEX Pay checks it. Uploading the ID and the selfie by hand is still available. You can start up to 3 Didit checks a month; an unfinished one is resumed. If your VEX Pay app account is KYC-verified with the same name and document as the application, identity is already done and no Didit step is shown (`409 didit_not_needed`). Without a linked app account, confirm your email and WhatsApp before opening Didit. Rolling out. ## Appeal a declined or revoked item When VEX Pay declines or revokes an item, the Verificación page shows the reason. The decision stands until it is reviewed again: a new upload does not undo it. Use **Apelar** to explain (20 to 1,000 characters) and attach up to 3 documents. You can have one open appeal per item; after a rejected appeal you can appeal the same item again 30 days later. Opening an appeal does not change your level or limits. VEX Pay decides with a note and emails you. Items revoked for a sanctions match or fraud show **Contacta a soporte** instead. Rolling out. ## Verified-seller badge On the hosted checkout, payment links and the receipt, a seller at level 1 or above shows **Vendedor verificado · Nivel N** next to its name. Opening it lists what VEX Pay checked: the identity, the RIF on SENIAT, the payout account and, at level 3, the business registration. It never shows documents, ID numbers, points or limits. Level 0 and restricted sellers show no badge. ## Payouts wait for the bank For sellers, a Bs sale whose bank confirmation is still pending (for example a Sofitasa C2P waiting to be deposited) stays on hold until the bank confirms it, even after the usual hold. VEX Wallet seller balances report that part as `unconfirmedVes` (inside `pendingVes`); a sweep or payout never spends it. A sale the bank does not find stays on hold for VEX Pay to review. --- # Foreign sellers: plan, review and USDT payouts > People and companies outside Venezuela can sell to Venezuelan buyers in bolívares and receive USDT. What the review needs, the fees, and how payouts work. Rolling out. Human docs: /foreign-sellers ## Who this is for > **NOTE: Rolling out** > > Foreign sign-up is switched on by VEX Pay in steps. Until then the portal only offers Venezuelan sign-up. A person living outside Venezuela, or a company registered outside Venezuela, can sell to buyers in Venezuela. Buyers pay in bolívares with the usual methods. VEX Pay converts every collected bolívar to USDT at the market rate and sends the USDT to the seller’s own wallet. The seller never holds bolívares: they are never paid to a Venezuelan bank account. Sellers in some countries cannot sign up (`403 country_not_supported`). ## Plan and fees | Fee | Individual | Company | When | | --- | --- | --- | --- | | Compliance review | US$49 | US$149 | Paid in USDT before the first review. It covers one review and two resubmissions within 60 days. Not refundable, also when the application is refused. | | Yearly renewal | US$49 | US$149 | Every 12 months after approval. Taken from the next USDT payout, or paid with a link. | | Conversion | 3% | 3% | Of the USDT at the market rate, on every conversion. Shown on each receipt. | | USDT payout | Network fee | Network fee | The usual USDT payout fee of the network (see Pricing). | The review takes up to 3 business days once the application is complete and the fee is paid. Ops may ask for a change; a resubmission uses one of the two included. The portal asks for the fee only once the application is complete. Before paying you accept the foreign-seller terms addendum (including that the fee is non-refundable), pick the USDT network and pay on VEX Pay’s secure payment page; the portal updates by itself and sends the application to review once the payment is confirmed. If fewer USDT than the fee arrive, the fee stays unpaid: do not send the full amount again, contact support. ## What the review needs - **Identity:** if you sell from the VEX Pay app and your app KYC is verified with the same name and document number as the person on the application (you, or the company’s legal representative), identity is already done: the portal shows **Identidad verificada en la app VEX Pay** and asks for no Didit check. Otherwise, a Didit check of the passport or national ID, matching the name and number on the application. A passport belongs to one seller account (`409 identity_taken`). - **Individuals:** a proof of address issued in the last 3 months, the tax number of the country of residence, a description of what is sold and a website or social profile. - **Companies:** the company registry certificate issued in the last 3 months, the tax number, the list of directors, the representative’s authority (power of attorney or board minute), every beneficial owner with 25% or more and each owner’s ID, a proof of address, the activity and a website. - **Language:** documents in Spanish or English. Any other language needs a translation uploaded with it. - **Sworn declaration** of the origin and destination of funds, the same one Venezuelan sellers accept. - Every person on the application is screened against sanctions and PEP lists at submission and every night. ## USDT payouts - **Your own wallet.** Prove the wallet is yours by signing a message with it (BSC and Polygon: `personal_sign`; TRON: `signMessageV2`), or by sending a small test transfer that VEX Pay confirms. A wallet another seller proved is refused (`409 wallet_taken`); changing the wallet asks for a new proof. - **Conversion instruction.** Before selling, accept the standing instruction to convert every collected bolívar to USDT at the market rate less the conversion fee. You can pause it: payment links and checkout pause too, and bolívares already collected are still converted. - **Once a day** VEX Pay converts the bolívares that cleared the bank and sends the USDT to the wallet with the usual payout checks. Each conversion has a receipt (portal and email) with the market rate, the USDT before the fee, the fee and the USDT sent. ## Errors | Status | Code | When | | --- | --- | --- | | 403 | `country_not_supported` | Sign-up or KYB submission from a country VEX Pay does not serve. | | 400 | `missing_documents` | KYB submission: something on the checklist is missing. `missing` lists keys, `labels` gives each in Spanish and English. | | 402 | `compliance_fee_required` | KYB submission before the review fee is paid. `fee.payUrl` is the USDT payment link. | | 402 | `compliance_fee_exhausted` | The fee’s review and two resubmissions, or its 60 days, are used. `fee.payUrl` opens a new fee. | | 400 | `terms_required` | Portal: opening the fee payment without accepting the current foreign-seller terms addendum. | | 422 | `payout_account_required` | A sale or payment link while the review is open or the wallet is not proven. | | 422 | `conversion_instruction_required` | A sale before the conversion instruction is accepted. | | 422 | `conversion_instruction_paused` | A sale while the seller paused the instruction. | | 422 | `foreign_renewal_due` | A sale after the yearly renewal date until the renewal is done. | | 422 | `wallet_ownership_invalid` | The signature does not match the saved wallet. | | 409 | `wallet_taken` | Another seller account already proved this wallet. | --- # Postman collection (marketplace settlement) > Download and import the marketplace settlement collection plus an API environment aimed at https://api.vexpay.app to walk merchants, Débito Inmediato funding, and payouts end to end. Human docs: /postman ## What you get Two JSON files ship with this portal. Import both into Postman (or a compatible client). Calls go to the hosted API at https://api.vexpay.app — set your tenant x-api-key before running live requests. | File | URL | Purpose | | --- | --- | --- | | Marketplace settlement collection | /postman/vexpay-marketplace-settlement.postman_collection.json | Merchants → Débito collect → single or batch payout; USDT folder (balance, deposit addresses, hosted USDT checkout, USDT payouts) | | API environment | /postman/vexpay-local.postman_environment.json | baseUrl https://api.vexpay.app — replace apiKey with your tenant key | > **NOTE: Repo copy** > > The same files live under postman/ in the monorepo for local editing. The portal serves the copies under /postman/ so they are shareable without cloning. ## Import 1. **Download both files** — Use the download panel on this page, or open the /postman/*.json URLs and save them. 2. **Import into Postman** — Postman → Import → select the collection JSON and the environment JSON. 3. **Select the environment** — Top-right environment picker → VEX Pay — API. Collection auth uses {{apiKey}} as x-api-key. 4. **Set your API key** — Replace the placeholder apiKey (vk_live_replace_me) with your tenant key. baseUrl is already https://api.vexpay.app. ## Run order 1. **0. Helpers** — Optional: List banks and Get FX quote. Use 4-digit SIMF codes as banco / bankCode. 2. **1. Merchants** — Run List merchants first (auto-fills merchantId), or Get merchant by externalRef / Get merchant (partner) by externalRef when you already know the seller refs (`merchantExternalRef`, `merchantExternalRef2`). Create + verify payout methods only if you need a new seller or a second merchant for a real batch split. Details: /merchants-payouts#lookup-by-ref. 3. **2. Collect (fund float)** — Debit OTP → Débito Inmediato with monto 100.00 and a real bank OTP. Confirm COMPLETED via Get payment by externalRef or payment.completed. Walkthrough: /debito-inmediato. 4. **3. Settle** — Single payout smoke test (monto "10.00"), then optionally Batch split with montos that fit your available balance. Concepts: /marketplace-settlement. ## Fees and available balance > **WARNING: Platform ledger fees** > > Completed collections credit vesAmount, then debit a platform fee (feePercent of USD at the payment rate + feeFixedUsd at the BCV rate). Available balance also subtracts reserveVes and anything still under the 24h balance hold (heldVes). A small Débito with a large fixed USD fee can go negative. | Local Dev setting | Happy-path value | | --- | --- | | feePercent | 2.5 | | feeFixedUsd | 0.05 | | reserveVes | 0 | | Collect monto | 100.00 VES | | Expected available after collect | About Bs 63–66 (≈ 100 − 0.05 × BCV) | | Smoke payout | 10.00 VES | > **NOTE: Reset before retesting** > > If available balance is already negative from earlier experiments, reset it to 0 in Dashboard → Tenants → Fees, then collect again. > **SUCCESS: Test settings vs standard rates** > > The happy-path table above uses test settings (a $0.05 fixed fee, reserve 0). The standard rates are at /pricing: bolívar and card pay-ins are a percentage plus a $0.25 fixed fee. The fixed USD fee always converts to a VES debit at the BCV rate, so small collects need larger amounts. --- # Pricing > VEX Pay’s standard rates per payment rail, worked examples at 100, 300 and 1,000, and what is free. The buyer always pays exactly the listed price. Human docs: /pricing ## Standard rates > **WARNING: Card payments are temporarily unavailable** > > Card payments (VPOS) are temporarily unavailable. The endpoint answers 400 until they return. These are VEX Pay’s standard rates. New accounts start on them. Your rates may differ by agreement; the Rates page in your portal always shows the rates your account actually pays, with the same worked examples. | Rail | Standard fee | Charged on | | --- | --- | --- | | Bolívar pay-ins (Pago Móvil, débito/crédito inmediato, C2P) | 3.5% + $0.25 | The USD amount, paid in Bs at your Bolívar rate; the fixed part always at the BCV rate | | Debit card | 4.0% + $0.25 | The charge; the fixed part at the BCV rate | | Credit card | 10.0% + $0.25 | The charge; the fixed part at the BCV rate | | Instant withdrawal to your own bank account | 3.5% (the bolívar percentage) | The amount withdrawn | | USDT pay-ins | 2.5% + 0.50 USDT | The amount received (never more than the amount received) | | Colombian peso pay-ins (card, PSE, Bancolombia, Bre-B, Nequi, Daviplata) | 4.5% + COP 1,500 | The peso amount (never more than the amount; minimum COP 20,000 per payment); returned on a refund | | USDT payouts to an external address | The payout fee of the chosen network (see below) | Each payout | > **SUCCESS: The buyer pays exactly the listed price** > > Buyers are charged exactly the checkout amount — nothing is added on top. The VEX Pay fee is deducted from what you receive, and nothing else is: VEX Pay absorbs the blockchain network fee on USDT pay-ins, so neither you nor your buyer pays it. One exception: a buyer who pays a USD-priced checkout in Colombian pesos is charged the USD amount at VEX Pay’s USDT/COP rate plus a 2.5% FX margin, rounded up to whole pesos. The peso total is shown before the buyer pays, and you receive it in your COP balance net of the COP fee. ## Worked examples Computed with the same fee functions the ledger uses, and rounded to cents the same way. Bolívar and card amounts are USD prices; the buyer pays them in Bs at your Bolívar rate (BCV or market), and the conversion is free. | Charge | VEX Pay fee | You receive | After instant withdrawal | | --- | --- | --- | --- | | $100.00 | $3.75 | $96.25 | $92.88 | | $300.00 | $10.75 | $289.25 | $279.13 | | $1,000.00 | $35.25 | $964.75 | $930.98 | “After instant withdrawal” is what reaches your own bank account when you withdraw the whole balance: the bolívar percentage is charged again on the amount withdrawn. | Charge | Debit fee | You receive (debit) | Credit fee | You receive (credit) | | --- | --- | --- | --- | --- | | $100.00 | $4.25 | $95.75 | $10.25 | $89.75 | | $300.00 | $12.25 | $287.75 | $30.25 | $269.75 | | $1,000.00 | $40.25 | $959.75 | $100.25 | $899.75 | Card sales land in your bolívar balance, so moving them to your bank goes through the same instant withdrawal shown above. Whether a card is debit or credit is determined from the card and the account type the buyer selects (accountType 10 or 20 for debit, 0 for credit). A card VEX Pay knows to be a credit card is always charged the credit rate, and when no account type is given, a card VEX Pay can’t identify is charged the credit rate. | Charge | VEX Pay fee | You receive | After a 1.00 USDT payout | | --- | --- | --- | --- | | 100.00 USDT | 3.00 USDT | 97.00 USDT | 96.00 USDT | | 300.00 USDT | 8.00 USDT | 292.00 USDT | 291.00 USDT | | 1,000.00 USDT | 25.50 USDT | 974.50 USDT | 973.50 USDT | The last column assumes an external payout fee of 1.00 USDT. Payout fees are per network; the live fee for each one is listed below. A USDT charge at or below the fixed fee is charged the amount itself and nets 0 — never less. ## Small charges and the fixed fee Every bolívar and card payment pays the percentage plus a fixed $0.25. On large charges the fixed part barely matters; on small ones it is most of the fee. | Charge | VEX Pay fee | You receive | Fee as share of the charge | | --- | --- | --- | --- | | $1.00 | $0.29 | $0.71 | 29.0% | | $2.00 | $0.32 | $1.68 | 16.0% | | $5.00 | $0.43 | $4.57 | 8.6% | | $10.00 | $0.60 | $9.40 | 6.0% | | $20.00 | $0.95 | $19.05 | 4.8% | | $50.00 | $2.00 | $48.00 | 4.0% | The same $1 charge in bolívares, at an example BCV rate. The percentage converts at your Bolívar rate (BCV here); the fixed $0.25 always converts at BCV. - Charge: $1.00 × 886.2271 (BCV) = Bs 886.23 - Percentage: 3.5% of Bs 886.23 = Bs 31.02 - Fixed fee: $0.25 × 886.2271 (BCV) = Bs 221.56 - Total fee: Bs 252.57 (rounded once, on the total) - You receive: Bs 886.23 − Bs 252.57 = Bs 633.66 ## Best practices when you charge - Price the fixed fee in. The buyer always pays exactly your price and the fee comes out of what you receive, so on low-ticket items add the $0.25 to the price, or keep prices where the fee is acceptable to you: from $5 it is under 9%, from $10 about 6%. - Charge once per order, not once per item. The fixed fee applies per payment: five $1 items paid together cost $0.43 in fees, paid separately $1.43. - Set a minimum order for bolívar and card payments in your store or app. - Card sales cost more: credit cards are 10% + $0.25. Consider a higher minimum when the buyer pays by card. - Check the fee before you share a link. Portal → Rates shows your own rates with examples, and GET /v1/me/merchant/payment-links/preview (the VEX Wallet "create Payment Link" screen) returns the exact fee in Bs for an amount. - Withdraw when it suits you. Instant withdrawals are a percentage with no fixed fee, so how often you withdraw does not change what you pay. ## USDT payout fees USDT payout fee: per network, shown at withdrawal. Payout fees are set per network and charged once per payout, for USDT and USDC alike. The table above comes from GET /public/pricing; the exact fee for a payout is returned before you send it by GET /v1/crypto/networks. ## What is free - Payouts to your verified merchants - Payouts to VEX Wallet - Micro-deposit verification of payout accounts - The BCV conversion — USD prices convert to Bs at the official BCV rate with no markup ## How fees reach your balance 1. **Credit the collection** — On payment.completed, the ledger posts PAYMENT_CREDIT for vesAmount. 2. **Debit the VEX Pay fee** — PLATFORM_FEE posts −feeVes: feeVes = usdAmount × (feePercent / 100) at the payment’s rate (BCV or market) + feeFixedUsd at the BCV rate, rounded once. 3. **Hold the reserve** — Available balance subtracts reserveVes as a safety buffer, if your account has one. It is not a separate ledger entry — it is applied when reading the balance. 4. **Hold new credits for 24 hours** — Every credit to your balance — payments in Bs, USDT and COP, conversion credits, adjustments — is held for `balanceHoldHours` (24h) before payouts can spend it. Held money shows as `heldVes` (`held` for stablecoins, `heldCop` for pesos) with `nextReleaseAt`, and is released automatically. Payouts asking for more than the available part get 422 `insufficient_balance` with `heldVes` and `nextReleaseAt`. Conversions and seller transfers may use held money; what they produce stays held until the original hold ends. Reversals, chargebacks and refunds still apply to held money. > **WARNING: Fixed USD fees on small tickets** > > The fixed USD fee (standard $0.25) converts to a VES debit at the BCV rate on every bolívar and card payment, even when your Bolívar rate is the market rate, so on a very small collect it is a large share of the amount. ## Where your rates are set Rates are set per account by VEX Pay. There is no plan picker on the payment APIs, and a rate change never rewrites past payments. - Portal → Rates: your effective rates, which ones differ from the standard, and worked examples with your rates. - Marketplace seller payouts remain separate: retain your product fee by paying sellers less than you collected. See /marketplace-settlement. - Importable collect → payout walkthrough: /postman. --- # WooCommerce integration > A pre-built plugin so merchants can accept VEX Pay without calling the API directly. Human docs: /integrations ## A ready-made integration If your merchant runs WooCommerce, they do not need to integrate the API themselves. The plugin talks to VEX Pay over the same tenant API documented on this site — install it, configure a tenant API key, and orders start flowing. | Platform | What it adds | Get it | | --- | --- | --- | | WooCommerce | Native payment gateway at checkout — C2P (bank OTP) and VPOS (card) | wordpress.org/plugins/vexpay-gateway-for-woocommerce · source github.com/chuventures/woo-vexpay-gateway | ## WooCommerce > **WARNING: Card payments are temporarily unavailable** > > Card payments (VPOS) are temporarily unavailable. The endpoint answers 400 until they return. A native WooCommerce payment gateway (WooCommerce → Settings → Payments → VEX Pay) supporting both classic checkout and Cart & Checkout Blocks. - C2P checkout: cédula/RIF, phone, and bank, then OTP confirmation. - Card checkout (VPOS): Visa/Mastercard/Maestro, a second independent method sharing the same API key. - Signed webhook reconciliation, with a settlement-poller fallback for stores whose URL is not yet public. - Test connection button to verify the API key and reachability before going live. - Full C2P reverse mapped to WooCommerce refunds. > **NOTE: Requirements** > > WordPress 6.0+, WooCommerce 8.0+, PHP 8.1+, and a VEX Pay tenant API key (Test to start, Live when ready). ### Source ```bash https://github.com/chuventures/woo-vexpay-gateway ``` ## Marketplace mode (plugin 1.3.0) For a store whose products belong to different comercios. With **Marketplace splits** on (WooCommerce → Settings → Payments → VEX Pay; off by default), one débito or card payment is split between the comercios in the cart and you: the plugin sends `splits` (see /marketplace-splits). While it is off, nothing changes and no `splits` are sent. - Each product (or variation) is linked to a comercio with the **Comercio (VEX Pay)** field, which lists your active comercios. A line with no comercio belongs to you. - A comercio’s share is its lines’ totals after coupons plus their tax. Shipping, fees and lines with no comercio stay with you. At most 10 comercios per order. - USDT is not offered for a cart with a comercio’s product, because USDT payments cannot be split. - If VEX Pay refuses the split (for example an inactive comercio), no money is taken, the buyer sees a generic message and the order gets a note. The payment is never retried without splits. - The order screen shows each comercio’s share and, once paid, its commission, VEX Pay fee and net. | Hook | Use it to | | --- | --- | | `vexpay_line_item_merchant_id` (filter) | Return the VEX Pay merchant id for an order line, for stores with their own comercio records | | `vexpay_cart_item_merchant_id` (filter) | The same for a cart item (decides whether USDT is hidden) | | `vexpay_order_splits` (filter) | Change the final shares, for example a commission per comercio | | `vexpay_split_refusal_message` (filter) | Your own wording when VEX Pay refuses the split | | `vexpay_upsert_merchant()` (function) | Create or update a VEX Pay comercio from your own record, keyed by your comercio id (`external_ref`). Returns the merchant id or a `WP_Error` | A new or changed Pago Móvil account added by `vexpay_upsert_merchant()` must be verified with the two micro-deposit amounts before the comercio can be paid out. The plugin README has a full snippet. --- # API reference > Explore the deployed OpenAPI schema, interactive Scalar reference, and every tenant endpoint. Human docs: /reference ## Live contract The portal publishes a downloadable OpenAPI contract at /openapi.json and an interactive Scalar explorer at /api-reference (also available on the API host at /reference). Every request and response schema below is generated from NestJS decorators — prefer Scalar when you need field-level types, examples, and try-it requests. > **NOTE: Authentication** > > All tenant routes require the `x-api-key` header. Internal ops routes (`/internal/*`), health, and bank callbacks are intentionally excluded from this contract. ## All tenant endpoints Complete method × path matrix for the tenant API. Open /api-reference and select an operation for full request/response schemas. | Method | Path | Tag | Purpose | | --- | --- | --- | --- | | GET | /v1/banks | Banks | Listed bank catalog (code, name, services, logoUrl) | | GET | /v1/quote?usdAmount= | Payments | Bolívar quote at your rate (+ BCV and median rates) | | POST | /v1/payments/c2p/request | Payments | Create C2P intent + request bank OTP when supported | | POST | /v1/payments/c2p | Payments | Execute C2P charge with customer token | | POST | /v1/payments/vpos | Payments | VPOS card charge (PCI server only) | | POST | /v1/payments/pago-movil/verify | Payments | Verify customer Pago Móvil reference | | GET | /v1/payments/by-ref/:externalRef | Payments | Latest payment by correlation ref | | GET | /v1/payments/:id | Payments | Payment receipt by id | | POST | /v1/payments/:id/reverse | Payments | Reverse a completed C2P payment | | POST | /v1/payments/debit/otp | Advanced payments | Request débito inmediato OTP (VES) | | POST | /v1/payments/debit | Advanced payments | Execute débito inmediato | | GET | /v1/payments/operations/:id | Advanced payments | Poll pending network operation | | POST | /v1/payments/credit | Advanced payments | Immediate credit by phone | | POST | /v1/payments/credit/account | Advanced payments | Credit a 20-digit account | | POST | /v1/payments/credit/disburse | Advanced payments | Disburse inbound Pago Móvil by phone | | POST | /v1/payments/payouts | Advanced payments | Account-based multi-beneficiary dispersion | | POST | /v1/payments/change | Advanced payments | Send change (vuelto) to customer | | POST | /v1/merchants | Merchants | Register merchant (+ optional first payout method) | | GET | /v1/merchants | Merchants | List merchants or lookup by externalRef | | GET | /v1/merchants/:id | Merchants | Merchant details + payout methods | | PATCH | /v1/merchants/:id | Merchants | Activate / deactivate merchant | | DELETE | /v1/merchants/:id | Merchants | Hard-delete when no payout history | | GET | /v1/merchants/:id/payout-methods | Merchants | List Pago Móvil payout methods | | POST | /v1/merchants/:id/payout-methods | Merchants | Add a payout method | | POST | /v1/merchants/:id/payout-methods/:methodId/default | Merchants | Set default payout method | | DELETE | /v1/merchants/:id/payout-methods/:methodId | Merchants | Delete a payout method | | POST | /v1/merchants/:id/payout-methods/:methodId/verify/start | Merchants | Start micro-deposit verification | | POST | /v1/merchants/:id/payout-methods/:methodId/verify | Merchants | Confirm micro-deposit amounts | | POST | /v1/merchants/:id/verify/start | Merchants | Legacy: verify default method | | POST | /v1/merchants/:id/verify | Merchants | Legacy: confirm default method | | POST | /v1/payouts | Payouts | Create single merchant payout (idempotent) | | POST | /v1/payouts/batch | Payouts | Split batch with per-item results | | GET | /v1/payouts | Payouts | List payouts (cursor pagination) | | GET | /v1/payouts/by-ref/:externalRef | Payouts | Payout by externalRef | | GET | /v1/payouts/:id | Payouts | Payout by id | | POST | /v1/webhooks | Webhooks | Register endpoint (secret returned once) | | GET | /v1/webhooks | Webhooks | List endpoints (secrets omitted) | | PATCH | /v1/webhooks/:id | Webhooks | Update url / events / active | | DELETE | /v1/webhooks/:id | Webhooks | Delete endpoint + delivery history | | POST | /v1/notifications/test | Webhooks | Send notification.test to subscribers | ## AI / LLM Markdown If you are wiring an AI coding agent or RAG pipeline, prefer these Markdown surfaces over scraping HTML. They follow the llms.txt convention. | URL | Purpose | | --- | --- | | /llms.txt | Curated index of docs with links to Markdown pages | | /llms-full.txt | Entire English guide concatenated into one Markdown file | | /{slug}.md | Single guide page as clean Markdown (e.g. /merchants-payouts.md) | | /index.html.md | Overview page Markdown | | /es/llms.txt | Spanish index | | /es/llms-full.txt | Full Spanish guide as one Markdown file | | /es/{slug}.md | Spanish single-page Markdown | | /openapi.json | Machine-readable OpenAPI 3 contract (powers Scalar) | | /api-reference | Interactive Scalar UI for every documented operation | > **SUCCESS: Suggested agent prompt** > > Fetch /llms.txt first, then pull /marketplace-settlement.md and /merchants-payouts.md (or /llms-full.txt) and /openapi.json before generating settlement or payout integration code. Never put the tenant API key in browser or model context logs. --- # Build your integration, step by step > From your first API call to live payments: nine steps, in order, with the exact requests and what to check before moving on. Human docs: /integration-path ## The path at a glance Follow the steps in order. Each one ends with a **checkpoint**: when it passes, move on. Everything up to step 8 runs with your **Test key**, so no real money moves until you go live. | Step | You do | Done when | | --- | --- | --- | | 1. Keys | Store your Test key and API URL on your server | Your server can read both from its environment | | 2. First call | Call GET /v1/banks | You get a 200 with the bank list | | 3. Choose a flow | Pick hosted checkout or a direct method | You know which endpoint creates your payments | | 4. First payment | Create a test payment and complete it | GET shows the payment COMPLETED | | 5. Webhooks | Register an endpoint and verify signatures | payment.completed reaches your server and passes verification | | 6. Safe retries | Add idempotency and recovery by reference | A retried request never creates a second payment | | 7. Balances | Read your balance and bank confirmation | You can explain available, awaiting bank confirmation and reserve | | 8. Payouts | Withdraw or pay out from available funds | A test payout completes and payout.completed arrives | | 9. Go live | Request review, then switch keys | Your first live payment completes | > **NOTE: Prefer a ready-made scenario?** > > The recipes walk through complete businesses end to end: an online store, a marketplace with sellers, top-ups paid in bolívares and received in USDT, and Colombian pesos. They follow the same steps with the choices already made. ## 01. Get your keys and set up your environment Your account has a **Live** and a **Test** key. Use the Test key for everything until step 9 — it works immediately, runs on sandboxes, and never moves real money. Copy it from **Portal → Credentials**. ### .env (server only) ```bash API_URL=https://api.vexpay.app VEXPAY_API_KEY=vk_test_replace_me VEXPAY_WEBHOOK_SECRET=whsec_replace_me ``` > **WARNING: The key never leaves your server** > > Never put the API key in browser or mobile code, in a NEXT_PUBLIC_ variable, or in a public repository. Browsers only ever receive a checkout session `clientSecret`. **Checkpoint:** your server reads `API_URL` and `VEXPAY_API_KEY` from its environment. More detail: Authentication. ## 02. Make your first call Every request sends the key in the `x-api-key` header. The bank list is a safe first call: it reads only and needs no setup. ### curl ```bash curl "${API_URL}/v1/banks" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### Node SDK ```javascript import VexPay from '@vexpay/node'; const vexpay = new VexPay(process.env.VEXPAY_API_KEY); const banks = await vexpay.banks.list(); ``` ### Python SDK ```python import os from vexpay import VexPay vexpay = VexPay(os.environ["VEXPAY_API_KEY"]) banks = vexpay.banks.list() ``` **Checkpoint:** a 200 response with the bank list. A 401 means the key is missing or wrong. An official SDK (Node, Python, PHP, Laravel) saves you writing HTTP, retries and webhook verification yourself. ## 03. Choose how your buyers pay > **WARNING: Card payments are temporarily unavailable** > > Card payments (VPOS) are temporarily unavailable. The endpoint answers 400 until they return. Start with the **hosted checkout** unless you need your own payment screens: one request gives you a page where the buyer picks bolívares, stablecoins or Colombian pesos, and VEX Pay runs every step. | Option | Best when | Create with | | --- | --- | --- | | Hosted checkout (recommended) | You want every method with no payment UI to build | POST /v1/checkout/sessions | | Payment links | You sell without code (WhatsApp, social media) | Portal → Payment links | | C2P | Your own screen; the buyer authorizes with a bank token | POST /v1/payments/c2p/request, then POST /v1/payments/c2p | | Pago Móvil verify | The buyer already transferred and gives you the reference | POST /v1/payments/pago-movil/verify | | Card (VPOS) | Card payments on your own form (PCI scope applies) | POST /v1/payments/vpos | | USDT / USDC | Stablecoin deposits per customer | POST /v1/crypto/deposit-addresses | | Colombian pesos | Buyers in Colombia (card, PSE, Bancolombia, Bre-B, Nequi, Daviplata) | POST /v1/cop/payments | **Checkpoint:** you know which endpoint creates your payments. `GET /v1/payment-methods` tells you which bolívar methods your account can offer right now. ## 04. Create and complete a test payment Create a checkout session for an order and send the buyer to its `url` (or embed it with @vexpay/js using `clientSecret`). Keep the session `id` with your order. ### curl ```bash curl --request POST "${API_URL}/v1/checkout/sessions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": 25.00, "description": "Order #1042", "reference": "order-1042", "successUrl": "https://shop.example/thanks", "cancelUrl": "https://shop.example/cart" }' ``` ### Node SDK ```javascript const session = await vexpay.checkout.sessions.create({ amountUsd: 25, description: 'Order #1042', reference: 'order-1042', successUrl: 'https://shop.example/thanks', cancelUrl: 'https://shop.example/cart', }); // Redirect the buyer to session.url ``` ### Response ```json { "id": "cs_4f0c6f1e2b7d4c1a9e3f5a6b7c8d9e0f", "object": "checkout.session", "status": "open", "url": "https://pay.vexpay.app/pay/cs-9f2a4b7c1d3e", "clientSecret": "cs-9f2a4b7c1d3e_secret_k8Jc…", "amountUsd": "25.00", "reference": "order-1042", "livemode": false } ``` 1. **Open the url** — In test mode the hosted page shows test controls instead of real bank details: complete C2P with the code from **Portal → Sandbox**, press **Simular pago recibido** for Pago Móvil, or use the test buttons on the USDT page. 2. **Check the result** — `GET /v1/checkout/sessions/:id` shows `status: "paid"` and the `paymentId`. `GET /v1/payments/:id` shows the payment `COMPLETED`. **Checkpoint:** the session is `paid` and the payment `COMPLETED`, all with `livemode: false`. ## 05. Fulfill orders from signed webhooks Fulfill only from the server side: a verified `payment.completed` webhook (or a GET that shows the payment completed). Browser redirects and @vexpay/js events are hints, never proof. ### Register (curl) ```bash curl --request POST "${API_URL}/v1/webhooks" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "url": "https://shop.example/webhooks/vexpay", "events": ["payment.completed", "payment.failed", "payment.reversed", "payout.completed", "payout.failed"] }' ``` ### Verify (Node) ```javascript app.post('/webhooks/vexpay', express.raw({ type: 'application/json' }), async (req, res) => { const event = vexpay.webhooks.constructEvent( req.body, // raw bytes, not parsed JSON req.headers['vexpay-signature'], process.env.VEXPAY_WEBHOOK_SECRET, ); if (event.event === 'payment.completed') { // Checkout payments: match your order on data.checkoutSession.reference await markOrderPaid(event.data.checkoutSession?.reference, event.data.paymentId); } res.sendStatus(200); }); ``` - Save the `secret` from the create response — it is never shown again. - Deduplicate on the `VexPay-Event-Id` header: the same event can reach you more than once. - Each event is sent **once**, with no automatic retry, and your endpoint has 10 seconds. Queue the work and answer 200 quickly; step 6 covers what you missed. - Use `POST /v1/notifications/test` to send yourself a test delivery. **Checkpoint:** a test payment produces a `payment.completed` that passes signature verification and marks the order paid exactly once. More detail: Webhooks. ## 06. Make retries safe and recover what you missed 1. **Send Idempotency-Key on every POST** — Use your order id. The same key and body within 24h replays the first response (`Idempotent-Replayed: true`) instead of creating a second payment. The SDKs send one automatically. 2. **Store the ids you get back** — Keep the session id, `paymentId` and `payoutId` with your order. For payouts and merchants, `externalRef` is itself the idempotency key. 3. **Recover by reference** — If a response or a webhook never arrived, look the payment up: `GET /v1/payments/by-ref/:externalRef` or `GET /v1/checkout/sessions/:id`. Decide from its status, never from a timeout. 4. **Run a reconcile job** — Once a day (or hourly), walk `GET /v1/balance/transactions` and check every movement against your books. The sum always equals your ledger total, so nothing can hide. **Checkpoint:** retrying the same create request twice gives the same payment, and a missed webhook is caught by the lookup or the reconcile job. More detail: Idempotency, Reconcile. ## 07. Read your balance and bank confirmation Every completed payment lands in your balance at once. Bolívar payments become available as soon as the bank confirms them; until then they show as `unconfirmedVes`. `GET /v1/balance` shows both parts. ### GET /v1/balance (excerpt) ```json { "ledgerNetVes": "7342.50", "reserveVes": "0.00", "heldVes": "0.00", "unconfirmedVes": "4342.50", "availableVes": "3000.00", "balanceHoldHours": 0, "settlement": { "enabled": true, "status": "active", "minimumVes": "100.00" } } ``` `availableVes` = `ledgerNetVes` − `reserveVes` − `heldVes` − `unconfirmedVes`. Only `availableVes` can be paid out. In live mode, available bolívares are also settled to your verified payout account automatically as soon as the bank confirms each payment (`settlement`). USDT and pesos have no hold. **Checkpoint:** after a test payment the amount is available at once (test mode has no bank confirmation). Full explanation: Balances, holds and payouts. ## 08. Pay out | Where the money goes | Endpoint | Before the first payout | | --- | --- | --- | | Your own bank account (Bs) | POST /v1/payouts/instant | Save and verify your payout account (two micro-deposits) | | A seller or supplier (Bs) | POST /v1/payouts | Register the merchant and verify its Pago Móvil destination | | A crypto wallet (USDT / USDC) | POST /v1/crypto/payouts | Have a USDT or USDC balance | ### Withdraw to your account (curl) ```bash curl --request POST "${API_URL}/v1/payouts/instant" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "monto": "1000.00", "concepto": "Retiro", "externalRef": "withdraw-2026-10-19" }' ``` > **NOTE: insufficient_balance right after a sale is bank confirmation** > > A payout larger than `availableVes` answers 422 `insufficient_balance` with `unconfirmedVes`. Do not retry in a loop: pay out what is available, or try again once the bank confirms the payment. **Checkpoint:** a test payout completes and `payout.completed` reaches your endpoint. More detail: Merchants & payouts, USDT & USDC. ## 09. Go live - Steps 4–8 pass with the Test key, including at least one webhook delivery (Portal → Webhooks shows it). - Your business profile and owner contact are complete in the portal. - You handle `payment.failed`, `payment.reversed` and `payout.failed`, not only the happy path. - Your reconcile job runs and alerts you when totals disagree. 1. **Request go-live** — Click **Request go-live** in the portal. The VEX Pay team reviews your account; until then live keys answer 403 `live_mode_not_activated`. 2. **Register live webhooks** — Webhook endpoints belong to each key: register your production URL with the Live key and store its new secret. 3. **Switch keys** — When you receive `tenant.live_status_changed`, create a live key in the portal and deploy it. Make one small real payment and follow it to your balance. > **SUCCESS: You are live** > > From here on, the recipes and topic pages cover each flow in depth, and the playbooks (/playbooks) cover single tasks such as rotating a key, withdrawing or refunding. Keep the reconcile job running — it is the safety net for everything else. --- # Recipe: accept payments in an online store > Sell to Venezuelan buyers with one hosted checkout: bolívares, stablecoins and pesos, confirmed by webhook and withdrawn to your bank. Human docs: /recipe-online-store ## What you will build > **WARNING: Card payments are temporarily unavailable** > > Card payments (VPOS) are temporarily unavailable. The endpoint answers 400 until they return. A store where each order opens a hosted checkout, the order is marked paid from a verified webhook, and the money is withdrawn to your own bank account. No payment screens to build or certify. 1. **Buyer clicks Pay** — Your server creates a checkout session for the order and redirects the buyer. 2. **Buyer pays on VEX Pay** — The buyer picks Pago Móvil, C2P, card, USDT/USDC or pesos and completes it there. 3. **You fulfill** — payment.completed reaches your webhook; you mark the order paid. 4. **You get paid** — Once the bank confirms each payment, your bolívares are settled to your verified payout account automatically, within about a minute (or you withdraw them yourself). ## 01. Create a session per order ### Node SDK ```javascript app.post('/checkout/:orderId', async (req, res) => { const order = await orders.get(req.params.orderId); const session = await vexpay.checkout.sessions.create( { amountUsd: order.totalUsd, description: `Order #${order.number}`, reference: order.id, metadata: { orderNumber: String(order.number) }, successUrl: `https://shop.example/orders/${order.id}/thanks`, cancelUrl: 'https://shop.example/cart', }, { idempotencyKey: `checkout-${order.id}` }, ); await orders.update(order.id, { checkoutSessionId: session.id }); res.redirect(303, session.url); }); ``` - Price in USD. Bolívar methods convert at your Bolívar rate; pesos at VEX Pay’s USDT/COP rate. - Leave `methods` out to offer everything your account accepts, or pass e.g. `["pago_movil", "usdt"]`. In live mode, sessions charge bolívares by Pago Móvil or C2P only; other methods are not offered. - A live session needs a verified payout account: without one, creating it answers 409 `payout_account_required`. - The idempotency key makes a double click open the same session, not two. ## 02. Mark the order paid from the webhook ### Node SDK ```javascript app.post('/webhooks/vexpay', express.raw({ type: 'application/json' }), async (req, res) => { const event = vexpay.webhooks.constructEvent(req.body, req.headers['vexpay-signature'], process.env.VEXPAY_WEBHOOK_SECRET); if (await seen(req.headers['vexpay-event-id'])) return res.sendStatus(200); const ref = event.data.checkoutSession?.reference; if (event.event === 'payment.completed' && ref) await orders.markPaid(ref, event.data.paymentId); if (event.event === 'payment.reversed' && ref) await orders.flagReversed(ref); res.sendStatus(200); }); ``` > **WARNING: The success page is not proof** > > Buyers can reach your successUrl without paying. Show "processing" there until the webhook (or GET /v1/checkout/sessions/:id with status paid) confirms. > **NOTE: Underpaid crypto** > > If a buyer sends less USDT than the total, the payment completes with `underpaid: true` but the session is not paid. Decide in your store whether to ask for the difference. ## 03. Catch anything you missed Webhooks are delivered once. Every few minutes, look up sessions still waiting on your side and settle them from their real status. ### Node SDK ```javascript for (const order of await orders.awaitingPayment({ olderThanMinutes: 5 })) { const s = await vexpay.checkout.sessions.retrieve(order.checkoutSessionId); if (s.status === 'paid') await orders.markPaid(order.id, s.paymentId); if (s.status === 'expired' || s.status === 'canceled') await orders.release(order.id); } ``` ## 04. Withdraw to your bank 1. **Verify your payout account once** — Save your bank, cédula/RIF and phone with PUT /v1/tenant/payout-account, then confirm the two micro-deposits (Portal → Payouts does both). 2. **Wait for bank confirmation** — Each bolívar sale becomes available when the bank confirms it. GET /v1/balance shows availableVes and unconfirmedVes. 3. **Withdraw** — POST /v1/payouts/instant with the amount, or press Withdraw in the portal. The bolívar percentage applies to the amount withdrawn. Crypto sales stay in your USDT balance until you send them with POST /v1/crypto/payouts. Peso sales stay in your COP balance. --- # Recipe: run a marketplace with sellers > Collect from buyers, keep your commission automatically, and pay each seller from their own balance once their sale is released. Human docs: /recipe-marketplace ## What you will build A marketplace where every sale is tagged with its seller. VEX Pay keeps your commission, credits the seller’s net to their own balance, and lets you pay them out to their verified Pago Móvil — with no split math in your code. | Money | Goes to | When it can be paid out | | --- | --- | --- | | Your commission (applicationFeePercent) | Your balance | When the bank confirms the sale | | Seller net | The seller’s pending balance | After your seller hold | | VEX Pay fee | VEX Pay | — | ## 01. Onboard and verify each seller ### curl ```bash # 1. Create the seller (externalRef = your seller id) curl --request POST "${API_URL}/v1/merchants" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "externalRef": "seller_47", "name": "Maria Perez", "identification": "V12345678", "contactEmail": "maria@mail.com", "contactPhone": "04141234567" }' # 2. Add their Pago Móvil destination curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "bankCode": "0105", "phone": "04141234567" }' # 3. Send two micro-deposits, then confirm the amounts the seller sees curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods/METHOD_ID/verify/start" --header "x-api-key: ${VEXPAY_API_KEY}" curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods/METHOD_ID/verify" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amount1": "0.37", "amount2": "0.82" }' ``` Listen for `merchant.verified` (or `merchant.rejected` with the bank’s reason). Look sellers up later with `GET /v1/merchants?externalRef=seller_47`. ## 02. Charge the buyer for the seller Add `merchantId` and your commission to the charge. When it completes, VEX Pay keeps the commission in your balance and moves the seller’s net into their pending balance. ### C2P with a seller (curl) ```bash curl --request POST "${API_URL}/v1/payments/c2p" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "intentId": "INTENT_ID", "usdAmount": 40.00, "debtorId": "V87654321", "debtorCellPhone": "584121234567", "debtorBankCode": 102, "token": "123456", "externalRef": "order-77", "merchantId": "MERCHANT_ID", "applicationFeePercent": 10 }' ``` > **NOTE: Several comercios in one cart?** > > Send `splits` instead of `merchantId` to divide one payment between up to 10 comercios. See Marketplace: split one payment between comercios (/marketplace-splits). > **NOTE: Set the commission once** > > Instead of sending applicationFeePercent on every charge, set a default commission in Portal → Merchants and override it per seller. An explicit fee on the request always wins. Prefer a link? Create a checkout session with `merchantId` and the buyer pays on the hosted page — the split is the same. Sessions with a seller offer bolívar methods only (`c2p`, `pago_movil`, `vpos`) and show the seller’s public name on the checkout. This one accepts only Pago Móvil and keeps 3% for you; the seller’s 97%, minus the VEX Pay fee, lands in their pending balance. ### Pago Móvil link with a seller (curl) ```bash curl --request POST "${API_URL}/v1/checkout/sessions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": 20.00, "methods": ["pago_movil"], "merchantId": "MERCHANT_ID", "applicationFeePercent": 3, "reference": "class-1042" }' ``` ## 03. Pay the seller from their balance 1. **Watch the seller balance** — GET /v1/merchants/:id/balance returns pendingVes and availableVes. merchant.balance.updated fires when a sale lands or is released. 2. **Wait for the release** — A seller sale is released after your seller hold (sellerHoldBusinessDays). This applies to bolívar, USDT and peso sales. 3. **Pay out** — POST /v1/payouts with merchantId, the amount and fromMerchantBalance: true. The payout debits the seller’s available balance, not yours. ### curl ```bash curl --request POST "${API_URL}/v1/payouts" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "merchantId": "MERCHANT_ID", "monto": "1200.00", "concepto": "Ventas semana 42", "externalRef": "po_seller_47_w42", "fromMerchantBalance": true }' ``` A refund or reversal during the hold is taken back from the seller’s pending balance automatically. Your platform totals — your own available funds and what you owe sellers — are on `GET /v1/balance` (`platformAvailableVes`, `sellerPendingVes`, `sellerAvailableVes`). --- # Marketplace: split one payment between comercios > One buyer payment, up to 10 comercios: each gets its share minus your commission and its part of the VEX Pay fee, and can be paid out automatically. Human docs: /marketplace-splits ## What you will build A store that sells products from several comercios in one cart charges the buyer **once** and sends `splits`: one share per comercio. When the bank confirms the payment, VEX Pay credits each comercio its share minus your commission and its part of the VEX Pay fee. Whatever the shares do not cover (shipping, your own products, rounding) stays with you as the **marketplace remainder**. | Money | Goes to | When | | --- | --- | --- | | Share − commission − its part of the VEX Pay fee | The comercio’s balance (pending, then available) | Credited when the payment completes; available after bank confirmation and your seller hold | | Your commission on each share | Your balance | When the bank confirms the payment | | The remainder (not in any share), minus its part of the fee | Your balance | When the bank confirms the payment | | VEX Pay fee | VEX Pay | — | > **NOTE: One comercio per sale?** > > If every payment goes to a single comercio, keep using `merchantId` + `applicationFeePercent` (Recipe: marketplace). It works exactly as before. Use `splits` when one payment covers several comercios. ## 01. Create and verify each comercio Each comercio is a `merchant` of your account. Create it with your own comercio id as `externalRef`, add its Pago Móvil or bank account, and have it confirm the two micro-deposits. Only **verified** comercios are paid out. ### curl ```bash curl --request POST "${API_URL}/v1/merchants" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "externalRef": "comercio-17", "name": "Panaderia 17", "identification": "J123456789", "contactEmail": "ventas@panaderia17.com", "contactPhone": "04141234567", "bankCode": "0105", "phone": "04141234567", "autoPayoutEnabled": true }' ``` Then start and confirm verification exactly as in Recipe: marketplace (`/verify/start`, then `/verify` with the two amounts). Set a negotiated commission per comercio with `PATCH /v1/merchants/{id}` and `applicationFeePercent`; a share without its own commission uses it. ## 02. Charge once, with splits Send `splits` on débito inmediato (`POST /v1/payments/debit`), C2P (`/v1/payments/c2p/request` or `/v1/payments/c2p`), Pago Móvil verify (`/v1/payments/pago-movil/verify`) or VPOS (`/v1/payments/vpos`). Each share has: | Field | Required | Meaning | | --- | --- | --- | | merchantId | Yes | A comercio of your account (UUID or mrc_… id). At most once per payment. | | amount | Yes | The comercio’s share in the request’s currency: "6000.00" (string, two decimals) or a number with at most two decimals. VES for débito, C2P and Pago Móvil; for VPOS, VES when you send vesAmount, else USD (converted at the payment’s rate and rounded down to Bs 0.01). | | applicationFeePercent | No | Your commission as a percent of the share’s VES amount. | | applicationFeeVes | No | Your commission in VES (two decimals). Not with applicationFeePercent. | | reference | No | Up to 64 characters, returned as sent (for example your order line). | ### Débito inmediato with two comercios (curl) ```bash curl --request POST "${API_URL}/v1/payments/debit" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "banco": "0191", "monto": 10000, "telefono": "04141234567", "cedula": "V12345678", "nombre": "Maria Perez", "otp": "12345678", "concepto": "Pedido 1042", "splits": [ { "merchantId": "MERCHANT_A", "amount": "6000.00", "applicationFeePercent": 20, "reference": "1042/a" }, { "merchantId": "MERCHANT_B", "amount": "3000.00", "applicationFeePercent": 20, "reference": "1042/b" } ] }' ``` VEX Pay checks every share **before** calling the bank. If one is wrong, the request fails with `400 invalid_data` and `field: "splits"` and no money moves. When you omit both commission fields on a share, VEX Pay uses the comercio’s negotiated commission, then your default commission, then none. ## 03. How each comercio’s net is computed **Comercio net = share − commission − share’s part of the VEX Pay fee.** With a percent commission, that is `share × (1 − VEX Pay rate − commission %)`, so you can pick each comercio’s `applicationFeePercent` to reach the net you agreed with it. Worked example: the buyer pays **Bs 10,000**. Comercio A has a share of Bs 6,000 and comercio B Bs 3,000, both with a 20% commission. Your VEX Pay fee is 3% and Bs 1,000 (shipping) is in no share. | Part | Amount | Commission (20%) | VEX Pay fee (3%) | Net | | --- | --- | --- | --- | --- | | Comercio A | Bs 6,000.00 | Bs 1,200.00 | Bs 180.00 | Bs 4,620.00 to comercio A | | Comercio B | Bs 3,000.00 | Bs 600.00 | Bs 90.00 | Bs 2,310.00 to comercio B | | Remainder (shipping) | Bs 1,000.00 | — | Bs 30.00 | Bs 970.00 to you | | Total | Bs 10,000.00 | Bs 1,800.00 to you | Bs 300.00 | You keep Bs 2,770.00 | - The payment’s VEX Pay fee is computed as usual on the whole amount, then shared by each part in proportion to its amount. - If a comercio has its own VEX Pay pricing, its share pays that rate instead; your fixed fee per payment (if any) is shared in proportion. The payment’s fee is then the sum. - Fees are split to the exact cent: each share gets its proportional part, and the leftover cents go to the largest fractions (the remainder counts as one more part). Shares never add up to more than the payment, and comercios never receive more than the payment’s net. - A share whose commission and fee take all of it credits the comercio nothing. Each read of the payment (`GET /v1/payments/{id}`, by reference) and every `payment.*` webhook carries `splits[]` with `amountVes`, `applicationFeeVes`, `feeVes` and `netVes` per comercio (fee and net appear once the payment completes). The comercio’s transactions and monthly statement show the credit with the `paymentId` and the share’s `splitReference`. ## 04. Pay comercios automatically A comercio with `autoPayoutEnabled: true` is paid its whole **available** balance to its verified payout account, with the merchant payout fee in your pricing. Once you set a default or a minimum in your marketplace settings, this runs every 15 minutes; until then each comercio is paid at most once a day, as before. It never pays sales still awaiting bank confirmation or within your seller hold, and it never has two automatic payouts in flight at once. ### Marketplace settings (curl) ```bash curl "${API_URL}/v1/marketplace/settings" --header "x-api-key: ${VEXPAY_API_KEY}" curl --request PATCH "${API_URL}/v1/marketplace/settings" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "merchantAutoPayoutDefault": true, "merchantAutoPayoutMinUsd": "10.00" }' ``` | Setting | Effect | | --- | --- | | merchantAutoPayoutDefault | true: comercios you create without autoPayoutEnabled start with auto-payout on. Existing comercios keep their setting. | | merchantAutoPayoutMinUsd | No automatic payout below this amount (USD at the BCV rate); the balance waits for more sales. null = any balance of Bs 1 or more. | A failed automatic payout returns the money to the comercio’s available balance and is retried in the next cycle. After 3 failures in a row, automatic payouts for that comercio stop for 24 hours and VEX Pay ops is alerted. You get `payout.completed` / `payout.failed` for each one, as for any payout. ## 05. Reversals and limits A **full** reversal of a split payment takes each comercio’s credit back (from pending, or from available if it was already released) and returns your commission and remainder, so every balance nets to zero for that payment. **Partial** refunds of a split payment are not supported yet and are refused with a clear error. | Rule | What happens otherwise | | --- | --- | | 1 to 10 shares, each comercio once | 400 invalid_data | | Every comercio is yours, active and not removed | 400 invalid_data | | Shares add up to at most the payment amount | 400 invalid_data | | Each commission is at most its share | 400 invalid_data | | Not together with merchantId, applicationFeeVes or applicationFeePercent at the top level | 400 invalid_data | | Not together with onwardPayout (USDT forwarding) | 400 invalid_data | | Only on débito inmediato, C2P, Pago Móvil verify and VPOS | Checkout sessions, USDT and peso payments refuse splits with a 400 naming the supported methods | For C2P you can send `splits` on the request (`/v1/payments/c2p/request`) or on the execute call, not both. Resending the exact same shares on execute (for example after a failed attempt) is accepted. A payment with shares never takes `onwardPayout`, including on a C2P execute or a Pago Móvil retry with the same reference. --- # Recipe: pay your end users from your sales (disbursements) > Collect with VEX Pay, credit each of your end users (staff, contractors, affiliates) in dollars at the BCV rate every pay period, let them withdraw to their own Pago Móvil from your own app, and give each one a monthly statement. You pay the withdrawal fee. Human docs: /recipe-disbursements ## What you will build Your business sells through VEX Pay payment links, checkout sessions or charges, and the money lands in your balance. Every pay period (weekly, biweekly, monthly) your admin system credits each end user a dollar amount; VEX Pay converts it at the official BCV rate and keeps it in that person's own balance. When a person wants their money, they press **Withdraw** in your app, your server asks VEX Pay for the payout, and the bolívares arrive on their Pago Móvil. Your end users never sign in to VEX Pay. | Money | Where it sits | Who can move it | | --- | --- | --- | | Your sales | Your balance (available once the bank confirms) | You: credit end users or withdraw to your own bank | | A credit to an end user | That end user's balance (`pendingVes`, then `availableVes`) | You, on the end user's behalf: withdraw to their verified Pago Móvil | | The withdrawal fee | Charged to your balance on each withdrawal | VEX Pay | > **NOTE: Turn it on first** > > Disbursements is a setting VEX Pay switches on for your account, together with your withdrawal fee price. It works in Test mode immediately; Live follows your go-live approval. Ask us before you start. ## How the pieces fit | Your system | VEX Pay API | | --- | --- | | A person joins (employee, affiliate…) | `POST /v1/merchants` + add and verify their Pago Móvil | | Pay-period run: "pay $100 to each person" | `POST /v1/merchants/:id/transfers` with `amountUsd`, one per person | | Person's balance screen | `GET /v1/merchants/:id/balance` | | Person presses Withdraw | `POST /v1/payouts` with `fromMerchantBalance: true` | | History / monthly statement | `GET /v1/merchants/:id/transactions`, `GET /v1/merchants/:id/statement?month=YYYY-MM` | | Status updates | Webhooks: `merchant.balance.updated`, `payout.completed`, `payout.failed` | - Keep your API key on your server only, never in a mobile app or browser. - Store the VEX Pay `merchantId` next to each person in your database; use your own id as `externalRef`. - In the API an end user is a `merchant`: the same object marketplaces use for their sellers. ## 01. Collect your sales Sell as you do today: portal payment links, checkout sessions or API charges. Each completed sale adds its net (after the VEX Pay processing fee) to your balance. Live bolívar sales are available once the bank confirms them (`unconfirmedVes` until then); your balance and every movement are at `GET /v1/balance` and `GET /v1/balance/transactions`. ## 02. Register each end user and verify their Pago Móvil ### curl ```bash # 1. Create the end user (externalRef = your own id for the person) curl --request POST "${API_URL}/v1/merchants" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "externalRef": "emp-104", "name": "Ana Rodriguez", "identification": "V12345678", "contactEmail": "ana@mail.com", "contactPhone": "04141234567" }' # 2. Add their Pago Móvil curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "bankCode": "0105", "phone": "04141234567" }' # 3. Two micro-deposits, then confirm the amounts the person received curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods/METHOD_ID/verify/start" --header "x-api-key: ${VEXPAY_API_KEY}" curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods/METHOD_ID/verify" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amount1": "0.37", "amount2": "0.82" }' ``` Ask the person, inside your app, for the two small amounts they received. Money only ever leaves to a verified method. Full detail: /playbook-onboard-seller. ## 03. Run the pay period: credit each person in dollars For each person, send the dollar amount and a `transferKey` that is unique per person and pay period. VEX Pay converts at the BCV rate of that moment, debits your balance and credits the person. If your job crashes and runs again, the same `transferKey` returns the first result: nobody is paid twice and nobody is re-priced. ### curl ```bash curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/transfers" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": "100.00", "transferKey": "2026-11-q1-emp-104" }' # 200 → # { "pendingVes": "0.00", "availableVes": "21540.00", ..., # "transfer": { "transferKey": "2026-11-q1-emp-104", "amountVes": "21540.00", # "amountUsd": "100.00", "rate": "215.4000", "rateSource": "bcv", # "rateAsOf": "2026-11-15T13:00:00.000Z" } } ``` ### Pay-period job (Node) ```javascript const period = '2026-11-q1'; for (const person of await db.people.activeWithVexpayId()) { const res = await fetch(`${process.env.VEXPAY_API_URL}/v1/merchants/${person.vexpayMerchantId}/transfers`, { method: 'POST', headers: { 'content-type': 'application/json', 'x-api-key': process.env.VEXPAY_API_KEY }, body: JSON.stringify({ amountUsd: person.amountUsd, transferKey: `${period}-${person.id}` }), }); if (res.status === 503) throw new Error('BCV rate unavailable, retry the run later'); // safe to rerun if (!res.ok) { await db.payRun.fail(person.id, await res.json()); continue; } const { transfer } = await res.json(); await db.payRun.record(person.id, transfer); // keep amountVes + rate for your books } ``` - Prefer to set bolívares yourself? Send `amountVes` instead of `amountUsd` (one or the other). - Your balance must cover the run: check `GET /v1/balance` first. A credit you cannot cover answers 422 `insufficient_balance` and records nothing. - Credits paid with sales the bank has not confirmed yet wait in the person's `pendingVes` until they are confirmed. Running the job after the sales are confirmed avoids the wait. ## 04. Let each person withdraw from your app Show the person their `availableVes` (from `GET /v1/merchants/:id/balance`). When they ask for a withdrawal, your server sends the payout. They receive exactly `monto`; the withdrawal fee is charged to your balance. ### curl ```bash curl --request POST "${API_URL}/v1/payouts" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "merchantId": "MERCHANT_ID", "monto": "20000.00", "concepto": "Retiro", "externalRef": "wd-emp-104-0007", "fromMerchantBalance": true }' # GET /v1/payouts/:id → # { "status": "completed", "monto": "20000.00", "feeVes": "253.85", "feePayer": "tenant", ... } ``` | Example fee: 1% (min $0.25) + $0.25, BCV 215.40 | You pay | | --- | --- | | Withdrawal of Bs 20,000.00 | Bs 200.00 + Bs 53.85 = Bs 253.85 | | Withdrawal of Bs 2,000.00 | Bs 53.85 (minimum) + Bs 53.85 = Bs 107.70 | - Use a new `externalRef` per withdrawal request and reuse it on retries: a retry never pays twice. - Keep a small reserve in your own balance for fees. Without it the withdrawal is refused with 422 `insufficient_balance` and `reason: "tenant_fee_unfunded"`. - Listen for `payout.completed` and `payout.failed`. If the bank rejects a withdrawal, the money goes back to the person's available balance and the fee back to yours. - Optionally let people decide how much to withdraw, or withdraw their whole `availableVes` with one tap. ## 05. Monthly statements and your own export Each person's statement shows the opening balance, every credit (with the dollar amount and BCV rate), release and withdrawal in the month, and the closing balance. Months follow Venezuela time. Opening plus the movements always equals closing. ### curl ```bash # JSON, for your own screens curl "${API_URL}/v1/merchants/MERCHANT_ID/statement?month=2026-11" --header "x-api-key: ${VEXPAY_API_KEY}" # CSV, to send to the person or your accountant curl "${API_URL}/v1/merchants/MERCHANT_ID/statement?month=2026-11&format=csv" \ --header "x-api-key: ${VEXPAY_API_KEY}" --output emp-104-2026-11.csv # Full history, newest first, paged curl "${API_URL}/v1/merchants/MERCHANT_ID/transactions?limit=50" --header "x-api-key: ${VEXPAY_API_KEY}" ``` No code needed for the monthly close: **Portal → Merchants → Monthly statement** downloads one person, or every person in one CSV with their name and ID on each row. Your own side (sales, credits, fees) is in `GET /v1/balance/transactions`: credits show as `seller_transfer` and fees as `disbursement_payout_fee`. ## Go-live checklist - Run the whole flow with your Test key: a sale, a dollar credit, a withdrawal, a statement (/playbook-test-mode). - Tell VEX Pay your number of people and the usual amount per pay period, so the payout limit for new accounts (USD 300 per rolling 24 hours in the first 30 days) is set to fit your payroll. Over it, withdrawals wait in `awaiting_approval` for review. - Agree your withdrawal fee price with VEX Pay. - Register a webhook endpoint and handle `payout.completed` / `payout.failed` (/playbook-webhooks). - Make your pay-period job safe to rerun (same `transferKey`) and your withdrawals safe to retry (same `externalRef`). ## Questions | Question | Answer | | --- | --- | | Do my end users need a VEX Pay account? | No. Your system calls the API with your key; they only see your app and their Pago Móvil. | | Which rate is used? | The official BCV rate when the credit is made, saved with it. The withdrawal fee's dollar parts use the BCV rate when the withdrawal is made. | | Can I take back a credit? | Not through the API. Money you credit belongs to the person until they withdraw it; credit only what you owe. Contact VEX Pay for mistakes. | | What if a customer disputes a card sale after I paid my people? | The refund or chargeback is taken from your balance, not from your end users. Recovering it from them is up to you. | | Can I pay to a bank account instead of Pago Móvil? | Withdrawals go to the person's verified Pago Móvil. | | Do I pay a fee when I credit someone? | No. You pay the processing fee on your sales and the withdrawal fee when a person withdraws. | Related: /playbook-disbursements · /playbook-onboard-seller · /merchants-payouts · /playbook-balance --- # Recipe: top-ups paid in bolívares, received in USDT > Your user pays in bolívares; VEX Pay converts the net to USDT and sends it to their wallet — one request, no treasury on your side. Human docs: /recipe-bs-to-usdt ## What you will build A top-up flow for wallets, exchanges or games: the user pays in bolívares (Pago Móvil or C2P) and receives USDT at a wallet address. You add one field, `onwardPayout`, and follow one webhook. 1. **Collect** — The pay-in carries onwardPayout with the user’s network and address. 2. **Convert** — When the payment completes, its net VES is converted at your conversion price (market rate + your spread). 3. **Wait for the release** — If the payment is still held, the USDT waits with status waiting_release and sendAfter. If the bank has not confirmed the bolívar payment yet, it waits with reason awaiting_bank_confirmation (no sendAfter) and is sent once the bank confirms it. Otherwise it is sent right away. 4. **Send** — VEX Pay sends the USDT minus the network payout fee to the address and fires payout.completed. ## 01. Collect with an onward instruction ### Pago Móvil verify (curl) ```bash curl --request POST "${API_URL}/v1/payments/pago-movil/verify" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "usdAmount": 20, "reference": "40010003", "externalRef": "topup-user-42", "onwardPayout": { "network": "BEP20", "address": "0x2f5c0000000000000000000000000000000000aa" } }' ``` VEX Pay validates the instruction before touching the bank: USDT and conversions must be enabled, the network’s payouts on, and the address valid for the network. A bad instruction answers 400 and nothing moves. ## 02. Follow it to the wallet | onwardPayout.status | What it means | Show your user | | --- | --- | --- | | pending | The payment has not completed yet | Waiting for your payment | | converting | Converting the net bolívares to USDT | Converting | | waiting_release | Converted; held until sendAfter (balance hold, if your account has one), or until the bank confirms the payment (reason awaiting_bank_confirmation, no sendAfter) | Your USDT will be sent at sendAfter, or once the bank confirms your payment | | sending | The USDT payout is on its way | Sending | | completed | Delivered (txHash set) | Done — show the transaction | | held / failed / canceled | Stopped (see reason); the money stays in your balance | Contact support | Every change fires `onward_payout.updated` with the same object. Subscribe to it and show `sendAfter` to your user while the status is `waiting_release`, so they know when to expect the USDT. ## 03. What it costs your user - The bolívar pay-in fee, as for any payment. - The conversion price: the market USDT rate plus your spread, fixed when the payment completes. - The network’s payout fee, shown by GET /v1/crypto/networks. > **NOTE: Small top-ups** > > If the converted USDT minus the payout fee is under the network minimum, the chain stops as held with reason below_payout_minimum and the USDT stays in your balance. --- # Recipe: accept Colombian pesos > Let buyers in Colombia pay by card, PSE, Bancolombia, Bre-B, Nequi or Daviplata — at checkout or from your own screens — and hold, refund or convert the pesos. Human docs: /recipe-cop ## Two ways to collect pesos | Way | Best when | How | | --- | --- | --- | | Hosted checkout | You already use checkout sessions or links | Add "cop" to methods (or leave methods empty) | | Direct API | You build your own payment screen | POST /v1/cop/payments with a channel | Pesos have their own balance, apart from bolívares and stablecoins. The standard fee is 4.5% + COP 1,500 per payment, with a COP 20,000 minimum. ## 01. Collect from your own screen ### Bre-B (curl) ```bash curl --request POST "${API_URL}/v1/cop/payments" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "Idempotency-Key: order-1042" \ --data '{ "amountCop": 100000, "channel": "breb", "reference": "order-1042" }' ``` | channel | What the buyer does | What you show | | --- | --- | --- | | breb | Scans a QR or pastes a transfer key in their bank app | next.qrPngBase64 and next.transferKey (only in this response) | | nequi | Approves a push notification in Nequi | A waiting screen | | daviplata | Types the SMS code Daviplata sends them | A code field; send it to POST /v1/cop/payments/:id/otp | ## 02. After the payment 1. **Fulfill** — payment.completed carries amountCop and feeCop. Match on reference. 2. **Balance** — The pesos are available at once: GET /v1/cop/balance shows availableCop (heldCop stays 0 unless your account has a hold). 3. **Refund if needed** — POST /v1/cop/payments/:id/refund within 96 hours. A refund of a sale that is still held comes out of the hold. 4. **Convert or withdraw** — Convert pesos to USDT (POST /v1/conversions with sourceCurrency COP, or auto-convert a share of every payment), or ask VEX Pay for a bank payout of your available pesos. --- # Recipe: sell monthly memberships > A gym, school or SaaS with monthly plans: sign customers up, collect every month by link or automatic debit, and keep access in sync with payment — step by step. Human docs: /recipe-subscriptions ## What you will build A membership business: “Básico” at $15 and “Pro” at $25 a month. Members sign up on your site, pay every month in bolívares, and lose access only after VEX Pay has tried to collect for 3 days. Members who prefer it pay by automatic debit. | Step | You do | Done when | | --- | --- | --- | | 1 | Create your plans | You have two `price_…` ids | | 2 | Listen to billing webhooks | Your endpoint verifies `customer.subscription.created` | | 3 | Sign up a member | They receive the first invoice and pay it | | 4 | Keep access in sync | Access follows `invoice.paid` and `customer.subscription.deleted` | | 5 | Offer automatic debit | A test member is debited without paying by hand | | 6 | Go live | Your first real member renews | ## 01. Create your plans ### curl ```bash curl --request POST "${API_URL}/v1/products" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "name": "Membresía", "priceUsd": "15.00" }' curl --request POST "${API_URL}/v1/prices" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "product": "PRODUCT_ID", "unitAmountUsd": 15, "recurring": { "interval": "month" }, "nickname": "Básico" }' curl --request POST "${API_URL}/v1/prices" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "product": "PRODUCT_ID", "unitAmountUsd": 25, "recurring": { "interval": "month" }, "nickname": "Pro" }' ``` **Checkpoint:** store both `price_…` ids in your configuration. Plans are created once, not per member. ## 02. Listen to billing webhooks Register (or update) your webhook endpoint with the billing events, and verify signatures as in /webhooks. Store the `sub_…` id on your member record. ### curl ```bash curl --request POST "${API_URL}/v1/webhooks" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "url": "https://example.com/webhooks/vexpay", "events": ["customer.subscription.created", "customer.subscription.updated", "customer.subscription.deleted", "customer.subscription.reactivated", "invoice.paid", "invoice.payment_failed"] }' ``` ## 03. Sign up a member When someone picks a plan, create the customer and the subscription from your server. Put your own user id in `metadata` so every webhook can be matched to the member. ### curl ```bash curl --request POST "${API_URL}/v1/customers" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "name": "Ana Pérez", "email": "ana@example.com", "phone": "04141234567", "idNumber": "V12345678", "metadata": { "userId": "u_981" } }' curl --request POST "${API_URL}/v1/subscriptions" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "customer": "CUSTOMER_ID", "price": "PRICE_PRO", "metadata": { "userId": "u_981" } }' # Send the member straight to the first invoice: curl "${API_URL}/v1/invoices?subscription=SUBSCRIPTION_ID" --header "x-api-key: ${VEXPAY_API_KEY}" # → items[0].hostedInvoiceUrl ``` **Checkpoint:** redirect the member to `hostedInvoiceUrl` (they also get it by email; in test mode only if their email is your business-profile email), pay it with a test method, and see `invoice.paid` arrive. Offering a trial instead? Add `"trialPeriodDays": 7` and no invoice is issued until it ends. ## 04. Keep access in sync with payment | Event | Your app | | --- | --- | | `invoice.paid` | Access on (or extended) until the subscription’s `currentPeriodEnd` | | `customer.subscription.updated` with `status: past_due` | Keep access, show a “payment pending” banner with the invoice link | | `customer.subscription.deleted` | Access off. If `cancellationReason` is `payment_failed`, tell them paying the invoice brings it back | | `customer.subscription.reactivated` | Access on again | For a “Cancel membership” button, call `POST /v1/subscriptions/:id` with `{ "cancelAtPeriodEnd": true }`: the member keeps what they paid for and is not billed again. ## 05. Offer automatic debit For members who never want to pay by hand, create a setup session, send them its link, and switch the subscription once they authorize (`payment_method.attached`). Full details: /domiciliacion. ### curl ```bash curl --request POST "${API_URL}/v1/setup-sessions" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "customer": "CUSTOMER_ID", "successUrl": "https://example.com/cuenta" }' # → send "url" to the member curl --request POST "${API_URL}/v1/subscriptions/SUBSCRIPTION_ID" \ --header "content-type: application/json" --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "collectionMethod": "charge_automatically" }' ``` **Checkpoint (test mode):** authorize with a phone ending in `0000` — the next invoice is debited and paid on its own. Try `0002` to see an `insufficient_funds` failure and the retry the next day. With a daily test price you do not wait a month for the next invoice. ## 06. Go live - Complete your business profile (name, logo, email): it is what your members see on invoices and emails. - Recreate your plans with the Live key — test and live objects are separate — and switch your server to it. - Choose your default collection attempts in **Portal → Billing → Settings**. - If you offer automatic debit, ask VEX Pay to enable it on your live account; until then live setup sessions and `charge_automatically` answer `automatic_charging_unavailable`, and `send_invoice` works as usual. > **SUCCESS: Done** > > Your members are billed every month, chased politely when they forget, and brought back automatically when they pay late — with no billing code beyond these calls. --- # Playbooks: do it yourself, step by step > Task-by-task playbooks for VEX Pay accounts: test, go live, take payments, split with sellers, convert, withdraw, refund, and fix common problems. Human docs: /playbooks ## How to use the playbooks Each playbook is one task. It says what you need first, the steps in order (portal clicks and API calls), how to check it worked, and what to do when it does not. Run every playbook with your **Test** key first. ## Get started | You want to… | Playbook | | --- | --- | | Try every method without real money | /playbook-test-mode | | Get approved and take real payments | /playbook-go-live | | Replace an API key, or react to a leaked one | /playbook-rotate-api-key | | Receive, verify and recover webhooks | /playbook-webhooks | ## Take payments | You want to… | Playbook | | --- | --- | | Sell with a link, no code | /playbook-payment-link | | Send a link that only takes Pago Móvil | /playbook-pago-movil-link | | Choose which methods buyers see | /playbook-payment-methods | | Take USDT or USDC | /playbook-accept-stablecoins | | Take Colombian pesos | /playbook-accept-cop | ## Manage your money | You want to… | Playbook | | --- | --- | | Know what you can withdraw and when | /playbook-balance | | Turn bolívares or pesos into USDT | /playbook-convert-to-usdt | | Withdraw to your bank or wallet | /playbook-withdraw | | Give money back, or handle a chargeback | /playbook-refunds | ## Marketplaces | You want to… | Playbook | | --- | --- | | Register a seller and verify their payout account | /playbook-onboard-seller | | Split a payment and pay the seller | /playbook-split-payments | | Pay your end users (staff, affiliates) from your sales | /playbook-disbursements | ## Fix a problem | You see… | Playbook | | --- | --- | | A buyer paid by Pago Móvil but it is not found | /playbook-pago-movil-not-found | | A webhook never arrived | /playbook-webhooks#recover | | A payout is refused for insufficient balance | /playbook-balance | > **NOTE: Building from scratch?** > > The integration path (/integration-path) walks through a full integration in order, and the recipes cover complete businesses. The playbooks are for one task at a time. --- # Test your whole integration in Test mode > Run every payment method, webhook and payout you plan to use with your Test key — no real money moves — before you ask to go live. Human docs: /playbook-test-mode ## What you will do Every account has a **Live** and a **Test** side. Test works from day one, uses sandboxes, and never charges a real buyer. By the end of this playbook you will have completed a test payment for each method you plan to offer, received and verified its webhook, and read the result in your balance. - Access to the portal (the login link VEX Pay sent you). - A server that can make HTTPS requests and receive one public HTTPS webhook (use a tunnel when developing locally). ## Steps > **WARNING: Card payments are temporarily unavailable** > > Card payments (VPOS) are temporarily unavailable. The endpoint answers 400 until they return. 1. **Switch the portal to Test** — Use the **Live | Test** toggle in the portal header. You stay signed in. Everything you create while Test is selected belongs to your Test account. 2. **Create a Test key** — Open **Credentials**, name the key after the integration that will use it (for example "Backend") and click **Create key**. Copy the key when it is shown and store it in your server environment as `VEXPAY_API_KEY`. 3. **Register a Test webhook endpoint** — Open **Webhooks** → **New endpoint**, or call `POST /v1/webhooks` with the Test key. Save the signing secret — it is shown only once. Then click **Send test**. Full detail: /playbook-webhooks. 4. **Pay once with every method you will offer** — Create a checkout session (or a payment link) with the Test key and pay it. The test controls for each method are in the table below. 5. **Try the failure paths too** — Use a wrong code, let a payment expire, or use a card that declines, and check that your system reacts to `payment.failed` and `payment.canceled` without fulfilling the order. 6. **Read the result** — Call `GET /v1/payments/:id` and `GET /v1/balance` with the Test key. Test accounts have no balance hold and no bank confirmation, so test credits are available at once. ### Create a test checkout ```bash curl --request POST "${API_URL}/v1/checkout/sessions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": 5.00, "description": "Test order", "reference": "test-order-1" }' # Open the "url" from the response and pay with the test controls below. ``` | Method | How to complete it in Test | | --- | --- | | Card | Use the test card numbers at /vpos#test-card. Real cards are declined without being charged. | | Débito Inmediato (C2P) | Enter the current code shown in **Portal → Sandbox**. Any other code fails the payment. | | Pago Móvil (hosted checkout) | The waiting screen shows placeholder details — never send real money to them. Press **Simular pago recibido**. | | USDT / USDC | The hosted stablecoin page shows test buttons to confirm, cancel, or simulate a short payment. For a deposit address, call `POST /v1/crypto/deposit-addresses/simulate` with its `customerRef`, `network`, `currency` and an `amount` (up to 10,000), or use **Simulate deposit** on the portal USDT page. It credits exactly like a real deposit and sends `payment.completed` with `livemode: false`. | | Colombian pesos | Nequi: any valid data (for example phone `3001234567`, document `CC` `1234567890`) completes about a minute later. Daviplata: code `123456`. Never send real pesos in Test. | | Card chargeback | Pay with `4000000000000259`. About a minute later a test chargeback is recorded and `payment.chargeback` arrives. | ## Check that it worked - Each test payment shows `COMPLETED` in `GET /v1/payments/:id` (COP: `completed` in `GET /v1/cop/payments/:id`) and on the portal **Payments** page. - Your endpoint received `payment.completed` with `livemode: false`, and your signature check passed. **Portal → Webhooks → Delivery history** shows the delivery as successful. - Your order was marked paid exactly once, even when you replayed the same event. > **NOTE: Why this matters for go-live** > > When you request go-live, VEX Pay looks at your Test account for at least one completed payment and one successful webhook delivery. Doing both here makes the review faster. ## What behaves differently in Test - No bank confirmation: test credits are available immediately (live bolívar credits wait for the bank to confirm them). - Conversions to USDT complete in the same request, and test stablecoin payouts complete at once without a transaction hash. - Payout-account and seller micro-deposits, and Bolívar payouts, run on the **sandbox** in Test: no real money moves. Confirm the micro-deposits with the `testAmounts` returned when you start the verification. - USDT, USDC and Colombian pesos appear in Test only when VEX Pay has enabled them on your account. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 403 `live_mode_not_activated` | You are sending the Live key | Use the Test key until your account is approved. | | 401 on every call | Key missing, mistyped, revoked or rotated | Copy the key again from **Credentials** (Test selected). | | A method is missing on the test checkout | Not enabled on your account, or turned off in **Payment methods** | See /playbook-payment-methods. Ask VEX Pay to enable a method you need. | | Débito Inmediato fails with a code error | The code changed or was mistyped | Use the code shown in **Portal → Sandbox** at that moment. | | Webhook endpoint refused with 400 | URL is localhost, private, or not http(s) | Use a public HTTPS URL, for example a tunnel to your machine. | Related: /integration-path · /going-live · /playbook-go-live --- # Go live: from the checklist to your first real payment > Finish the Getting started checklist, verify your business, request go-live, and switch to your Live key once VEX Pay approves your account. Human docs: /playbook-go-live ## What you will do Your Live account starts **pending**: live keys return 403 `live_mode_not_activated` and live payment links take no payments. VEX Pay approves live mode after reviewing your business and your integration. This playbook takes you through every step, in order. - Your integration already works in Test (see /playbook-test-mode). - Your company documents at hand: registration deed, tax ID certificate, the legal representative's ID and a proof of address (PDF, PNG or JPEG, up to 10 MB each). ## Complete the Getting started checklist The portal **Overview** shows a **Getting started** checklist. Work through it on your **Live** account: 1. **Add your contact info** — Save the owner email and phone when the portal asks. They are private: never shown to buyers or sent in the API. Until they are saved, the portal refuses to create, rotate or reveal any key, and refuses go-live (409 `owner_contact_required`). 2. **Verify your identity or business** — Open **Verification** and choose who is selling. **A company**: company details, business activity, the legal representative and beneficial owners (25% or more), the PEP declaration and attestations; documents are the registration deed, tax ID certificate, representative ID and proof of address. **Myself** (you sell under your own name or a firma personal): your ID details, personal RIF or tax ID, home address, business activity and attestations; documents are your ID, a selfie holding that ID (PNG or JPEG), your personal RIF certificate and proof of address, plus the firma personal registration if you have one. Submit when nothing is missing. You can edit it while it is a draft or when VEX Pay requests changes (their note is shown). 3. **Get your API credentials** — Have at least one active key in **Credentials**. Live keys can be created once live mode is approved; until then, use Test. 4. **Add a webhook endpoint** — At least one active endpoint in **Webhooks**. See /playbook-webhooks. 5. **Save and verify your payout account** — In **Payouts → Destinations**, save a Pago Móvil or checking account and confirm the two micro-deposits, or save a USDT wallet (usable 24 hours after saving). A verified bolívar account is required: without it, live payment links and checkout sessions answer 409 `payout_account_required` and your links show buyers a paused page. See /playbook-withdraw. 6. **Marketplaces: register and verify a seller** — Marketplace accounts also register their first seller and verify one seller payout destination. See /playbook-onboard-seller. > **NOTE: Optional but recommended** > > Fill in your **Business profile** (name, logo, RIF, WhatsApp, email). Buyers see it on the checkout and the receipt. After business verification is approved, the country and tax ID come from it and are locked. ## Request go-live 1. **Finish one test payment and one webhook delivery** — VEX Pay reviews your Test account for at least one completed payment and one successful webhook delivery. 2. **Click Request go-live** — On the **Live** portal, click **Request go-live** on the "Live mode pending review" banner. The banner then shows that review was requested. The button does not work from the Test portal. 3. **Send a short video of your integration** — VEX Pay asks for a short video of your integration working end to end (a buyer paying and your system reacting). Send it on WhatsApp to **+58 414 933 3844** (wa.me/584149333844) with your account name. Approval waits until it has been reviewed. 4. **Wait for approval** — Approval needs your business verification to be approved and your owner contact saved. When live mode is approved you receive the `tenant.live_status_changed` webhook and the banner disappears. ## Switch to live 1. **Create a live key** — With **Live** selected, open **Credentials** and create a key. Store it in your production environment. 2. **Register production webhooks on Live** — Live and Test have separate endpoints and secrets. Register your production URL on the Live account and store its secret. 3. **Deploy and make one small real payment** — Deploy with the live key, pay a small real amount, and check it end to end. ### Check the live key ```bash curl "${API_URL}/v1/banks" \ --header "x-api-key: ${VEXPAY_API_KEY}" # 200 = live mode active · 403 live_mode_not_activated = not approved yet ``` ## Check that it worked - `GET /v1/banks` with the live key returns 200. - Your first real payment is `COMPLETED`, and its `payment.completed` webhook has `livemode: true`. - Live bolívar credits show in `unconfirmedVes` on `GET /v1/balance` until the bank confirms them, then become available and are settled to your payout account automatically within about a minute. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 403 `live_mode_not_activated` on every live call | Live mode is pending or suspended | Keep using Test. Request go-live from the Live portal. Retrying does not help. | | 409 `owner_contact_required` | No owner email and phone saved | Save them in the portal prompt or on **Business profile**. | | Request go-live returns 400 | Sent from the Test portal | Switch the header toggle to **Live** and click it again. | | Requested go-live, no reply | A repeat request within 24 hours sends no new alert | Contact VEX Pay directly. | | Tax ID cannot be edited (409 `kyb_locked`) | Business verification is approved, so the tax ID comes from it | Contact VEX Pay to change it. | | Live checkout says "This payment link is not available." | Live not approved, suspended, or the account is disabled | Use Test links until approved. If suspended, contact VEX Pay. | | Portal login returns 429 | Locked for 15 minutes after repeated wrong passwords | Wait 15 minutes, or ask VEX Pay to reset the password. | Related: /going-live · /authentication · /business-models --- # Rotate an API key without downtime > Replace an API key with no failed requests: create a second key, deploy it, confirm it is in use, then revoke the old one. Plus what to do when a key leaks. Human docs: /playbook-rotate-api-key ## What you will do In **Credentials**, **Rotate** replaces a key's secret and the old secret stops working **immediately**. To avoid failed requests during a planned change, run two keys side by side for a moment instead. You can have up to 20 active keys per account (Live and Test each). - Portal access, with the owner contact saved (key actions are refused without it). - For Live keys: live mode approved. - Access to every place the key is stored (secret manager, server environment, plugins). ## Steps (planned rotation) 1. **Find where the key is used** — Open **Credentials** on the right side (Live or Test). Each key shows when it was last used, the IP and user agent, and a 30-day request history. Note every integration using the old key. 2. **Create the replacement** — Click **Create key** with a new name (for example "Backend 2026-11"). Copy the key when it is shown. 3. **Deploy it everywhere** — Update `VEXPAY_API_KEY` in each environment and plugin that used the old key, and redeploy. 4. **Confirm the new key is in use** — Call `GET /v1/banks` with the new key. Then check **Credentials**: the new key shows a recent "Last used", and the old key's stops moving. 5. **Revoke the old key** — Click **Revoke** on the old key. It stops authenticating at once; its payment history is kept. ### Smoke test ```bash curl "${API_URL}/v1/banks" \ --header "x-api-key: ${VEXPAY_API_KEY}" # 200 = the new key works · 401 = wrong, revoked or rotated key ``` ## If a key leaked 1. **Stop it now** — Click **Rotate** (you get a new secret for the same key) or **Revoke** on the exposed key. Do this before updating your servers: a short outage is better than a working leaked key. 2. **Deploy the new secret** — Update every environment with the new secret and check with `GET /v1/banks`. 3. **Review the access history** — In **Credentials**, look at the last 30 days of requests for IPs or user agents you do not recognise, and check **Payments** and **Payouts** for activity you did not start. 4. **Tell VEX Pay** — Contact VEX Pay with what you found so the team can review the account with you. ## Check that it worked - Only the new key shows recent use in **Credentials**; the old key is marked **Revoked**. - No 401 responses in your logs after the switch. - If you subscribe to them, you received `tenant.api_key.created`, `tenant.api_key.rotated` or `tenant.api_key.revoked`. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 401 right after the change | A service still sends the old (revoked or rotated) secret | Find it from the old key's last-used IP and user agent, and update it. | | 409 `owner_contact_required` | No owner email and phone saved | Save them in the portal prompt, then retry. | | 403 `live_mode_not_activated` when creating a live key | Live mode is not approved yet | Use Test keys until approval (see /playbook-go-live). | | Cannot create another key | The account already has 20 active keys | Revoke keys you no longer use. | A rotation affects only the mode it is done in: rotating a Test key never touches Live. Related: /authentication --- # Set up, verify and recover webhooks > Register an endpoint, verify every signature on the raw body, deduplicate deliveries, and recover an event you missed — webhooks are sent once, with no retry. Human docs: /playbook-webhooks ## What you will do VEX Pay signs every webhook and sends it **once**, with a 10-second timeout and no automatic retry. Your endpoint must verify the signature, answer 2xx quickly, ignore duplicates, and your system must be able to look up anything it missed. Do this once on Test and once on Live — they have separate endpoints and secrets. - A public HTTPS URL. Localhost, private IPs, `*.internal`/`*.local` names, URLs with a username or password, and redirects are refused. - Access to the raw request body in your web framework (signatures are computed on the exact bytes). ## Register the endpoint 1. **Create it** — In **Portal → Webhooks → New endpoint**, or with `POST /v1/webhooks`. List only the events you handle. 2. **Save the secret** — The signing secret is returned only in the create response. Store it as `VEXPAY_WEBHOOK_SECRET`. If you lose it, create a new endpoint and delete the old one — the secret cannot be changed later. 3. **Send yourself a test** — Click **Send test** in the portal or call `POST /v1/notifications/test` (up to 10 every 10 minutes). You receive a `notification.test` event. ### curl ```bash curl --request POST "${API_URL}/v1/webhooks" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "url": "https://shop.example/webhooks/vexpay", "events": ["payment.completed", "payment.failed", "payment.canceled", "payment.reversed", "payout.completed", "payout.failed"] }' # Save "secret" from the response now. ``` Change the URL, the event list or turn an endpoint off with `PATCH /v1/webhooks/:id` (the event list is replaced as a whole). The full event catalogue is at /webhooks. ## Verify every delivery Each delivery is a POST with a JSON body `{ event, data, timestamp }` and the header `VexPay-Signature: t=,v1=`. `v1` is the HMAC-SHA256 of `"."` with your endpoint secret. Accept the delivery when any `v1` value matches and `t` is within 5 minutes of your clock. ### Node SDK ```javascript app.post('/webhooks/vexpay', express.raw({ type: 'application/json' }), async (req, res) => { let event; try { event = vexpay.webhooks.constructEvent( req.body, // raw bytes, not parsed JSON req.headers['vexpay-signature'], process.env.VEXPAY_WEBHOOK_SECRET, ); } catch { return res.sendStatus(400); } const eventId = req.headers['vexpay-event-id']; if (await alreadyProcessed(eventId)) return res.sendStatus(200); await queue.add({ eventId, event }); // do the work after answering res.sendStatus(200); }); ``` ### Without an SDK (Node) ```javascript import crypto from 'node:crypto'; function verify(rawBody, header, secret, toleranceSec = 300) { const parts = header.split(',').map((p) => p.split('=')); const t = Number(parts.find(([k]) => k === 't')?.[1]); const signatures = parts.filter(([k]) => k === 'v1').map(([, v]) => v); if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false; const expected = crypto .createHmac('sha256', secret) .update(`${t}.${rawBody}`) .digest('hex'); return signatures.some( (s) => s.length === expected.length && crypto.timingSafeEqual(Buffer.from(s), Buffer.from(expected)), ); } ``` - Deduplicate on the `VexPay-Event-Id` header: the same event can reach you more than once. - Answer 2xx within 10 seconds and do slow work in a queue. A timeout counts as a failed delivery and is not retried. - Events can arrive out of order. Decide from the object's current status, not from the order of events. - Fulfil only from a verified `payment.completed` or from a GET that shows the payment completed. Browser redirects are hints, never proof. ## Recover an event you missed If your endpoint was down or answered slowly, the event will not be sent again. Look the object up instead: 1. **Find failed deliveries** — **Portal → Webhooks → Delivery history** shows each delivery with its status, HTTP code and the start of your response. 2. **Look the object up** — `GET /v1/payments/:id`, or `GET /v1/payments/by-ref/:externalRef` when you never got an id. COP: `GET /v1/cop/payments/:id`. Checkout: `GET /v1/checkout/sessions/:id`. Payouts: `GET /v1/payouts/:id`, `GET /v1/payouts/by-ref/:externalRef`, `GET /v1/crypto/payouts/:id`. 3. **Catch up on money movements** — Page through `GET /v1/balance/transactions` (bolívares) since your last processed movement, and book each movement once by its `id`. 4. **Run it on a schedule** — A periodic job that checks orders still "waiting for payment" against the API closes the gap for good. ### Look up by your reference ```bash curl "${API_URL}/v1/payments/by-ref/order-1042" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ## Check that it worked - **Send test** shows a successful delivery with your 2xx code in **Delivery history**. - A delivery with a changed body or a wrong secret is rejected by your endpoint. - Replaying the same delivery does not process the order twice. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | Signature never matches | The body was parsed and re-serialized before verifying, the wrong secret, or a Test secret on Live | Verify the raw bytes with the secret of that endpoint. | | SDK says the timestamp is outside the tolerance | Server clock is off | Sync your clock (NTP). | | Delivery failed with a 3xx code | Your URL redirects | Register the final URL. | | Delivery failed, timeout | Your endpoint took more than 10 seconds | Store the event, answer 2xx, then process. | | Delivery failed with "blocked" | The host resolves to a private address | Fix the DNS record; blocked deliveries are not retried. | | An event never arrived | Not in the endpoint's event list, or the endpoint was down | Add it with `PATCH /v1/webhooks/:id`, then recover as above. | | 429 on test sends | More than 10 tests in 10 minutes | Wait a few minutes. | Related: /webhooks · /reconcile · /idempotency --- # Create and share a payment link > Sell without code: create a one-time link in the portal, share it by WhatsApp or QR, and confirm the payment — or create reusable product links with the API. Human docs: /playbook-payment-link ## What you will do A payment link opens the VEX Pay hosted checkout for a fixed amount in USD. The buyer picks how to pay among the methods your account offers. Each portal link accepts **one** payment. - A **seller** account (marketplace accounts do not have payment links; use checkout sessions instead, see /playbook-split-payments). - For live links: live mode approved (see /playbook-go-live). Test links work at any time. - Optional: your **Business profile** filled in, so buyers see your name and logo. ## Steps 1. **Open Payment links** — In the portal, pick **Live** or **Test** in the header, then open **Payment links**. 2. **Fill in the link** — Amount in USD (up to 2 decimals), a description the buyer sees (up to 140 characters), and optionally a private reference and an expiry date in the future. 3. **Share it** — Use **Copy link**, **Share**, or **QR code**. Below each active link the portal lists "Buyers can pay with: …", with a short reason for any method that is hidden. 4. **Get paid** — When the buyer pays, the link turns **Paid**, the payment appears in **Payments**, and your `payment.*` webhooks fire. > **NOTE: Need to change it?** > > Links cannot be edited. Cancel an active or expired link and create a new one. A paid link cannot be cancelled. ## Reusable links for a product (API) To sell the same item many times at a fixed unit price, create a product and a product link. Product links accept many payments and can let the buyer pick a quantity. ### curl ```bash curl --request POST "${API_URL}/v1/products" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "name": "Monthly plan", "priceUsd": 12.00 }' curl --request POST "${API_URL}/v1/products/PRODUCT_ID/links" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "allowQuantity": true, "maxQuantity": 10 }' ``` Turn a product link off with `PATCH /v1/payment-links/:id` and `{ "status": "disabled" }`. More: /products ## Check that it worked - Open the link in a private window: you see your business name, the description and the amount. - After a test payment the link shows **Paid** and anyone opening it again sees that it was already paid. - Your webhook endpoint received `payment.completed`. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | "This payment link is not available." | Live mode not approved or suspended, the account disabled, or the product link disabled | Check your live status, or enable the link again. | | "This payment link has already been paid." | One-time link already paid | Create a new link. | | "This payment link has expired." | The expiry passed | Create a new link. | | 409 `charge_in_progress` | Another buyer is paying the same one-time link | Retry in a moment. | | A method is missing | See the reason under the link | See /playbook-payment-methods. | | 403 `payment_links_unavailable` | Marketplace account | Use checkout sessions from the API. | Related: /payment-links · /browser-checkout --- # Create a checkout link that only takes Pago Móvil > Create a checkout session limited to Pago Móvil, send the buyer the link, and let VEX Pay match the transfer automatically. Human docs: /playbook-pago-movil-link ## What you will do Portal payment links offer every method your account accepts. To offer **only** Pago Móvil on one link, create a checkout session with `methods: ["pago_movil"]`. The buyer pays from their own bank app and VEX Pay confirms the transfer by matching phone, amount and time. - Pago Móvil enabled on your account and not turned off in **Portal → Payment methods**. - On Live, a complete receiving account (VEX Pay manages it; you never enter it). - Your API key on your server. ## Steps 1. **Check that Pago Móvil is available** — `GET /v1/payment-methods` must show `pago_movil` with `available: true`. If it shows a `reason` (`not_enabled` or `receiving_account_not_configured`), contact VEX Pay. 2. **Create the session** — Call `POST /v1/checkout/sessions` with your amount in USD and `methods: ["pago_movil"]`. Keep the session `id` with your order. 3. **Send the buyer the url** — Share the `url` from the response by WhatsApp, email or a redirect. The link is valid for `expiresInMinutes` (default 60). 4. **The buyer pays** — The buyer enters their cédula/RIF and the phone they will pay from. The checkout shows the bank, phone, RIF and the **exact** bolívar amount. The buyer has 15 minutes to send the Pago Móvil from that phone. 5. **VEX Pay confirms it** — When the transfer arrives, the checkout shows the receipt and `payment.completed` fires with your `reference` in `checkoutSession`. If the buyer paid from another phone, after 5 minutes they can enter the bank and reference instead. ### curl ```bash curl "${API_URL}/v1/payment-methods" \ --header "x-api-key: ${VEXPAY_API_KEY}" curl --request POST "${API_URL}/v1/checkout/sessions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": 20.00, "description": "Order #2051", "reference": "order-2051", "methods": ["pago_movil"] }' ``` > **NOTE: Only Pago Móvil everywhere instead?** > > Turning the other methods off in **Portal → Payment methods** removes them from every hosted checkout of your account, including portal payment links. See /playbook-payment-methods. ## Check that it worked - The checkout offers only Pago Móvil. - In Test, press **Simular pago recibido** on the waiting screen: the session becomes `paid` in `GET /v1/checkout/sessions/:id` and `payment.completed` arrives with `livemode: false`. - On Live, the receipt shows the bank reference. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 400 `invalid_data` naming `pago_movil` | Not enabled on your account, or turned off in **Payment methods** | Turn it on, or ask VEX Pay to enable it. | | Buyer paid but the checkout keeps waiting | Paid from another phone or a different amount | After 5 minutes, the buyer enters the bank and reference. See /playbook-pago-movil-not-found. | | Payment expired, then the buyer paid | The transfer arrived after 15 minutes | It is not credited automatically. Contact VEX Pay support with the reference. | | Never send money to Test details | Test checkouts show placeholder receiving details | Use **Simular pago recibido** in Test. | Related: /pago-movil · /payment-links --- # Turn checkout payment methods on or off > Choose which methods buyers see on all your hosted checkouts from Portal → Payment methods, or limit a single link with `methods`, and understand why a method is hidden. Human docs: /playbook-payment-methods ## What you will do Two things decide what a buyer sees: what VEX Pay has **enabled** for your account, and what **you** have turned on. You control the second one, for every checkout at once or per link. ## Steps: for every checkout > **WARNING: Card payments are temporarily unavailable** > > Card payments (VPOS) are temporarily unavailable. The endpoint answers 400 until they return. 1. **Open Payment methods** — In the portal, open **Payment methods**. It lists Card, Débito Inmediato, Pago Móvil, USDT, USDC and Colombian pesos, each with the currency it is paid in. 2. **Flip the toggles** — Each change saves at once. Methods VEX Pay has not enabled for you are greyed out as "Not enabled for your account". 3. **Keep at least one on** — The portal refuses to turn off the last enabled method. - A method you turn off disappears from **every** hosted checkout: portal payment links, product links and API checkout sessions. - A change on Live also applies to your Test account. - Direct payment API calls (for example `POST /v1/payments/vpos`) are not affected. ## Steps: for one checkout only Send `methods` when you create a checkout session. Values: `c2p` (shown as Débito Inmediato), `pago_movil`, `vpos` (card), `usdt`, `usdc`, `cop`. Leave it out to offer everything your account accepts and has turned on. ### Only stablecoins on this link ```bash curl --request POST "${API_URL}/v1/checkout/sessions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": 50.00, "description": "Order #3007", "methods": ["usdt", "usdc"] }' ``` ## Check that it worked In **Payment links**, each active link lists "Buyers can pay with: …" and gives a reason for each hidden method. Open a checkout in a private window to see it as a buyer does. | Reason shown | What it means | What to do | | --- | --- | --- | | not enabled for your account | VEX Pay has not enabled the method for your account | Ask VEX Pay to enable it. | | turned off in Payment methods | You turned it off | Turn it back on. | | excluded on this link | The session's `methods` leaves it out | Create a session that includes it. | | not available for sellers | Stablecoins and pesos are not offered on checkouts split with a seller | Expected; split checkouts take bolívar methods only. | | receiving account not set up | Pago Móvil on Live without a complete receiving account | Contact VEX Pay. | | rate temporarily unavailable | No fresh exchange rate right now | Wait a few minutes; other methods keep working. | | amount below the minimum | The peso price is under COP 20,000 | Raise the amount or let the buyer pick a quantity. | | temporarily unavailable | The method cannot be offered at the moment | Retry later; contact VEX Pay if it persists. | ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 400 "Keep at least one payment method on." | You tried to turn off the last enabled method | Turn another method on first. | | 400 `invalid_data` "Turned off in Portal → Payment methods: …" | A session names a method you turned off | Remove it from `methods` or turn it back on. | | A toggle is greyed out | Not enabled for your account | Ask VEX Pay to enable it. | Related: /payment-links · /browser-checkout --- # Accept USDT and USDC > Take stablecoin payments on the hosted checkout or with a permanent deposit address per customer, and credit your customer once per payment. Human docs: /playbook-accept-stablecoins ## What you will do Buyers pay 1 USDT or 1 USDC per US dollar. The coin lands in your USDT or USDC balance (each is separate), net of your stablecoin fee, which you pay — the buyer sees no fee. Pick the hosted checkout for orders, or a deposit address for top-ups. - USDT (and USDC, separately) enabled on your account by VEX Pay. - A webhook endpoint subscribed to `payment.completed` and `payment.canceled`. ## Steps: hosted checkout 1. **Create a session** — `POST /v1/checkout/sessions` with `amountUsd` and `methods` containing `usdt` and/or `usdc` (or no `methods` to offer everything). 2. **The buyer picks coin and network** — The checkout shows the networks enabled for that coin. TON payments need the tag/memo shown. 3. **The buyer sends the coin** — A payment page shows the address and exact amount. The status page moves from started to network confirmation to completed; the buyer may close it. 4. **Fulfil from the webhook** — `payment.completed` carries `currency`, `amount`, `fee`, `network`, `txHashes` and your `checkoutSession` reference. ## Steps: deposit address per customer 1. **List the networks** — `GET /v1/crypto/networks?currency=USDT` (or `USDC`) shows the networks enabled for you. 2. **Get the address** — `POST /v1/crypto/deposit-addresses` with `customerRef` (your customer id: 1–128 characters of letters, digits and `_ . : @ -`), `network` and optionally `currency`. Calling it again for the same customer, coin and network returns the same address. 3. **Show it to your customer** — Show the `address`, and the `tag` whenever `tagRequired` is true. The customer can send any amount, any time. 4. **Credit your customer** — Each deposit fires `payment.completed` with `customerRef`. Credit `amount − fee` once per `paymentId`. ### curl ```bash curl --request POST "${API_URL}/v1/crypto/deposit-addresses" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "customerRef": "user_123", "network": "TRC20", "currency": "USDT" }' ``` ### Simulate a deposit (Test key) ```bash curl --request POST "${API_URL}/v1/crypto/deposit-addresses/simulate" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "customerRef": "user_123", "network": "TRC20", "currency": "USDT", "amount": "40.00" }' ``` ## Check that it worked - In Test, use the test buttons on the payment page to confirm, cancel or send short; each outcome sends its webhook with `livemode: false`. - In Test, make a deposit arrive at an address with `POST /v1/crypto/deposit-addresses/simulate` (or **Simulate deposit** in the portal): it creates the payment, charges your fee and sends `payment.completed` with `customerRef` and `livemode: false`. Each call is a new deposit. A Live key gets `403 test_mode_only`. - `GET /v1/crypto/balances` shows the credit as `held` until `nextReleaseAt` on Live, then `available`. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 403 `method_not_allowed` | USDT or USDC not enabled on your account | Ask VEX Pay to enable it. | | 400 `unsupported_network` | That network is not enabled for that coin | Pick one from `GET /v1/crypto/networks`. | | `payment.completed` with `underpaid: true` | The buyer sent less than the amount | What arrived is credited, net of the fee; the checkout is not marked paid. Settle the difference with the buyer. | | TON deposit not matched to the customer | Tag/memo missing | Always show `tag` when `tagRequired` is true. Contact VEX Pay support with the transaction hash. | | `payment.completed` for more than the amount | The buyer sent too much | Everything that arrived is credited, net of the fee, and the checkout is marked paid. To give the extra back, ask the buyer for an address and send it with `POST /v1/crypto/payouts` (the payout fee applies). Never send it back to the address it came from: that is often an exchange that will not credit it. | | A deposit arrived but no webhook | A coin or network that is not enabled for you | Contact VEX Pay support with the transaction hash. | | 502/503 `processor_unavailable` | Temporary outage | Retry later; other currencies still work at checkout. | Fees: /pricing. Getting coins out: /playbook-withdraw. Related: /usdt --- # Accept Colombian pesos (card, PSE, Bancolombia, Bre-B, Nequi, Daviplata) > Take payments from buyers in Colombia on the hosted checkout or from your own screens, test each channel, and refund within 96 hours. Human docs: /playbook-accept-cop ## What you will do Pesos land in a separate COP balance, net of your COP fee (standard **4.5% + COP 1,500** per payment; see the Pricing page). The minimum per payment is **COP 20,000**. On the hosted checkout you price in USD and VEX Pay shows the buyer the peso amount. - COP enabled on your account by VEX Pay. - A webhook endpoint subscribed to `payment.completed`, `payment.failed`, `payment.canceled` and `payment.reversed`. ## Steps: hosted checkout 1. **Create a session** — `POST /v1/checkout/sessions` with `amountUsd` and `methods` containing `cop` (or no `methods`). 2. **The buyer picks COP** — The checkout shows the peso total, then the channels your account offers (card first, then PSE). 3. **The buyer completes the channel** — Bre-B: scan the QR or copy the key into any Colombian bank app (about 15 minutes). Nequi: approve the push in the app (about 5 minutes). Daviplata: type the 6-digit SMS code. 4. **Fulfil from the webhook** — `payment.completed` with `method: "COP"`, `amountCop`, `feeCop`, `amountUsd` and your `checkoutSession` reference. ## Steps: your own screens (API) 1. **Create the payment** — `POST /v1/cop/payments` with an `Idempotency-Key` header, `amountCop` (whole pesos, at least 20,000), `channel` (from `GET /v1/cop/channels`) and `buyer` (required for every channel except Bre-B: email, phone of 10 digits starting with 3, document type and number, plus `termsAccepted: true` when the catalog says `needsTermsAcceptance`; PSE also needs names, `personType` and `pse.bankCode`). 2. **Show the next step** — The response `next` tells you what to show: `show_qr` (QR image and transfer key — returned only once), `approve_in_app`, `submit_otp`, `redirect` (send the buyer to `next.url`) or `redirect_pending` (read the payment again in a few seconds). 3. **Daviplata only: send the code** — `POST /v1/cop/payments/:id/otp` with `{ "otp": "…" }`. A wrong code can be retried while the payment is pending. 4. **Wait for the result** — React to `payment.completed` or `payment.failed`, or read `GET /v1/cop/payments/:id`. Cancel a pending payment with `POST /v1/cop/payments/:id/cancel`. ### curl ```bash curl --request POST "${API_URL}/v1/cop/payments" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "Idempotency-Key: order-5120" \ --data '{ "amountCop": 50000, "channel": "nequi", "reference": "order-5120", "buyer": { "email": "juan@example.com", "phone": "3001234567", "documentType": "CC", "documentNumber": "1234567890" } }' ``` ## Check that it worked - Test Nequi: any valid data completes about a minute later. Test Daviplata: code `123456`. Never send real pesos in Test. - `GET /v1/cop/payments/:id` shows `completed` with `feeCop`. - `GET /v1/cop/balance` shows the net in `heldCop` (Live) and later in `availableCop`. ## Refund a peso payment `POST /v1/cop/payments/:id/refund` refunds the full amount within 96 hours of completion. Your COP balance must cover the net amount that was credited; the COP fee is returned. You then receive `payment.reversed` with `status: "refunded"`. See /playbook-refunds. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 403 `method_not_allowed` | COP not enabled on your account | Ask VEX Pay to enable it. | | 400 `amount_below_minimum` | Under COP 20,000 | Raise the amount or offer another currency. | | 400 `invalid_data` about `buyer` | Missing buyer for Nequi/Daviplata, bad phone, or a Daviplata document other than CC, CE or TI | Fix the field named in the error. | | 400 `invalid_otp` | Wrong Daviplata code | Ask the buyer for the code again while the payment is pending. | | 503 `method_unavailable` | The channel or rate is not available right now | Offer another currency and retry later. | | `failed` with `expired` or `rejected` | The buyer did not approve in time, or declined | Start a new payment. | | COP not shown at checkout | Total under the minimum, no fresh rate, a split session, or turned off | See /playbook-payment-methods. | Fees: /pricing. Related: /cop · /recipe-cop · /playbook-convert-to-usdt --- # Convert bolívares or pesos to USDT > Turn VES or COP in your balance into USDT at a quoted rate, from the portal or the API, and optionally convert a share of every peso payment automatically. Human docs: /playbook-convert-to-usdt ## What you will do You ask for a quote, accept it within 60 seconds, and the source amount leaves your VES or COP balance. The USDT is credited to your USDT balance when the conversion completes. The rate already includes the price — there is no separate conversion fee. - USDT enabled on your account (and COP, to convert pesos). - A VES or COP balance to convert. - A webhook endpoint subscribed to `conversion.created`, `conversion.completed` and `conversion.canceled`. ## Steps: in the portal 1. **Open the right card** — Bolívares: **Portal → USDT**, "Convert VES → USDT". Pesos: **Portal → COP**, "Convert COP → USDT". 2. **Get a quote** — Choose to spend an amount or to receive an amount of USDT, enter it, and click **Get quote**. 3. **Confirm in time** — Check the rate and both amounts, then click **Confirm conversion** before the 60-second countdown ends (or **Refresh quote**). ## Steps: with the API 1. **Check your settings** — `GET /v1/conversions/settings` shows whether conversions are enabled, your spread per currency, your minimum in USDT, any daily cap, and auto-convert. 2. **Request a quote** — `POST /v1/conversions/quotes` with `sourceCurrency` (`VES` by default, or `COP`) and exactly one amount: `sourceAmount` or `targetAmountUsdt`. 3. **Accept it** — `POST /v1/conversions` with `quoteId` (and an `Idempotency-Key` header) within 60 seconds. The quote can be used once. 4. **Wait for completion** — In Test it completes in the same request. On Live it can stay `PENDING` while VEX Pay delivers the USDT, normally the same business day (one accepted outside business hours or on a weekend completes the next business day) — react to `conversion.completed`, do not block on the request. While pending you can cancel it with `POST /v1/conversions/:id/cancel` and get the full source amount back. ### curl ```bash curl --request POST "${API_URL}/v1/conversions/quotes" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "sourceCurrency": "VES", "targetAmountUsdt": 100 }' curl --request POST "${API_URL}/v1/conversions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --header "Idempotency-Key: conv-2026-11-01" \ --data '{ "quoteId": "QUOTE_ID", "reference": "treasury-nov" }' ``` ## Convert a share of every peso payment Set a whole percent from 0 (off) to 100 in **Portal → COP → "Auto-convert COP payments"**, or with `PATCH /v1/conversions/settings` and `{"autoConvert":{"COP":{"percent":50}}}`. It applies to peso payments completed after the change, and sends `conversion.created` with `origin: "auto"` after the `payment.completed`. A share below your minimum is skipped and stays in COP. ## Check that it worked - `GET /v1/conversions/:id` shows `COMPLETED` with `targetAmountUsdt`. - `GET /v1/crypto/balance` shows the USDT. The USDT is available at once. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 403 `conversions_not_enabled` | Conversions, USDT or (for pesos) COP not enabled | Ask VEX Pay. | | 410 `quote_expired` | More than 60 seconds passed | Request a new quote. | | 409 `quote_used` | The quote was already accepted | Read the existing conversion, or request a new quote. | | 422 `amount_below_minimum` | Under your minimum in USDT | Convert more (see your settings). | | 422 `insufficient_balance` | More than your VES or COP balance | Lower the amount; check `GET /v1/balance` or `GET /v1/cop/balance`. | | 422 `daily_limit_exceeded` | Your daily cap is reached | Wait for the next day, or ask VEX Pay. | | 503 `rate_unavailable` | No fresh market rate | Retry in a few minutes. | Related: /convert-usdt · /onward-usdt · /recipe-bs-to-usdt --- # Read your balance and holds > Find out how much you can withdraw right now in each currency, what is awaiting bank confirmation, how automatic settlement works, and how to reconcile your books with the movements list. Human docs: /playbook-balance ## What you will do Each currency (bolívares, USDT, USDC, pesos) has its own balance. Live bolívar payments wait for the bank to **confirm** them, then become **available** on their own — no action needed and no webhook when it happens. USDT and pesos are available at once. Only available money can be withdrawn, and in live mode available bolívares are settled to your verified payout account automatically as soon as the bank confirms them. ## Steps 1. **Read the bolívar balance** — `GET /v1/balance`. `availableVes` is what you can withdraw now; `unconfirmedVes` is waiting for the bank; `heldVes` and `nextReleaseAt` apply only if your account has a hold; `reserveVes` is a buffer VEX Pay may set for your account; `settlement` says whether automatic settlement is on. 2. **Read stablecoins and pesos** — `GET /v1/crypto/balances` (or `GET /v1/crypto/balance?currency=USDC`) returns `available`, `held`, `nextReleaseAt` and `pendingPayout` per coin. `GET /v1/cop/balance` returns `availableCop`, `heldCop`, `nextReleaseAt` and `pendingPayoutCop`. 3. **Marketplaces: read seller balances** — `GET /v1/merchants/:id/balance` returns the seller's `pendingVes` and `availableVes` (plus a `cop` block when they have peso activity). Platform totals are on `GET /v1/balance`. 4. **Reconcile bolívares** — Page through `GET /v1/balance/transactions` (`limit` up to 100, `cursor` from `nextCursor`). Each movement has a stable `id`, a signed `amountVes`, and `availableAt` while it is held. Automatic settlements are payouts with an `externalRef` starting with `auto_settle_`. Filter by `type`, `paymentId`, `payoutId`, `from` and `to`. ### Balances ```bash curl "${API_URL}/v1/balance" --header "x-api-key: ${VEXPAY_API_KEY}" curl "${API_URL}/v1/crypto/balances" --header "x-api-key: ${VEXPAY_API_KEY}" curl "${API_URL}/v1/cop/balance" --header "x-api-key: ${VEXPAY_API_KEY}" ``` ### Movements ```bash curl "${API_URL}/v1/balance/transactions?limit=100&from=2026-11-01T00:00:00Z" \ --header "x-api-key: ${VEXPAY_API_KEY}" # Repeat with &cursor= until nextCursor is null. ``` ## Check that it worked Your books match when, over all pages, the sum of `amountVes` equals `ledgerNetVes`, and `ledgerNetVes − reserveVes − heldVes − unconfirmedVes` equals `availableVes`. The portal shows the same figures in **Overview**, **Payouts**, **Balance movements**, **USDT** and **COP**. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | Money shows but cannot be withdrawn | The bank has not confirmed the payment yet (`unconfirmedVes`) | Withdraw the available part now; the rest follows once the bank confirms it. | | Automatic settlement does not run | No verified payout account, the account changed less than 1 business day ago, or the amount is below the minimum | Read `settlement.status` on `GET /v1/balance`. | | `availableVes` is negative | A card chargeback was larger than your available balance | New payments refill it; payouts and conversions wait until then. | | Your books do not match | A movement was missed (chargeback, reversal, adjustment) | Page through the movements and match each by `id`. | | 403 `method_not_allowed` on USDC or COP balance | That currency is not enabled for you | Ask VEX Pay. | Related: /balances · /reconcile · /playbook-withdraw --- # Withdraw your balance > Send available bolívares to your own verified Pago Móvil or checking account, or USDT and USDC to a wallet — from the portal or the API — and follow each payout to the end. Human docs: /playbook-withdraw ## What you will do Only the **available** part of a balance can leave. Live bolívar payments are available once the bank confirms them (see /playbook-balance). Each destination is verified once before the first withdrawal. - Bolívares: your own Pago Móvil (cédula/RIF, phone, bank) or, without Pago Móvil, a checking account (20-digit account number, cédula/RIF, holder name). - USDT/USDC: a wallet your business controls, and business verification approved on Live. ## Steps: bolívares to your Pago Móvil or checking account 1. **Save your payout account** — **Portal → Payouts → Destinations**, or `PUT /v1/tenant/payout-account`. You have one bolívar destination: a Pago Móvil (`type: "pago_movil"`, the default, with `banco`, `cedula`, `telefono`) or a checking account (`type: "bank_account"` with `cuenta`, `cedula`, `titular`). For a checking account the bank comes from the first 4 digits of `cuenta`; a `banco` that does not match them answers 422 `invalid_data`. 2. **Verify it** — Start verification (`POST /v1/tenant/payout-account/verify/start`), read the two small deposits on your statement, and confirm them within 2 days (`POST /v1/tenant/payout-account/verify` with `amount1` and `amount2`). The deposits go to the phone or the account you saved. Switching between Pago Móvil and a checking account, or changing the account number, cédula/RIF or holder, is a destination change: verify again, then it waits 1 business day before it can be used. 3. **Withdraw** — **Portal → Payouts → Withdraw → Bs**, or `POST /v1/payouts/instant` with `monto` (taken from your available balance), `concepto` and a unique `externalRef`. The response shows the fee and the net your bank receives. The same fee, hold and limits apply to both destination types. 4. **Follow it** — Wait for `payout.completed` or `payout.failed`, or read `GET /v1/payouts/by-ref/:externalRef`. The webhook `channel` is `PAGO_MOVIL` or `BANK_ACCOUNT`; a checking-account payout also carries the masked `destination` (`••••6789`). ### Pago Móvil ```bash curl --request PUT "${API_URL}/v1/tenant/payout-account" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "banco": "0102", "cedula": "J412345678", "telefono": "04141234567" }' ``` ### Checking account ```bash curl --request PUT "${API_URL}/v1/tenant/payout-account" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "type": "bank_account", "cuenta": "01020123450123456789", "cedula": "J412345678", "titular": "Mi Empresa C.A." }' ``` ### Withdraw ```bash curl --request POST "${API_URL}/v1/payouts/instant" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "monto": "5000.00", "concepto": "Weekly withdrawal", "externalRef": "wd-2026-w44" }' ``` | Field | Pago Móvil | Checking account | | --- | --- | --- | | type | `pago_movil` (default) | `bank_account` | | banco | Required (from GET /v1/banks) | Optional; must match the first 4 digits of `cuenta` | | cedula | Required | Required (the account holder) | | telefono | Required | — | | cuenta | — | Required, exactly 20 digits | | titular | — | Required, 1–80 characters | | GET shows | Phone `…4567` | Account `••••6789` and `holderName` | ## Steps: USDT or USDC to a wallet 1. **Portal: save your payout wallet** — **Portal → Payouts → Destinations → USDT payout wallet**: network, address, tag if the network needs one, and a label. Confirm the wallet belongs to your business. It can be used 24 hours after you save or change it. 2. **Portal: withdraw** — **Portal → Payouts → Withdraw → USDT**, enter the amount, check "Network fee" and "Wallet receives", and confirm. Larger amounts wait for a VEX Pay review. 3. **API: check the network** — `GET /v1/crypto/networks?currency=USDT&amount=…` returns the payout fee, the minimum, and whether that amount can be sent now on each network. 4. **API: send** — `POST /v1/crypto/payouts` with `network`, `address`, `tag` if needed, `amount`, optional `currency` and an `idempotencyKey`. Amount plus fee are taken from that coin's available balance. ### curl ```bash curl --request POST "${API_URL}/v1/crypto/payouts" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "currency": "USDT", "network": "TRC20", "address": "TXYZ...", "amount": "250.00", "idempotencyKey": "usdt-wd-0042" }' ``` > **NOTE: Colombian pesos** > > There is no self-service peso withdrawal. Contact VEX Pay to withdraw your COP balance; you receive `payout.completed` or `payout.failed` with `currency: "COP"`. ## Check that it worked - `payout.completed` arrived (stablecoins include the `txHash`). - The money shows in your bank or wallet, and the payout appears in **Portal → Payouts → History** (every currency in one list). - If a payout fails, the amount and its fee return to your available balance at once. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 422 `insufficient_balance` with `unconfirmedVes` (or `heldVes`/`heldUsdt`) | Part of the money awaits bank confirmation (or a hold) | Withdraw the available amount now and the rest once it clears. Do not retry in a loop. | | 422 `payout_account_not_verified` or `payout_account_cooling` | Account not verified, or changed less than 1 business day ago | Finish verification, or wait for `payoutEligibleAt`. | | Status `awaiting_approval` | In its first 30 days an account can pay out up to USD 300 in any rolling 24 hours (unless VEX Pay set a different limit for you); this payout went over it | No action needed; VEX Pay reviews it and sends it or returns the funds. | | Bolívar payout stays `pending` | The bank has not answered yet | Do not create another payout. Wait for `payout.completed` or `payout.failed`. | | 422 `destination_cooling` / `destination_under_review` / `destination_blocked` | Wallet safety checks | Wait for the 24 hours to pass, or contact VEX Pay. | | 403 `kyb_not_approved` | Business verification not approved (Live) | Finish business verification. | | 422 `network_unavailable` or `amount_below_minimum` | The network cannot send that amount now, or it is under the minimum | Try another network or a larger amount. | | 409 `external_ref_conflict` / `idempotency_key_reused` | The same reference was reused with different data | Use a new reference for a new payout. | Fees: /pricing. Related: /balances · /merchants-payouts · /usdt --- # Refund a payment or handle a chargeback > What you can refund on each method, how to reverse a Débito Inmediato (C2P) payment or refund a peso payment, and how card chargebacks hit your balance and get closed. Human docs: /playbook-refunds ## What you can refund | Method | Can you refund it? | How | | --- | --- | --- | | Débito Inmediato (C2P) | Yes, in full | `POST /v1/payments/:id/reverse` | | Colombian pesos | Yes, in full, within 96 hours of completion | `POST /v1/cop/payments/:id/refund` | | USDT / USDC | No refund API | Send the buyer a normal stablecoin payout with `POST /v1/crypto/payouts` (payout fee applies) | | Card | No refund API | Only bank chargebacks, which VEX Pay records | | Pago Móvil, débito inmediato (OTP) | No refund API | — | Partial refunds are not supported. Subscribe your webhook endpoint to `payment.reversed`, `payment.chargeback` and `payment.chargeback_closed`. ## Steps: reverse a Débito Inmediato (C2P) payment 1. **Check the payment** — `GET /v1/payments/:id` must show a `COMPLETED` C2P payment that was not reversed before. 2. **Reverse it** — `POST /v1/payments/:id/reverse` (up to 5 per hour). If the bank refuses, you get a 400 with its message and nothing changes. 3. **Confirm** — The payment becomes `REVERSED` and `payment.reversed` arrives with `reversalType: "reversal"`. The full amount leaves your balance and the VEX Pay fee is returned. On a split payment, the seller's share is undone too. ### curl ```bash curl --request POST "${API_URL}/v1/payments/PAYMENT_ID/reverse" \ --header "x-api-key: ${VEXPAY_API_KEY}" ``` ## Steps: refund a peso payment 1. **Keep enough pesos** — Your COP balance (available plus held) must cover the net that was credited. Pesos you already converted or withdrew do not count. 2. **Refund it** — `POST /v1/cop/payments/:id/refund` within 96 hours of completion. 3. **Confirm** — The payment shows `refunded` and `payment.reversed` arrives with `status: "refunded"`. The COP fee is returned. ## What happens on a card chargeback 1. **The buyer disputes the charge** — VEX Pay records the chargeback on the payment and debits your bolívar balance (the original card fee is not returned). If the bank charges a chargeback fee, VEX Pay passes on exactly that amount as a separate movement (`feeVes`, often 0), with nothing added. You receive `payment.chargeback`; a full chargeback also sends `payment.reversed` with `reversalType: "chargeback"`. 2. **Book it** — `GET /v1/payments/:id` lists `chargebacks[]`, and the movements appear in `GET /v1/balance/transactions?paymentId=…`. Book each one once using the `ledgerEntryIds` in the webhook. 3. **VEX Pay disputes it** — When it is decided you receive `payment.chargeback_closed` with `outcome`. **Won**: the amount and any chargeback fee come back and the payment returns to `COMPLETED`. **Lost**: nothing further moves. > **WARNING: A chargeback can make your balance negative** > > While `availableVes` is below zero, payouts and conversions are refused. New payments refill it. A chargeback debits your balance, not the seller's: on a marketplace you recover it from your seller yourself, for example by deducting it from what you pay them next. ## Check that it worked - In Test, pay with the card `4000000000000259`: about a minute later a test chargeback arrives with `livemode: false`. - The reversal, refund or chargeback appears in **Portal → Balance movements** and the payment shows its new status in **Payments**. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 400 "Reversal is not supported for method: …" | Only C2P payments can be reversed | See the table at the top. | | 400 "Only COMPLETED payments can be reversed" | Wrong status, or already reversed | Check `GET /v1/payments/:id`. | | 400 with a bank message | The bank refused the reversal | Contact VEX Pay; the payment stays `COMPLETED`. | | 409 `onward_payout_in_progress` | The payment was already converted and sent on as USDT | Contact VEX Pay. | | 429 on reverse | More than 5 reversals in an hour | Retry later. | | 409 `refund_window_expired` | More than 96 hours since the peso payment completed | No API refund is possible; contact VEX Pay support. | | 409 `insufficient_balance` on a peso refund | Your COP balance does not cover it | Keep enough COP, then retry. | Related: /payments · /reconcile · /cop · /vpos --- # Onboard a seller and verify their payout account > For marketplaces: register a seller, confirm their Pago Móvil destination with two micro-deposits, and set their commission so you can split payments and pay them out. Human docs: /playbook-onboard-seller ## What you will do A seller is someone your marketplace collects for. In the API a seller is a `merchant` (`/v1/merchants`). Before you can pay a seller, their Pago Móvil destination must be verified with two small deposits that the seller reads from their bank. - A **marketplace** account (VEX Pay sets the business model; see /business-models). - The seller's name, cédula or RIF, contact email and phone, and the bank and phone of their Pago Móvil. - A webhook endpoint subscribed to `merchant.verified` and `merchant.rejected`. ## Steps 1. **Register the seller** — `POST /v1/merchants` with your own seller id as `externalRef` (unique, and the idempotency key), `name`, `identification` (`V`/`E` + 8 digits or `J`/`G` + 9 digits), `contactEmail`, `contactPhone`, and `bankCode` (4 digits) + `phone` (11-digit local mobile, for example `04121234567`) for their first payout method. Optionally add `applicationFeePercent` (their commission) and `autoPayoutEnabled`. 2. **Start verification** — `POST /v1/merchants/:id/payout-methods/:methodId/verify/start`. VEX Pay sends two deposits of a few céntimos to the seller's Pago Móvil. 3. **The seller reads the two amounts** — Ask the seller for both amounts from their bank statement. They have 2 days. 4. **Confirm the amounts** — `POST /v1/merchants/:id/payout-methods/:methodId/verify` with `amount1` and `amount2`. You have 3 attempts. 5. **Set the commission (optional)** — Per seller with `PATCH /v1/merchants/:id` or the Commission column in **Portal → Merchants**, or a default for everyone in **Portal → Merchants → Default commission**. ### Register ```bash curl --request POST "${API_URL}/v1/merchants" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "externalRef": "seller-881", "name": "Panadería La Esquina", "identification": "J123456789", "contactEmail": "ventas@laesquina.example", "contactPhone": "04121234567", "bankCode": "0102", "phone": "04121234567", "applicationFeePercent": 5 }' ``` ### Confirm micro-deposits ```bash curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/payout-methods/METHOD_ID/verify" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amount1": "0.37", "amount2": "0.82" }' ``` > **NOTE: Micro-deposits in Test** > > In Test nothing is sent: the micro-deposits run on the sandbox and the start response returns `testAmounts`, the two amounts to confirm. In Live they are a few real céntimos (under Bs 0.50 in total) sent to the seller’s Pago Móvil. ## Check that it worked - You received `merchant.verified` for the seller. - `GET /v1/merchants/:id/payout-methods` shows the method as `verified`. - The seller appears as active in **Portal → Merchants** with the commission you set. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 422 `merchant_identification_missing` | No cédula/RIF on file for the seller | Add `identification` with `PATCH /v1/merchants/:id`. | | 422 `credit_rejected` or `merchant.rejected` | The bank rejected the destination (bank, phone or cédula do not match) | Check the details with the seller and add a corrected method. | | `amounts_mismatch` with `attemptsLeft` | Wrong amounts | Re-read the statement. After 3 failures the method is locked for 24 hours. | | 410 `window_expired` | Not confirmed within 2 days | Start verification again. | | 409 `external_ref_conflict` | Same `externalRef` sent with different data | Use the existing seller (`GET /v1/merchants?externalRef=…`) or a new id. | Next: /playbook-split-payments. Related: /merchants-payouts · /marketplace-settlement --- # Split a payment between your marketplace and a seller > Create a checkout session with `merchantId` and `applicationFeePercent`: you keep your commission, the seller's share lands in their balance, and you pay them out once it is released. Human docs: /playbook-split-payments ## What you will do Tag a checkout with a seller and VEX Pay splits it when it is paid: your commission stays in your balance and the seller's share goes to the seller's own balance, ready to pay out after the seller hold. - A marketplace account with bolívar methods enabled (split checkouts take card, Débito Inmediato and Pago Móvil only). - An active seller with a verified payout method (see /playbook-onboard-seller). ## Steps 1. **Create a split checkout session** — `POST /v1/checkout/sessions` with `amountUsd`, `merchantId` (the seller) and optionally `applicationFeePercent` (0–100, up to 4 decimals). Without it, VEX Pay uses the seller's commission, then your default commission, then none. 2. **Send the buyer the url** — The checkout shows the seller's name, because the buyer is paying the seller. 3. **VEX Pay splits on completion** — When the payment completes, your commission stays in your balance and the seller net goes to the seller's **pending** balance. You receive `payment.completed` and `merchant.balance.updated`. 4. **Wait for the release** — The seller's pending money becomes available after the seller hold. 5. **Pay the seller** — `POST /v1/payouts` with `merchantId`, the exact bolívar `monto`, `concepto`, a unique `externalRef` and `fromMerchantBalance: true`. Or turn on `autoPayoutEnabled` for the seller. ### Split checkout ```bash curl --request POST "${API_URL}/v1/checkout/sessions" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": 40.00, "description": "Order #7781", "reference": "order-7781", "merchantId": "MERCHANT_ID", "applicationFeePercent": 5 }' ``` ### Pay the seller ```bash curl --request POST "${API_URL}/v1/payouts" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "merchantId": "MERCHANT_ID", "monto": "1200.00", "concepto": "Sales week 44", "externalRef": "seller-881-w44", "fromMerchantBalance": true }' ``` > **WARNING: The VEX Pay fee comes out of the seller's share** > > Seller net = amount − VEX Pay fee − your commission. Your commission is exactly the percentage you set of the gross amount. Tell sellers their net with the fee included. Your rates are in **Portal → Rates** and at /pricing. ## Check that it worked - `GET /v1/checkout/sessions/:id` shows `status: "paid"` and echoes `merchantId` and `applicationFeePercent`. - `GET /v1/merchants/:id/balance` shows the seller net in `pendingVes`, later in `availableVes`. - After the payout, `payout.completed` arrives and the seller's available balance goes down by `monto`. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 400 on a session with `usdt`, `usdc` or `cop` and `merchantId` | Split checkouts take bolívar methods only | Drop those methods, or remove `merchantId`. | | 400 "merchantId is required when setting an application fee" | Commission sent without a seller | Add `merchantId`. | | 400 `merchantId not found or inactive for this tenant` | Wrong id, another account's seller, or a deactivated seller | Check `GET /v1/merchants/:id`; reactivate with `PATCH /v1/merchants/:id`. | | Seller balance not credited | No `merchantId` on the payment, or fee + commission ≥ amount | Check the payment; lower the commission. | | 422 `insufficient_merchant_balance` on payout | Seller money still pending, or already paid out | Wait for the release; check `GET /v1/merchants/:id/balance`. | | Payout status `awaiting_approval` | In its first 30 days an account can pay out up to USD 300 in any rolling 24 hours (unless VEX Pay set a different limit for you); this payout went over it | No action needed; VEX Pay reviews it and sends it or returns the funds. | Related: /marketplace-settlement · /recipe-marketplace · /merchants-payouts --- # Disbursements: pay your end users from your sales > Credit each of your end users (staff, contractors, affiliates) in dollars at the BCV rate out of the money you collect, let them withdraw to their own Pago Móvil, and download a monthly statement per person. Human docs: /playbook-disbursements ## What you will do Your sales land in your VEX Pay balance. Each pay period you credit every end user an amount in dollars; VEX Pay converts it at the official BCV rate and keeps it in that person's balance. Each person then withdraws to their own Pago Móvil when they want, through your own system. You pay the withdrawal fee, not them. Each end user is a `merchant` in the API. - Disbursements turned on for your account. Ask VEX Pay; it works in Test mode right away and in Live after go-live approval. - Your server holds your API key. Your end users never sign in to VEX Pay: your admin system calls the API for them. - Each end user registered with a verified Pago Móvil (see /playbook-onboard-seller). ## Steps 1. **Collect** — Sell with payment links, checkout sessions or charges as usual. Each bolívar sale is available in your balance once the bank confirms it (`unconfirmedVes` until then). 2. **Register your end users** — `POST /v1/merchants` once per person, then add and verify their Pago Móvil payout method. Keep the returned `merchantId` in your system next to the person. 3. **Credit each person in dollars** — `POST /v1/merchants/:id/transfers` with `amountUsd` and a `transferKey` that is unique per person and pay period (for example `2026-11-q1-emp-104`). The response shows `amountVes`, the `rate` and `rateAsOf`. Sending the same `transferKey` again returns the first result, never a second credit at a new rate. 4. **The person withdraws** — When the person asks for a withdrawal in your system, call `POST /v1/payouts` with their `merchantId`, the bolívar `monto`, `concepto`, a unique `externalRef` and `fromMerchantBalance: true`. They receive the full `monto`; the withdrawal fee is charged to your balance. 5. **Download the month** — `GET /v1/merchants/:id/statement?month=2026-11` (add `&format=csv` for a file), or **Portal → Merchants → Monthly statement** for one person or everyone in one CSV. ### Credit $100 at BCV ```bash curl --request POST "${API_URL}/v1/merchants/MERCHANT_ID/transfers" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountUsd": "100.00", "transferKey": "2026-11-q1-emp-104" }' # → { "pendingVes": "...", "availableVes": "...", # "transfer": { "amountVes": "21540.00", "amountUsd": "100.00", "rate": "215.4000", "rateSource": "bcv", ... } } ``` ### Withdrawal ```bash curl --request POST "${API_URL}/v1/payouts" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "merchantId": "MERCHANT_ID", "monto": "20000.00", "concepto": "Retiro", "externalRef": "wd-emp-104-0001", "fromMerchantBalance": true }' ``` ### Monthly statement (CSV) ```bash curl "${API_URL}/v1/merchants/MERCHANT_ID/statement?month=2026-11&format=csv" \ --header "x-api-key: ${VEXPAY_API_KEY}" --output emp-104-2026-11.csv ``` ## When the money can be withdrawn A credit paid with money that is already available in your balance can be withdrawn at once. A credit paid with sales the bank has not confirmed yet sits in the person's `pendingVes` and moves to `availableVes` when they are confirmed. Crediting after the sales are confirmed avoids the wait. > **NOTE: Withdrawals in the first 30 days** > > In its first 30 days an account can pay out up to USD 300 in any rolling 24 hours, unless VEX Pay set a different limit for you. A withdrawal over it shows `awaiting_approval` until VEX Pay reviews it. Tell us your expected payroll before you start so the limit fits it. ## The withdrawal fee Each withdrawal costs a percentage of `monto` with a minimum in dollars, plus a fixed part in dollars; the dollar parts convert at the BCV rate of that moment. VEX Pay agrees the price with you before you go live. | Example: 1% (min $0.25) + $0.25, BCV 215.40 | Fee | | --- | --- | | Withdrawal of Bs 20,000.00 | Bs 200.00 + Bs 53.85 = **Bs 253.85** | | Withdrawal of Bs 2,000.00 | Bs 53.85 (minimum) + Bs 53.85 = **Bs 107.70** | - The payout shows `feeVes` and `feePayer: "tenant"`; the person was debited only `monto`. - Your balance shows a `disbursement_payout_fee` movement. If the bank rejects the withdrawal, `monto` goes back to the person and the fee back to you (`disbursement_payout_fee_reversal`). - Keep a small reserve in your balance: if it cannot cover the fee, the withdrawal is refused with 422 `insufficient_balance` and `reason: "tenant_fee_unfunded"`. ## Add money that is not a sale (top-ups) When the money you pay out comes from outside your sales (for example advertising income), load it into your balance with a top-up: you send a Pago Móvil to VEX Pay and it is credited to your balance. Top-ups are turned on by VEX Pay, with a monthly limit agreed with you. A top-up is not a sale: it fires no `payment.completed` webhook and does not count as sales volume. 1. **Start the top-up** — `POST /v1/balance/topups` with `amountVes`, the `payerPhone` and `payerCedula` you will pay from, and a `sourceNote` saying where the money comes from (at least 10 characters). Or use **Portal → Balance movements → Load balance**. 2. **Send the Pago Móvil** — Send exactly `amountVes` from that phone to the `receiver` in the response (bank code, phone, ID) within 15 minutes. Pick the bank by its code in your bank app. 3. **It completes on its own** — `GET /v1/balance/topups/:id` moves to `completed` when the transfer arrives. You are credited `creditedVes` = amount − fee. It follows your account's balance hold, if any (none by default). 4. **Optional: make it available now** — If your account has a hold, `POST /v1/balance/topups/:id/instant` releases the held part at once for `instantFeePercent` of it (`instantFeeVes`). Calling it again charges nothing more. ### Start a top-up ```bash curl --request POST "${API_URL}/v1/balance/topups" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "amountVes": "100000.00", "payerPhone": "04121234567", "payerCedula": "V12345678", "sourceNote": "Advertising income, second half of November" }' # → { "id": "...", "status": "pending", "amountVes": "100000.00", "expiresAt": "...", # "receiver": { "bankCode": "...", "phone": "...", "identification": "..." } } ``` | Example: fee 3.5% + $0.25, instant 1.5%, BCV 200 | Bs | | --- | --- | | Top-up | 100,000.00 | | Fee (3,500.00 + 50.00) | − 3,550.00 | | Credited (held if your account has a hold) | **96,450.00** | | Instant fee to release it now (1.5%) | − 1,446.75 | | Available at once | **95,003.25** | - Each top-up counts against your monthly limit (Venezuela calendar month, in dollars at BCV, pending and completed). Over it: 422 `topup_cap_exceeded` with `remainingUsd` and `remainingVes`. - Banks limit each Pago Móvil and each day: load a large amount in several top-ups. - Your balance shows `topup`, `topup_fee`, `topup_instant_release` and `topup_instant_fee` movements. - A transfer that arrives after the 15 minutes is not credited on its own: contact VEX Pay with the reference. ## Check that it worked - `GET /v1/merchants/:id/balance` shows the credit in `pendingVes` or `availableVes`. - `GET /v1/merchants/:id/transactions` lists credits (with `amountUsd` and `rate`), releases and withdrawals, newest first. - In the statement, opening + the sum of `amountVes` = closing. A `release` row moves money from pending to available, so its `amountVes` is 0.00. ## Leftovers and chargebacks - Money you credit belongs to the person until they withdraw it; VEX Pay does not take it back on its own. Credit only what you owe. - Months are in Venezuela time (America/Caracas). - A refund or card chargeback on one of your sales is taken from your balance, even if you already credited that money to your end users. Recovering it from them is up to you. ## If something goes wrong | Symptom | Likely cause | What to do | | --- | --- | --- | | 422 `insufficient_balance` on a credit | Your balance cannot cover it | Check `GET /v1/balance`; wait for more sales. | | 503 `rate_unavailable` on a credit or withdrawal | The BCV rate could not be read just now; nothing was recorded | Retry in a minute with the same `transferKey` or `externalRef`. | | 422 `insufficient_merchant_balance` on a withdrawal | The credit is still pending (sales in hold), or the person has less available | Check `GET /v1/merchants/:id/balance`; wait for the release. | | 422 `insufficient_balance` with `reason: "tenant_fee_unfunded"` | Your balance cannot pay the withdrawal fee | Keep a reserve; retry with the same `externalRef`. | | Withdrawal `awaiting_approval` | Over the first-30-days payout limit | No action; VEX Pay reviews it. | | 403 `topups_not_enabled` | Top-ups are not on for your account | Ask VEX Pay to turn them on. | | 422 `topup_cap_exceeded` | Over this month's top-up limit | Load at most `remainingVes`, or ask VEX Pay to review the limit. | | Top-up `expired` | The transfer did not arrive within 15 minutes | Start a new one; if you already sent it, contact VEX Pay with the reference. | Related: /recipe-disbursements · /playbook-onboard-seller · /merchants-payouts · /playbook-balance --- # Troubleshoot a Pago Móvil payment that is not found > The buyer says they paid but the checkout keeps waiting or verify returns not found: check the matching rules, use the reference fallback, retry safely, and know when to contact support. Human docs: /playbook-pago-movil-not-found ## What you will do A Pago Móvil is sent by the buyer from their own bank app, so VEX Pay has to find it. Work out which case you are in, then follow the matching steps. | You see | Go to | | --- | --- | | The hosted checkout keeps waiting after the buyer paid | Hosted checkout | | `POST /v1/payments/pago-movil/verify` returns 400 `MOVEMENT_NOT_FOUND` or `AMOUNT_MISMATCH` | API verify | | The payment shows `FAILED` with `expired` | Expired payments | ## Hosted checkout VEX Pay completes the payment automatically when the transfer matches on **all three**: the phone the buyer entered, the amount shown (within Bs 0.02), and the time (from 2 minutes before the buyer started until the 15-minute expiry). 1. **Ask how the buyer paid** — From another phone? A different amount? Two open payments on different links? Any of these stops the automatic match. 2. **Use the reference fallback** — After 5 minutes without a match, the checkout lets the buyer pick the bank they paid from and type the bank reference. It is found when the last 6 digits and the amount match, the transfer came from that bank, was received in the last 7 days, and was not claimed before. 3. **Check the messages** — "Aún no hemos recibido…": wait a moment and check the number. "salió de otro banco": pick the bank the transfer was sent from. An amount message: the buyer did not pay the exact amount — contact VEX Pay support with the reference. ## API verify 1. **Retry with backoff** — The bank's notice can lag a few seconds behind a real transfer. Retry every 3–5 seconds for 60–90 seconds with the same `reference`; retries reuse the same payment. 2. **Check the reference** — 4–32 digits. Send it as the receipt shows it, or at least the last 6 digits. 3. **Send the optional fields you have** — `debtorBankCode` (the payer's bank) and `debtorCellPhone` are required by some receiving banks. Send them when you have them, and `dateMovement` (`YYYY-MM-DD`) when the transfer is not from today. 4. **Check the amount** — `AMOUNT_MISMATCH` returns what was expected and what was received. The expected bolívares are your `usdAmount` at your Bolívar rate. Fix `usdAmount` or ask the buyer to complete the amount; the transfer stays claimable. 5. **Check where the buyer paid** — The buyer must pay the account returned by `GET /v1/payments/pago-movil/receiving-account` — never a hard-coded one. 6. **Do not verify twice** — After a 200, re-check with `GET /v1/payments/by-ref/:externalRef` instead of calling verify again. ### curl ```bash curl --request POST "${API_URL}/v1/payments/pago-movil/verify" \ --header "content-type: application/json" \ --header "x-api-key: ${VEXPAY_API_KEY}" \ --data '{ "usdAmount": 20.00, "reference": "00123456", "debtorBankCode": "0102", "debtorCellPhone": "584121234567", "txType": "pago_movil", "externalRef": "order-2051" }' ``` > **NOTE: If the buyer sent more** > > The payment completes for the bolívares actually received. Read `vesAmount` and `usdAmount` from the receipt, not from your request. ## Expired payments A hosted Pago Móvil that is not matched within 15 minutes becomes `FAILED` with `expired`, and `payment.failed` fires. A transfer that arrives later is **not** credited automatically. Contact VEX Pay support with the bank reference, the amount and the date. ## Check that it worked - `GET /v1/payments/:id` shows `COMPLETED` with the bank reference, and `payment.completed` arrived. - In Test, real transfers never match: use **Simular pago recibido** on the checkout, or a Test key for verify. ## Other causes | Symptom | Likely cause | What to do | | --- | --- | --- | | Pago Móvil not offered, or `receiving_account_not_configured` | The receiving account is not complete for your account | Contact VEX Pay. | | 400 "no enabled provider supports Pago Móvil" | Pago Móvil is not enabled for your account | Contact VEX Pay. | | Several transfers share the same last 6 digits | The match is ambiguous, so nothing is claimed | Send the full reference and `debtorBankCode`; contact VEX Pay support if it persists. | | `payment.reversed` with `bank_not_received` | VEX Pay found the money never arrived | Treat the order as unpaid. Contact VEX Pay support for details. | Related: /pago-movil · /playbook-pago-movil-link · /reconcile --- # VEX Pay terms of service > The terms on which Chu Capital, C.A. provides VEX Pay to the businesses that collect and pay with it. Human docs: /terms ## Who we are Last updated: November 14, 2026. The Spanish version prevails if the two differ. VEX Pay is a technology platform operated by **Chu Capital, C.A.** (RIF J-50832436-6), Caracas, Venezuela ("VEX Pay", "we"). These terms govern the use of VEX Pay by the company or person that opens an account (the "client"), including the portal, the API, the SDKs, the hosted checkout and payment links. > **NOTE: VEX Pay is not a bank** > > VEX Pay is not a bank or a financial institution, and holds no licence, registration or approval from any regulator to operate as one. Balances held in VEX Pay are not bank deposits and earn no interest. ## What VEX Pay does VEX Pay lets a business collect from its customers and pay others from one account: - **Bolívar collections:** Débito Inmediato (C2P), Pago Móvil verification and, when available, card payments (VPOS). - **Hosted checkout, payment links and subscriptions:** VEX Pay payment pages the client shares or embeds. - **Stablecoins (USDT and USDC):** deposit addresses, checkout, conversions from bolívares or pesos to USDT, and withdrawals to wallets. - **Colombian pesos (COP):** collections from Colombia through the channels the account offers. - **Balances and payouts:** the client's balance per currency, and payments to its bank account or to others (sellers, suppliers, staff). - **Webhooks, API and SDKs:** signed notices of every event and tools to integrate all of the above. - **Business verification (KYB):** review of the company or person before it operates in Live mode. Each account has only some methods enabled. What an account can use shows in the portal and in `GET /v1/payment-methods`. We may add, change or pause methods; we will say so in the docs or the portal. ## How the money moves 1. **Receipt** — Bolívar payments are received through partner banks into accounts operated by VEX Pay. Stablecoin and Colombian peso payments are received through payment processors. 2. **Credit to the balance** — Each completed payment is credited to the client's VEX Pay balance, in its currency, net of fees. 3. **Bank confirmation** — A bolívar payment becomes available for withdrawals and payouts when the bank confirms the money arrived. USDT bought with bolívares the bank has not confirmed yet stays on hold until that confirmation. Stablecoin and Colombian peso payments are available once credited. VEX Pay may also set a time-based hold for an account. 4. **Settlement** — The client withdraws its available balance to the bank account or wallet it chooses, or pays others with payouts. VEX Pay may send the available bolívar balance automatically to the client's verified payout account. We may apply withdrawal limits and review payouts before sending them, especially on new accounts. VEX Pay may also keep on hold a seller's money (see "Verification levels and limits"), or the money of a client's seller, that comes from a bolívar payment the bank has not confirmed yet, even after its hold period. That money cannot be withdrawn, paid out or converted until the bank confirms the payment. If the bank does not find the payment, VEX Pay reviews it and may reverse it. Reversals, refunds and chargebacks of a payment are taken from the client's balance, even if that money was already withdrawn. If the balance is not enough it goes negative, and new payments refill it before further withdrawals are allowed. ## Account, verification and test mode - Natural persons with a personal RIF (V, E or P) and companies with a J RIF may be clients. Government entities (G RIF) may not open an account. Each RIF may hold one seller account. - A natural person collects in their own name and is responsible for the sales they make with VEX Pay as a business is. If their business is registered as a firma personal, they may submit that registration in their verification. - At sign-up on the portal, the client declares that it sells lawful goods or services, that it meets its tax obligations (see "Taxes and invoicing") and that it is not a politically exposed person (PEP), or that it will say so in its verification. VEX Pay stores the declaration with its date, IP address and text version. - To operate in Live mode the client must complete KYB with true and complete information, give an owner contact and be approved by VEX Pay. We may ask for more information at any time. - When a KYB application is submitted, VEX Pay screens the business and the people listed in it against sanctions lists. - When a KYB application is submitted, VEX Pay reviews its documents automatically (presence, type, name, RIF and validity, including the RIF expiry date SENIAT reports). An application with clearly expired documents may be returned to the client automatically with a note saying what to upload; VEX Pay always decides the approval. - Test mode uses simulated data and moves no real money. Never send real money to the details it shows. - The client is responsible for everything done with its API keys and portal access. Keep keys on your server and rotate them if exposed. ## Verification levels and limits In this section and in "Taxes and invoicing", the "seller" is the client that collects its own sales with VEX Pay, on the portal or in the VEX Pay app. - Each seller has a verification level from 0 to 3, set by what it has verified: contact, identity, RIF, a payout account in its name, address, business details, sales history or online presence, and business registration. Its account shows the level, what is missing and its limits. - Each level has a monthly collection limit (calendar month, Caracas time) and a per-sale maximum, which the seller sees in its account. At level 0 no sales can be received in Live mode. VEX Pay refuses a sale that would pass a limit before starting it. - A payment the buyer has already sent is not refused when it passes the limit: it is credited, counts toward the month's usage, and VEX Pay may review it. - The level drops when a requirement stops being met, for example when a verification is revoked or the payout account is no longer in the seller's name. VEX Pay may set a different level or limits for a seller, with a recorded reason. - VEX Pay may show buyers that a seller is verified and its level, with the list of what was verified. It never shows the seller's documents, ID number or limits. ## Taxes and invoicing - The seller alone is responsible for the taxes on its sales. VEX Pay processes the payment, but it is not the seller and does not buy or resell its goods or services. - As applicable, the seller must: issue buyers the invoice, delivery note or other document SENIAT requires, in its own name and with its RIF; file and pay IVA (VAT) if it is an ordinary taxpayer; file and pay income tax (ISLR) on its income; pay the large financial transactions tax (IGTF) when it collects in foreign currency or crypto assets and the law requires it; hold its municipal business licence and pay its municipality's taxes; and keep the books and records the law requires and the receipts for its sales. - The amounts collected with VEX Pay are the seller's income. VEX Pay's fees are a cost to the seller. - VEX Pay does not issue invoices on the seller's behalf and does not withhold taxes from it, unless the law or SENIAT appoints it as a withholding or collection agent. In that case VEX Pay withholds what applies, pays it over and gives the seller the receipt. - VEX Pay may give the competent authorities information about a seller's sales when the law requires it. - The seller is liable to VEX Pay for any fine, tax or claim VEX Pay has to pay because of the seller's tax non-compliance. ## Fees The client pays the fees agreed for its account, shown in the portal. Without a specific agreement, the standard rates at /pricing apply. Fees are deducted from each payment or payout. We may change rates with prior notice by email or in the portal; changes do not affect completed operations. ## Client obligations - Comply with the laws that apply to it, including tax and consumer protection laws. - Deliver what it sells and serve its buyers: the sale is between the client and its buyer; VEX Pay is not a party to it. - Bear the reversals, refunds and chargebacks of its payments and their fees, including those of its sellers; recovering them from sellers is up to the client. - When it takes cards on its own form, meet the card data security requirements (PCI DSS) that apply to it. - Tell its buyers how their data is handled and have a basis to share it with VEX Pay. - Verify webhook signatures and tell us promptly about errors, payments it does not recognise or unauthorised access. - Keep its account and KYB information up to date. ## Acceptable use VEX Pay may not be used for: - Activities that are illegal where the client operates, money laundering or financing illicit activities. - Gambling, weapons, adult content or unlicensed financial services. - Fraud, testing stolen cards, charging without delivering, or charging on behalf of another business without our approval. - Sanctioned persons or entities, or evading sanctions. - Trying to access other clients' data, or overloading or attacking the platform. ## Suspension and closure We may limit payment methods, hold balances, pause payouts or suspend an account when there is reasonable suspicion of fraud, a sanctions list match, false or incomplete KYB information, a high chargeback risk, a breach of these terms, or an order from a competent authority. We will tell the client unless the law or an investigation prevents it. The client may close its account at any time by writing to support. When an account closes we pay the available balance to the account the client names, once pending reversals, chargebacks and fees are covered. ## Liability - VEX Pay relies on partner banks, processors, payment networks and blockchains it does not control. We are not liable for their outages, delays or declines, though we will work to resolve each case. - The service is provided "as is" and may be interrupted for maintenance or failures. - To the extent the law allows, VEX Pay is not liable for lost profits or indirect damages, and its total liability to a client is limited to the fees that client paid VEX Pay in the three months before the event giving rise to it. - None of this limits VEX Pay's obligation to pay the client its available balance. ## Data We handle the data of the client and its buyers as described in the /privacy. The client owns the data of its sales and can view it in the portal and through the API. ## Changes, governing law and contact - We may update these terms. We will publish the new version here with its date and announce material changes by email or in the portal. Continuing to use VEX Pay after the notice means accepting them. - These terms are governed by the laws of the Bolivarian Republic of Venezuela. Any dispute will be submitted to the courts of the city of Caracas. - Contact: soporte@vexwallet.co. Chu Capital, C.A., RIF J-50832436-6, Caracas, Venezuela. --- # VEX Pay privacy policy > What data VEX Pay handles about businesses, their buyers and visitors to its sites, why, who it is shared with and for how long. Human docs: /privacy ## Who handles your data Last updated: November 14, 2026. The Spanish version prevails if the two differ. VEX Pay is a technology platform operated by **Chu Capital, C.A.** (RIF J-50832436-6), Caracas, Venezuela. This policy explains what data we handle to provide VEX Pay. For buyers' data, the business collecting the payment decides what it uses it for; VEX Pay handles it to process their payments. ## What data we handle | About whom | Data | Why | | --- | --- | --- | | Businesses (clients) | Legal name, RIF or ID, address, activity, company documents, identity data and documents of owners and representatives (including a selfie when asked), owner email and phone, bank accounts and wallets for withdrawals | Open and verify the account (KYB), screen sanctions lists, reach the owner and pay withdrawals | | Portal and API users | Email, credentials, IP address, browser and API key usage | Give access, protect the account and detect misuse | | Buyers (bolívares) | Cédula or RIF, phone, bank, reference, amount and date; name and email when the business or checkout asks for them | Run or verify the payment (Débito Inmediato, Pago Móvil), reconcile it and issue receipts | | Buyers (bolívar cards, when available) | Number, expiry, code and PIN are sent to the bank to authorise and are not stored. We keep the last 4 digits, the BIN and an irreversible card fingerprint | Authorise the payment, price it and prevent fraud | | Buyers (Colombian pesos and stablecoins) | What each channel asks for (ID, phone, email); wallet addresses and transactions | Process and reconcile the payment | | Buyers who choose "remember my details" | Saved phone, cédula and bank, and the trusted device (30 days) | Prefill future payments after confirming a code sent by WhatsApp | | Sellers and payout recipients | Name, ID, bank account or Pago Móvil | Verify the destination and send the payment | | People who write to our WhatsApp support number | Message text (for a photo or a file, only its kind and the text sent with it), phone number and WhatsApp profile name; when the number matches a verified account, that account's status (for example its verification and level, whether its links are paused, whether its PIN is locked, and the status, method and date of its latest withdrawals and top-ups) | Answer their questions and prepare draft replies | | Visitors to our sites | Page views and aggregate technical data; portal session cookies | Keep you signed in and measure use of the docs | We handle this data to perform our contract with the client, meet legal obligations, prevent fraud and, for "remember my details", with the buyer's consent. ## Who we share it with - **The business collecting:** sees the data of the payments it receives. - **Partner banks and payment processors:** receive what they need to run, verify or refund each payment and payout. - **Service providers acting for us:** cloud hosting (Railway and Contabo), KYB document storage (Cloudflare R2), email delivery (Resend), WhatsApp messaging for verification codes and our internal communication tools (Slack). They use the data only to provide that service to us. - **KYB document photo reading (xAI):** when a RIF certificate or a proof of address is uploaded as a photo, we may send only the image of that document to xAI (Grok model) to read the holder name, the document date and the kind of document. xAI receives no other data about the client or its people, and we keep only what was read. The result helps the automatic KYB review; it never decides a return or an approval on its own. - **WhatsApp support draft replies (xAI):** when someone writes to our WhatsApp support number, we send xAI (Grok model) the text of that chat's recent messages (for a photo or a file, only the text sent with it), the approved answers from our FAQ and, when their number matches a verified account, that account's status, to prepare a draft reply. From the account records, xAI does not receive their name, phone number, balances, amounts, account numbers, documents or card data. But message text is sent as written: if the person or our team types a name, a phone number, an amount or an account number in the chat, that data reaches xAI. We also send it the full text of past conversations our team answered, to turn those answers into general FAQ entries; we remove personal data from what we keep of them and approve it before using it. A person on our team reviews each draft before it is sent. We never ask for passwords, codes, PINs or card data on WhatsApp; we ask people not to type them in the chat, or any other data they do not need to share, because whatever is written there may reach xAI. - **Authorities:** when a law or competent order requires it. Sanctions screening runs on our own system, without sending the data to third parties. We do not sell personal data or use it for advertising. **Where the data is kept.** Data is stored and processed outside Venezuela: - **United States (Virginia):** the platform, the portal and the main database, with payment, account, KYB and customer data (Railway). - **European Union:** the WhatsApp messaging server for verification codes, the online-store apps (Shopify and Tiendanube), the documentation and the exchange-rate service (Contabo). - **Cloudflare's global network:** KYB documents and business logos (Cloudflare R2). - **United States:** email delivery (Resend), our internal communication tools (Slack), KYB document photo reading and WhatsApp support draft replies (xAI). - **Venezuela and Colombia:** partner banks and payment processors receive what each payment needs. ## How long we keep it - Payment, payout and KYB records are kept while the account is active and afterwards for as long as the law and the handling of claims, reversals and chargebacks require. - The usage log of each API key (IP and browser) is deleted after 90 days. - WhatsApp support conversations are deleted after 12 months without activity. - Verification codes expire after 10 minutes and a trusted device after 30 days. A buyer can ask us to delete their remembered details. ## Security We use encrypted connections, store credentials and secrets encrypted or hashed, sign webhooks, limit internal access to those who need it and log access. KYB documents open only through short-lived links. No system is infallible; if an incident affects your data, we will tell you. ## Your rights and contact You can ask us for access to, correction or deletion of your data, or object to its use, by writing to soporte@vexwallet.co. If you bought from a business, you can also contact that business. Some data cannot be deleted while the law or an open claim requires keeping it. We may update this policy; we will publish the new version here with its date. The laws of the Bolivarian Republic of Venezuela apply. More about the service in the /terms. ---