Orders

On this page, we'll dive into the different order endpoints you can use to manage orders programmatically.

The order model

The order model contains all the information about your orders, including the order details, customer information, line items, and tax information.

Properties

NameTypeDescription
idstringUnique identifier for the order (starts with order_).
resourcestringThe resource type. Always order.
customerIdstring | nullID of the customer who made this purchase. Always present, but null for orders with no associated customer.
testmodebooleanWhether this order is in test mode.
metadataobject | nullArbitrary key-value metadata for your application.
paymentMethodstring | nullPayment method used for this order (e.g., ideal, creditcard, bancontact, paypal).
statusstringThe current status of the order. Can be created, pending, paid, canceled, or expired.
cancellationReasonstring | nullWhy the order was canceled. null unless status is canceled, and null for orders canceled before this field existed. Currently payment_failure (payment recovery for this unpaid order was exhausted).
invoiceNumberstring | nullInvoice number for this order (assigned after payment).
totalMoneyTotal amount including taxes. A Money object with value (decimal string) and currency (ISO 4217 code).
subtotalMoneySubtotal amount before taxes.
reversedSubtotalMoneyAmount of the captured payment already returned to the customer, before taxes, via refund or chargeback (settled).
refundableSubtotalMoneyRemaining amount that can still be refunded, before taxes. Always zero for an order that is not a sale (any order type other than checkout_order and mandated_order, such as a payment-method authorization or a verification charge), because such orders cannot be refunded.
taxSummaryarrayTax breakdown by rate. Each item contains a taxRate object (name, percentage, taxablePercentage) and an amount Money object.
linesarrayArray of line items in this order. See OrderLine properties below.
discountsarrayEvery discount on the order, each listed once with the amount it takes off all lines added up, in the order it first appears on the lines. Empty when the order has no discount. Match an entry to its share on each line by id. See Discount properties below.
customerDetailsBillingDetailsCustomer billing details (buyer). Includes fullName, companyName, taxId, streetAndNumber, streetAdditional, city, region, postalCode, country, and email.
createdAtstringWhen this order was created (ISO 8601 format).
linksobjectHATEOAS links to related resources. Contains self, customer (null for orders without a customer) and customerInvoice, the invoice in the customer portal (text/html). On a refund or chargeback order, customerInvoice opens the credit note. The link is signed and expires after 72 hours; the customer can request a new one from the page.

OrderLine Properties

NameTypeDescription
idstringUnique identifier for this line item (starts with order_item_).
resourcestringThe resource type. Always orderline.
descriptionstringDescription of the item.
quantityintegerNumber of units.
basePriceMoneyPrice per unit before discounts, on the product's tax basis: excluding taxes for tax-exclusive products, including them for tax-inclusive products.
totalMoneyTotal price including taxes, after discounts (subtotal + taxes).
subtotalMoneySubtotal excluding taxes, after discounts.
taxesarrayTax breakdown by rate for this line. Each item contains a taxRate object and an amount Money object.
discountsarrayThis line's share of each discount, in the order they apply. Empty when the line has no discount. subtotal, taxes and total are already net of these discounts. See Discount properties below.
productTypestring | nullThe product type this line links to. One of one_off_product, subscription_plan, subscription, billing_details_verification, auth_request_product, or null when the line has no product link.
productIdstring | nullThe linked product's id (e.g. subscription_... for a subscription line). null when the line has no product link.

Discount Properties

A discount applied to an order, as listed under the order's and each line's discounts. Discounts are set when creating a checkout. Amounts exclude VAT; the line's taxes already reflect the discount.

NameTypeDescription
idstring | nullIdentifies this discount on this order. Every line's share of a discount and the order's entry for it carry the same id. It names one application, not a reusable coupon: every order, and every subscription renewal, gets new ids. null only on discounts applied before ids were introduced.
descriptionstring | nullThe label sent with the discount, if any.
discountTypestring | nullHow the discount is defined: percentage or fixed_amount. More values may be added; treat an unknown value as a discount of an unknown kind. null only on discounts applied before it was recorded.
percentagestring | nullThe percentage taken off, as a decimal string (e.g. "20.00"), for a percentage discount. null for a fixed_amount discount.
amountMoneyThe amount taken off, excluding VAT, also when the products' prices include VAT: €10.00 off a €121.00 price at 21% reads 8.26.

List all orders

GET /v1/orders

This endpoint allows you to retrieve a paginated list of all your orders. By default, a maximum of ten orders are shown per page.

Optional parameters

NameTypeDescription
limitintegerThe number of orders to return (default: 10, max: 100).
startingAfterstringA cursor for use in pagination. Returns results after this order ID.
endingBeforestringA cursor for use in pagination. Returns results before this order ID.
curl -G https://api.vatly.com/v1/orders \
  -H "Authorization: Bearer live_your_api_key_here" \
  -d limit=10

Get an order

GET /v1/orders/:orderId

This endpoint allows you to retrieve a specific order by its ID.

Parameters

NameTypeDescription
orderIdstringThe unique identifier of the order.
curl https://api.vatly.com/v1/orders/order_Hn5xWqVfKm8RjTgYbUcP \
  -H "Authorization: Bearer live_your_api_key_here"

POST /v1/orders/:orderId/invoice-update-link

Creates a signed link that customers can use to update the invoice details for this order: billing address, VAT number, and company name. The link is valid for a limited time (typically 24 hours).

Parameters

NameTypeDescription
orderIdstringThe unique identifier of the order.
curl -X POST https://api.vatly.com/v1/orders/order_Hn5xWqVfKm8RjTgYbUcP/invoice-update-link \
  -H "Authorization: Bearer live_your_api_key_here"
Copyright © 2026