VE BankingDeveloper guide
API reference
Browse documentation

Collect a C2P payment

C2P is a two-step tenant flow: create an intent, then execute with the customer’s token.

Two-step lifecycle

  1. Request an intent

    Send the amount, customer identity, phone, and bank code to POST /v1/payments/c2p/request.

  2. Gather the token and execute

    Prompt the customer for the 6–8 digit token issued through their bank, then send it with the same payment details and returned intentId to POST /v1/payments/c2p. The gateway does not message the customer.

1. Request an intent

curlbash
curl --request POST "${API_URL}/v1/payments/c2p/request" \
  --header "content-type: application/json" \
  --header "x-api-key: ${VE_BANKING_API_KEY}" \
  --data '{
    "usdAmount": 12.50,
    "debtorId": "V12345678",
    "debtorCellPhone": "584121234567",
    "debtorBankCode": 102,
    "externalRef": "order_demo_1042"
  }'

2. Execute with the token

curlbash
curl --request POST "${API_URL}/v1/payments/c2p" \
  --header "content-type: application/json" \
  --header "x-api-key: ${VE_BANKING_API_KEY}" \
  --data '{
    "intentId": "00000000-0000-4000-8000-000000000000",
    "usdAmount": 12.50,
    "debtorId": "V12345678",
    "debtorCellPhone": "584121234567",
    "debtorBankCode": 102,
    "token": "123456",
    "externalRef": "order_demo_1042"
  }'
JavaScriptjavascript
const payment = await fetch(
  `${process.env.API_URL}/v1/payments/c2p`,
  {
    method: 'POST',
    headers: {
      'content-type': 'application/json',
      'x-api-key': process.env.VE_BANKING_API_KEY,
    },
    body: JSON.stringify({
      intentId,
      usdAmount: 12.5,
      debtorId: 'V12345678',
      debtorCellPhone: '584121234567',
      debtorBankCode: 102,
      token: customerProvidedToken,
      externalRef: 'order_demo_1042',
    }),
  }
);