Conventions
Content type
- Requests:
Content-Type: application/json - Responses: JSON (success) or RFC 7807 ProblemDetails (errors)
Error format (ProblemDetails)
Failed requests return a ProblemDetails object:type— Vpay error code (e.g.VPAY_001) when applicablestatus— HTTP status code- Validation
400responses may include anerrorsdictionary keyed by field name
Shared payment fields
Start payment (POST /pay/api/start-payment)
| Field | Type | Required | Notes |
|---|---|---|---|
callbackSuccessUrl | string | Yes | Redirect after successful payment |
callbackFailUrl | string | Yes | Redirect after failed payment |
callbackBackUrl | string | No | Redirect when payer cancels / goes back |
totalTransactionAmount | decimal | Yes | Must be greater than 0 |
currencyCode | string | Yes | ISO currency (e.g. CRC, USD) |
terminalNumber | string | No | Resolved from JWT client_id if omitted |
transactionReferenceNumber | string | Yes | Unique merchant reference |
generalPurchaseDescription | string | No | Shown on checkout |
userEmail | string | No | Payer email |
culture | string | No | UI locale hint (e.g. es, en) |
additionalCharges | array | No | See below |
items | array | No | Line items (optional) |
| Field | Type |
|---|---|
chargeName | string |
chargeAmount | decimal |
chargeCurrencyCode | string — must match request currencyCode when charges are present |
| Field | Type |
|---|---|
itemCode | string |
quantity | integer |
description | string |
amount | decimal |
currencyCode | string — must match request currencyCode when items are present |
Generate payment link (POST /pay/api/generate-payment-link)
Same monetary and line-item fields as start payment, without callback URLs. Additional required fields:
| Field | Required |
|---|---|
generalPurchaseDescription | Yes |
userEmail | Yes (valid email) |
culture | Yes |
JSON API vs browser routes
Documented as API (server-to-server):POST /api/public/security/authPOST /pay/api/start-paymentPOST /pay/api/generate-payment-linkGET /pay/api/payment/{checkoutSessionId}
GET /pay/checkout-payment/{checkoutSessionId}GET /pay/link/{id}POST /pay/process-payment(form submission from checkout page)
Idempotency and references
transactionReferenceNumbermust be unique per terminal for a new payment session.- Reusing a reference for an in-flight or completed session returns
VPAY_001.

