Skip to content
Documentation menu

Vouchereto API · v1

Hosted checkout

Add a “Pay with voucher” button to your top-up page. The customer buys a voucher by card on pay.vouchereto.com (3D Secure) and comes back with the amount already applied to your merchant.

Flow

  1. Your server creates a session with the amount and where to send the customer back.
  2. Redirect the customer to url. They enter their email and card on our page, in their language.
  3. With auto_redeem: true (default) we issue the voucher, reserve and capture it for you: the session becomes completed with a redemption_id. The customer also gets the voucher by email as a receipt.
  4. We redirect to return_url?vouchereto_session=<id>&status=<status>. If they give up, the back link goes to cancel_url.
  5. Credit the customer on the checkout.completed webhook (or after GET /v1/checkout-sessions/{id} shows completed). Never trust the query string alone.
create a session
POST /v1/checkout-sessions
Idempotency-Key: topup-3141

{
  "amount_minor": 5000,
  "currency": "USD",
  "customer_ref": "user_8842",
  "customer_email": "ana@example.com",
  "country": "US",
  "locale": "en",
  "return_url": "https://shop.example.com/topup/done",
  "cancel_url": "https://shop.example.com/topup",
  "auto_redeem": true,
  "metadata": { "topup_id": "3141" }
}

201 Created
{
  "id": "132d93fe-5f19-4b22-b34b-4d22f2f20881",
  "object": "checkout_session",
  "url": "https://pay.vouchereto.com/c/132d93fe-5f19-4b22-b34b-4d22f2f20881",
  "status": "open",
  "amount_minor": 5000,
  "currency": "USD",
  "customer_ref": "user_8842",
  "locale": "en",
  "auto_redeem": true,
  "livemode": false,
  "redemption_id": null,
  "metadata": { "topup_id": "3141" },
  "expires_at": "2026-10-22T18:22:57.010Z"
}

Fields

Checkout session fields
FieldRequiredNotes
amount_minoryesWithin the minimum and maximum configured for your account
currencyyesOne of your account currencies
customer_refyesYour customer id, returned in webhooks
return_urlyeshttps:// (http://localhost works on the local stack)
cancel_urlyesWhere the back link goes
customer_emailnoPrefills the email field
countrynoISO 3166-1 alpha-2. Some categories cannot sell in some countries (COUNTRY_NOT_ALLOWED)
localenoen (default), es, ja, ko, pt, it, de
auto_redeemnofalse = the customer just gets the voucher by email and redeems it later
metadatanoUp to 20 string values (500 chars each), echoed in webhooks

Statuses

Checkout statuses
statusMeaning
openWaiting for the customer. Expires after 60 minutes.
paidCard payment approved, voucher being issued. A voucher placed on a fraud review stays here until released, then completes.
completedDone. With auto_redeem, redemption_id is the captured redemption.
expiredNot paid in time.
failedPayment failed.
cancelledCancelled.

Testing

  • Create the session with a vch_test_ key and pay with the test cards (4242 4242 4242 4242 approves). Test sessions create test vouchers only.
  • Try the decline cards and the 3D Secure card, and let a session expire to see checkout.expired.
Keep amounts identical to what you show the customer. The fee (if any) is shown on our page before they pay; you receive the full amount_minor minus your agreed commission in the weekly settlement.