API

Online payment: Ecommerce API

Overview

The Ecommerce API lets you generate a payment link, capture a payment (in full or in part), cancel a link, and read the current state of a checkout. You create a link for an order, redirect your customer to Yavin's secure checkout to pay by bank card (including American Express, with 3-D Secure and co-badge selection handled for you) or by meal voucher (Conecs, Swile, Edenred), and you are notified of the result by webhook. Choose it for any online payment: ecommerce, Click & Collect, Order & Pay or Pay at Table via QR code.

At a glance

Base URLProduction: https://api.yavin.com/api/v5/ecommerce. Sandbox: https://api.sandbox.yavin.com/api/v5/ecommerce
AuthenticationAPI key in the Yavin-Secret header
Naming conventionInput accepts both camelCase and snake_case (checkoutExternalId and checkout_external_id both work). Responses use snake_case, except the query params appended to your return URLs which stay camelCase (cartId, status) for backwards compatibility
Current versionv5. New integrations must use checkout_external_id (the deprecated cart_id is only a backwards-compatible alias) and send order_number
Result deliveryAsynchronous: webhook on every checkout event, plus a customer redirect to your return URLs

Endpoints

EndpointMethodPurpose
/generate_link/POSTCreate a checkout and get a payment link
/cancel_link/POSTCancel a checkout
/capture_transactions/POSTCapture authorised transactions (deferred capture)
/get_cart_information/POSTRead the current state of a checkout

Before you start

Checkout. A checkout represents a single payment request, initiated by /generate_link/. It can contain one or more transactions: a customer can pay part with a meal voucher and top up the rest with a card. The checkout payload returned by most endpoints and by the webhook is documented as The Checkout object at the end of this page.

Checkout statuses. There is no 'failed' status: the customer can always retry on the payment page.

StatusMeaning
pendingAwaiting payment
okFully paid and captured
authorisedPaid, but one or more transactions still require capturing
koThe checkout has been cancelled

Amounts. Always integers in cents, always positive. Minimum checkout amount: 100 (1,00 €).

Sandbox. On the sandbox environment (api.sandbox.yavin.com), the payment page uses no test cards: the payment is validated as soon as the customer clicks Pay.

Payment link lifetime

  • Unused links (no payment attached) stay active for a maximum of 72 hours, then the checkout and the link are cancelled
  • Partially paid checkouts are systematically cancelled by the daily script, so funds are released back to the customer (particularly important for meal vouchers, which have hard spending limits)
  • If a payment is still needed after a link has been cancelled, generate a new link via /generate_link/

Deferred capture (is_instant_capture = false). Every day around 04:00 UTC a script:

  • Captures all transactions of fully paid checkouts with status authorised, once their capture_min_delay has elapsed
  • Cancels all transactions of partially paid checkouts (status pending), releasing funds back to the customers

Tips on multi-payment checkouts. A tip is added on top of the order and the order is paid first: on each payment, the order portion is covered first, and the tip is taken only from whatever room remains on that transaction. The tip therefore lands on whichever transaction still has capacity once the order is covered (typically the final top-up), not necessarily the first method. Each transaction reports its own gift_amount; the checkout-level gift_amount is the total.

Example. A 26 € checkout with a 1 € tip (27 € total) is paid 25 € by meal voucher, then 2 € by card. The voucher is capped at 25 € and spends it all on the order, so it carries no tip (gift_amount: 0); the card transaction covers the last 1 € of the order and the 1 € tip (gift_amount: 100).

A meal-voucher transaction can carry a tip only if the order and the tip both fit under its legal 25 € cap. If the order alone fills the cap, the tip moves to the next payment method.

Webhooks

If a webhook_url is provided at link generation, it is called via POST whenever an action takes place on the checkout. The body is a Checkout object with an extra action field.

ActionMeaning
payment_receivedA payment was made, for part or all of the requested amount
captureAll transactions captured, checkout status is now ok. Under instant capture you receive capture; on a multi-payment checkout, the last transaction reports capture rather than payment_received
cancelThe checkout was cancelled

Yavin expects an HTTP 200 acknowledgement. Otherwise the webhook is retried with increasing back-off, up to 5 retries, then Yavin gives up. Return the 200 quickly and process asynchronously: slow responses count as failures and trigger retries.


Capture transactions

POSThttps://api.yavin.com/api/v5/ecommerce/capture_transactions/

Captures the transactions of a checkout, in full or in part. Only available for links generated with is_instant_capture = false.

Partial capture is supported only when every transaction on the checkout allows it. Some meal-voucher issuers do not support partial capture: in that case the full authorised amount is captured instead.

Parameters

checkout_external_idStringrequired
Checkout to capture
amount_to_captureInteger
Amount to capture in cents, up to the originally requested amount (excluding gift_amount). 0 cancels the link, but prefer /cancel_link/ for that

Request

{
  "checkout_external_id": "order_001",
  "amount_to_capture": 2500
}

Response

