VelyoPay API
Accept cards, Apple Pay, Google Pay and crypto with a single REST API. Funds are paid out automatically in USDC to your own wallet.
Introduction
The API is organised around REST. It accepts JSON or form-encoded request bodies, returns JSON, and uses standard HTTP status codes. All requests must use HTTPS.
Base URL: https://api.velyopay.com/v1
A typical integration takes three steps:
- Your server creates a payment with
POST /v1/payments. - You redirect your customer to the
checkout_urlreturned in the response. - VelyoPay sends a signed
payment.paidwebhook to your server when the payment is confirmed.
Authentication
Authenticate every request with your secret API key in the Authorization header, using the Bearer scheme. Keys start with vp_live_ and are created in your dashboard. A key is shown only once: store it safely and never expose it in front-end code or a public repository.
curl https://api.velyopay.com/v1/payments \
-H "Authorization: Bearer vp_live_xxxxxxxxxxxxxxxxxxxxxxxx"
A missing, invalid or revoked key returns 401:
{
"error": {
"type": "authentication_error",
"message": "Clé API absente, invalide ou révoquée."
}
}
Errors
| Status | Meaning |
|---|---|
200 / 201 | Success / resource created. |
401 | authentication_error: missing, invalid or revoked API key. |
404 | The resource does not exist or does not belong to your account. |
422 | Invalid parameters, or payment_error when the payment cannot be created (for example, no payout wallet set on your account). |
429 | Too many requests. See rate limits. |
5xx | Something went wrong on our side. Retry with exponential backoff. |
Validation errors list the faulty fields:
{
"message": "The amount field is required.",
"errors": {
"amount": ["The amount field is required."]
}
}
Rate limits
Each API key can make up to 120 requests per minute. Beyond that the API answers 429 Too Many Requests; wait for the number of seconds given in the Retry-After header before retrying.
The payment object
{
"id": "pay_8f3k2m9x1q7w4e6r5t0y2u8i",
"object": "payment",
"livemode": true,
"status": "pending",
"method": "card",
"amount": "149.00",
"currency": "EUR",
"reference": "ORDER-1042",
"description": "Premium plan (1 year)",
"customer_email": "[email protected]",
"checkout_url": "https://checkout.velyopay.com/pay/pay_8f3k2m9x1q7w4e6r5t0y2u8i",
"txid_out": null,
"value_coin": null,
"metadata": { "customer_id": "4821" },
"paid_at": null,
"created_at": "2026-12-04T19:30:00+00:00"
}
| Field | Description |
|---|---|
id | Unique identifier, prefixed with pay_. |
status | pending, paid, expired or failed. |
method | card (cards, Apple Pay, Google Pay and other providers). |
amount | Amount charged to the customer, as a decimal string. |
currency | Three-letter ISO currency code. |
reference | Your own order reference. |
checkout_url | Hosted payment page to send your customer to. |
txid_out | Polygon transaction of the payout to your wallet, once paid. |
value_coin | Amount received in USDC, once paid. |
metadata | Up to 20 key/value pairs you attached to the payment. |
paid_at | Time the payment was confirmed (ISO 8601), or null. |
POSTCreate a payment
POST /v1/payments
| Parameter | Description |
|---|---|
amount required | Amount to charge, between 1 and 100,000. |
currency required | One of USD, EUR, GBP, CAD, AUD, CHF, MAD. |
reference | Your order number (max 191 characters). |
description | Shown to the customer on the payment page. |
customer_email | Customer email. If omitted, the payment page asks for it. |
provider | Force a single provider (for example stripe, applepay, googlepay, paypal). If omitted, the customer chooses. |
return_url | Where to send the customer after a successful payment. |
cancel_url | Where to send the customer if they cancel. |
webhook_url | Webhook endpoint for this payment only. Overrides the account webhook URL. |
metadata | Object of up to 20 key/value pairs, returned in the payment and in webhooks. |
Example
curl https://api.velyopay.com/v1/payments \
-H "Authorization: Bearer vp_live_..." \
-H "Content-Type: application/json" \
-d '{
"amount": 149,
"currency": "EUR",
"reference": "ORDER-1042",
"customer_email": "[email protected]",
"return_url": "https://myshop.com/thanks",
"cancel_url": "https://myshop.com/cart",
"metadata": { "customer_id": "4821" }
}'
Returns 201 Created with the payment object. Redirect your customer to checkout_url.
PHP
$ch = curl_init('https://api.velyopay.com/v1/payments');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('VELYOPAY_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'amount' => 149,
'currency' => 'EUR',
'reference' => 'ORDER-1042',
'return_url' => 'https://myshop.com/thanks',
]),
]);
$payment = json_decode(curl_exec($ch), true);
header('Location: ' . $payment['checkout_url']);
Node.js
const res = await fetch('https://api.velyopay.com/v1/payments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VELYOPAY_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ amount: 149, currency: 'EUR', reference: 'ORDER-1042' }),
});
const payment = await res.json();
// redirect the customer to payment.checkout_url
GETRetrieve a payment
GET /v1/payments/{id}
curl https://api.velyopay.com/v1/payments/pay_8f3k2m9x1q7w4e6r5t0y2u8i \
-H "Authorization: Bearer vp_live_..."
Returns the payment object, or 404 if it does not exist or belongs to another account.
GETList payments
GET /v1/payments?limit=20&page=1
| Parameter | Description |
|---|---|
limit | Number of payments per page, 1 to 100 (default 20). |
page | Page number, starting at 1. |
{
"object": "list",
"data": [ { "id": "pay_...", "object": "payment", ... } ],
"has_more": true
}
Payments are sorted from newest to oldest.
Hosted checkout
The checkout_url opens a VelyoPay-branded payment page on checkout.velyopay.com. The customer chooses a provider (card, Apple Pay, Google Pay, PayPal, Revolut…) and pays. The page is shown in the customer's browser language (English, French, Spanish, Arabic, Portuguese, Russian or Turkish); add ?lang=fr to force a language.
After paying, the customer is sent back to your return_url. Never treat a return as proof of payment: confirm the order only when you receive the payment.paid webhook, or when GET /v1/payments/{id} returns status: "paid".
Each provider has its own minimum amount (usually between 2 and 30 USD). The page only offers providers that accept the amount.
Test mode
Build and test your integration without moving real money. Create a test key in your dashboard (API keys → Mode: Test). Test keys start with vp_test_ and work exactly like live keys, with three differences:
- Payments created with a test key have
"livemode": false. No payment provider is contacted and no funds move. - The
checkout_urlopens a test checkout with two buttons: Simulate a successful payment and Simulate a failed payment. The customer is then sent to yourreturn_urlorcancel_url. - A test key only sees test payments, and a live key only sees live payments. Test payments are listed under the Test tab of your dashboard and never count in your balances.
Your server receives the same payment.paid or payment.failed webhook as in production, signed with the same secret, so you can test your signature check and order fulfilment end to end. Switch to a live key when you are ready.
curl https://api.velyopay.com/v1/payments \
-H "Authorization: Bearer vp_test_xxxxxxxxxxxxxxxxxxxxxxxx" \
-d amount=25 -d currency=EUR -d reference=TEST-1001
Webhooks
Webhooks notify your server in real time when a payment changes. Set a default webhook URL on your account in the dashboard, or pass webhook_url when you create a payment. The endpoint must be reachable over HTTPS.
Events
| Event | Sent when |
|---|---|
payment.paid | The payment is confirmed and the funds have been sent to your wallet. |
Request
VelyoPay sends a POST request with a JSON body and these headers:
| Header | Value |
|---|---|
VelyoPay-Event | Event type, for example payment.paid. |
VelyoPay-Event-Id | Unique event identifier (evt_...), identical on every retry. |
VelyoPay-Signature | t=<timestamp>,v1=<signature>. See below. |
User-Agent | VelyoPay-Webhooks/1.0 |
{
"id": "evt_2k9d7s1m4n8b6v3c0x5z7a1q",
"object": "event",
"type": "payment.paid",
"created_at": "2026-12-04T19:32:10+00:00",
"data": {
"id": "pay_8f3k2m9x1q7w4e6r5t0y2u8i",
"object": "payment",
"status": "paid",
"amount": "149.00",
"currency": "EUR",
"reference": "ORDER-1042",
"txid_out": "0x5b1e...c9a2",
"value_coin": "158.21",
"metadata": { "customer_id": "4821" },
"paid_at": "2026-12-04T19:32:09+00:00",
...
}
}
Verify signatures
Every webhook is signed with your account's webhook secret (whsec_..., shown in your dashboard). Always verify the signature before trusting a webhook:
- Read the
VelyoPay-Signatureheader and extractt(Unix timestamp) andv1(signature). - Build the signed string: the timestamp, a dot, then the raw request body, exactly as received:
t + "." + body. - Compute an HMAC-SHA256 of that string with your webhook secret, in hexadecimal.
- Compare it with
v1using a constant-time comparison, and reject events whose timestamp is more than 5 minutes old.
PHP
$body = file_get_contents('php://input');
$header = $_SERVER['HTTP_VELYOPAY_SIGNATURE'] ?? '';
$secret = getenv('VELYOPAY_WEBHOOK_SECRET');
preg_match('/t=(\d+),v1=([0-9a-f]{64})/', $header, $m);
$expected = hash_hmac('sha256', ($m[1] ?? '') . '.' . $body, $secret);
if (!$m || !hash_equals($expected, $m[2]) || abs(time() - (int) $m[1]) > 300) {
http_response_code(400);
exit;
}
$event = json_decode($body, true);
if ($event['type'] === 'payment.paid') {
// mark $event['data']['reference'] as paid (only once)
}
http_response_code(200);
Node.js (Express)
import crypto from 'node:crypto';
import express from 'express';
const app = express();
app.post('/webhooks/velyopay', express.raw({ type: 'application/json' }), (req, res) => {
const [, t, v1] = /t=(\d+),v1=([0-9a-f]{64})/.exec(req.get('VelyoPay-Signature') || '') || [];
const expected = crypto
.createHmac('sha256', process.env.VELYOPAY_WEBHOOK_SECRET)
.update(`${t}.${req.body}`)
.digest('hex');
const valid = v1 && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1))
&& Math.abs(Date.now() / 1000 - Number(t)) < 300;
if (!valid) return res.sendStatus(400);
const event = JSON.parse(req.body);
if (event.type === 'payment.paid') {
// mark event.data.reference as paid (only once)
}
res.sendStatus(200);
});
Python (Flask)
import hashlib, hmac, os, re, time
from flask import Flask, request, abort
app = Flask(__name__)
@app.post("/webhooks/velyopay")
def velyopay_webhook():
body = request.get_data()
m = re.search(r"t=(\d+),v1=([0-9a-f]{64})", request.headers.get("VelyoPay-Signature", ""))
if not m:
abort(400)
expected = hmac.new(os.environ["VELYOPAY_WEBHOOK_SECRET"].encode(),
m.group(1).encode() + b"." + body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, m.group(2)) or abs(time.time() - int(m.group(1))) > 300:
abort(400)
event = request.get_json()
if event["type"] == "payment.paid":
pass # mark event["data"]["reference"] as paid (only once)
return "", 200
Retries & best practices
Your endpoint must answer with a 2xx status within 10 seconds. Any other answer, a timeout or a connection error counts as a failure, and the event is sent again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours (7 attempts in total).
- Answer fast. Return
200immediately and do slow work (emails, fulfilment) in the background. - Be idempotent. The same event can arrive more than once. Use
VelyoPay-Event-Idor the paymentidto process it only once. - Check the amount. Compare
data.amountanddata.currencywith your order before fulfilling it. - Keep your secret private. If it leaks, regenerate it in your dashboard.
- Missed an event? You can always check the current state with
GET /v1/payments/{id}.
Currencies & statuses
Currencies
USD · EUR · GBP · CAD · AUD · CHF · MAD
Payment statuses
| Status | Meaning |
|---|---|
pending | Created, waiting for the customer to pay. |
paid | Paid and confirmed. The funds are on their way to your wallet in USDC (Polygon). |
expired | Not paid in time. |
failed | The payment could not be completed. |
Fees
5.99% per successful transaction, deducted automatically before the payout, plus the payment provider's own fee. There are no monthly or setup fees.