JSON
{
  "data": {
    "checkout_external_id": "order_001",
    "payment_link": "https://pay.yavin.com/p/abc123",
    "requested_amount": 3000,
    "asked_amount": 3000,
    "paid_amount": 2500,
    "service_fee": 0,
    "status": "ok",
    "transactions": [
      {
        "transaction_id": "trs_7f3a92c5",
        "total_amount": 2500,
        "gift_amount": 0,
        "currency_code": "EUR",
        "date_of_payment": "2026-06-30 14:35:15",
        "gateway": "NEPTING_ECOMMERCE",
        "issuer": "VISA",
        "pan": "4970********0001",
        "status": "ok"
      }
    ]
  }
}

Get checkout information

POSThttps://api.yavin.com/api/v5/ecommerce/get_cart_information/

Reads the current state of a checkout. Use it to reconcile, or to confirm a payment when you need certainty beyond the webhook.

The endpoint path is get_cart_information, a fixed identifier kept for backwards compatibility. The object it returns is the checkout payload.

Parameters

checkout_external_idStringrequired
Checkout to read

Request

{ "checkout_external_id": "order_001" }

Response

JSON
{
  "data": {
    "checkout_external_id": "order_001",
    "payment_link": "https://pay.yavin.com/p/abc123",
    "requested_amount": 3000,
    "asked_amount": 3000,
    "paid_amount": 3000,
    "service_fee": 0,
    "status": "ok",
    "transactions": [
      {
        "transaction_id": "trs_7f3a92c5",
        "total_amount": 3000,
        "gift_amount": 0,
        "currency_code": "EUR",
        "date_of_payment": "2026-06-30 14:35:15",
        "gateway": "NEPTING_ECOMMERCE",
        "issuer": "VISA",
        "pan": "4970********0001",
        "status": "ok"
      }
    ]
  }
}

The Checkout object

The central object of this API. Sent to your webhook on every event, and returned by /cancel_link/ (as webhook_data), /capture_transactions/ and /get_cart_information/ (as data).

Attributes

actionString
The action that triggered this webhook. Webhook only
reasonString
Additional context (eg cancellation reason). Usually empty when the action was triggered by an endpoint call
checkout_external_idString
The checkout_external_id you provided in the original request
cart_idString
Deprecated alias of checkout_external_id
external_order_idString
Your order ID, echoed back
external_order_numberString
Human-readable order number, echoed back
external_table_numberString
Table number, echoed back
payment_linkString
The payment link of this checkout
requested_amountInteger
Total requested: amount plus gift_amount if used, in cents
asked_amountInteger
The original amount (excluding gift_amount). Differs from requested_amount when a partial capture was done or a gift_amount was used
paid_amountInteger
Total paid by the customer, in cents
service_feeInteger
Service fee, in cents
gift_amountInteger
Total tip left by the customer, in cents
statusString
pending, ok, authorised, ko
transactionsArray of Transaction
The payments attached to this checkout
Show Transaction parameters
transactions.transaction_idString
Unique ID of this transaction
transactions.total_amountInteger
Amount paid in cents
transactions.gift_amountInteger
Tip carried by this transaction, in cents
transactions.currency_codeString
ISO 4217 code
transactions.date_of_paymentString
YYYY-MM-DD HH:MM:SS, GMT
transactions.gatewayString
Gateway used for this transaction
transactions.issuerString
Card issuer name
transactions.panString
First and last digits of the card, joined by asterisks
transactions.statusString
Transaction status

JSON
{
  "action": "payment_received",
  "reason": "",
  "checkout_external_id": "order_001",
  "cart_id": "order_001",
  "external_order_id": "order_uuid_123",
  "external_order_number": "A-1042",
  "external_table_number": "12",
  "payment_link": "https://pay.yavin.com/p/abc123",
  "requested_amount": 2700,
  "asked_amount": 2600,
  "paid_amount": 2700,
  "service_fee": 0,
  "gift_amount": 100,
  "status": "ok",
  "transactions": [
    {
      "transaction_id": "trs_1a2b3c4d",
      "total_amount": 2500,
      "gift_amount": 0,
      "currency_code": "EUR",
      "date_of_payment": "2026-06-30 14:35:15",
      "gateway": "CONECS",
      "issuer": "SWILE",
      "pan": "5061********1234",
      "status": "ok"
    },
    {
      "transaction_id": "trs_7f3a92c5",
      "total_amount": 200,
      "gift_amount": 100,
      "currency_code": "EUR",
      "date_of_payment": "2026-06-30 14:36:02",
      "gateway": "NEPTING_ECOMMERCE",
      "issuer": "VISA",
      "pan": "4970********0001",
      "status": "ok"
    }
  ]
}

The Transaction object

One payment attached to a checkout. A checkout can carry several, for example a meal voucher plus a card top-up.

Attributes

transaction_idString
Unique ID of this transaction
total_amountInteger
Amount paid in cents
gift_amountInteger
Tip carried by this transaction, in cents
currency_codeString
ISO 4217 code
date_of_paymentString
YYYY-MM-DD HH:MM:SS, GMT
gatewayString
Gateway used for this transaction
issuerString
Card issuer name
panString
First and last digits of the card, joined by asterisks
statusString
Transaction status

JSON
{
  "transaction_id": "trs_7f3a92c5",
  "total_amount": 2500,
  "gift_amount": 0,
  "currency_code": "EUR",
  "date_of_payment": "2026-06-30 14:35:15",
  "gateway": "NEPTING_ECOMMERCE",
  "issuer": "VISA",
  "pan": "4970********0001",
  "status": "ok"
}

The Customer object

Customer details attached to the checkout. Required when you ask Yavin to send the payment link by email or SMS through the Feature object.

Attributes

first_nameStringrequired
First name
last_nameStringrequired
Last name
emailString
Email (required for share_by_email)
telephoneString
International format starting with + (required for share_by_sms)
addressString
Address
cityString
City
postcodeString
Postcode

JSON
{
  "customer": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@yavin.com",
    "telephone": "+33612345678",
    "address": "66 Av. des Champs-Élysées",
    "city": "Paris",
    "postcode": "75008"
  }
}

The Feature object

Toggles what the payment page offers, and whether Yavin sends the link to the customer for you.

Attributes

tipsBooleandefault true
Whether tips are active on the payment page
customer_contactsBooleandefault true
Whether company clients are active
meal_vouchersBooleandefault true
Whether meal vouchers are active
share_by_emailBooleandefault false
Send the payment link by email; requires a Customer with an email. Only one of email/SMS per request
share_by_smsBooleandefault false
Send the payment link by SMS; requires a Customer with a telephone. Only one of email/SMS per request

JSON
{
  "features": {
    "tips": true,
    "meal_vouchers": true,
    "customer_contacts": false,
    "share_by_email": true,
    "share_by_sms": false
  }
}

The Item object

Basket lines attached to the checkout. Items drive the meal-voucher eligibility rules, so send them whenever the merchant accepts meal vouchers.

Attributes

nameStringrequired
Item name
total_amountIntegerrequired
Total amount for the item, in cents
total_amount_without_taxInteger
Amount without tax
categoryString
Item category
eligible_titre_restaurantBoolean
Meal-voucher eligibility
free_noteString
Free-form note
quantityInteger
Quantity
unit_priceInteger
Unit price in cents
unit_price_without_taxInteger
Unit price without tax
taxTax
Tax breakdown for this item
Show Tax parameters
tax.amountIntegerrequired
Tax amount in cents
tax.rateIntegerrequired
Tax rate as a decimal integer (eg 20 for 20%)
itemsArray
Nested items

JSON
{
  "items": [
    {
      "name": "Menu midi",
      "total_amount": 1590,
      "total_amount_without_tax": 1325,
      "quantity": 1,
      "unit_price": 1590,
      "category": "food",
      "eligible_titre_restaurant": true,
      "tax": { "amount": 265, "rate": 20 }
    }
  ]
}

The Tax object

Tax breakdown attached to an Item.

Attributes

amountIntegerrequired
Tax amount in cents
rateIntegerrequired
Tax rate as a decimal integer (eg 20 for 20%)

JSON
{
  "tax": { "amount": 265, "rate": 20 }
}

The Vendor object

Identifies the merchant and the software behind the checkout.

Attributes

software_nameString
Software name
software_versionString
Software version

JSON
{
  "vendor": {
    "software_name": "my_software",
    "software_version": "1.0"
      }
}

The Store object

The physical store behind the checkout, nested in the Vendor object.

Attributes

store_idStringrequired
Store identifier
addressAddress
Store address
Show Address parameters
address.addressStringrequired
Street address
address.cityStringrequired
City
address.postcodeStringrequired
Postcode

JSON
{
  "store": {
    "store_id": "store_8",
    "address": {
      "address": "66 Av. des Champs-Élysées",
      "city": "Paris",
      "postcode": "75008"
    }
  }
}

The Address object

Postal address, nested in the Store object.

Attributes

addressStringrequired
Street address
cityStringrequired
City
postcodeStringrequired
Postcode

JSON
{
  "address": {
    "address": "66 Av. des Champs-Élysées",
    "city": "Paris",
    "postcode": "75008"
  }
}

The Marketplace object

Splits a payment across several beneficiaries. See Marketplace ventilation and Foodcourt ventilation for the onboarding and the accounting side.

Attributes

ventilationsArrayrequired
List of objects, each with public_account_id (String) and ttc_amount (Integer, in cents). The ttc_amount values must sum to the checkout amount

JSON
{
  "marketplace": {
    "ventilations": [
      { "public_account_id": "azertyuiop", "ttc_amount": 1000 },
      { "public_account_id": "qsdfghjklm", "ttc_amount": 2000 }
    ]
  }
}

Untitled

Marketplace ventilation

Foodcourt ventilation

Webhooks Management