Vatly
Api Reference

Order Refunds

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

The refund model

The refund model contains all the information about order refunds, including the refund lines, amounts, and tax information.

Properties

NameTypeDescription
idstringUnique identifier for the refund (starts with ref_).
resourcestringThe resource type. Always refund.
orderIdstring | nullID of the credit note order created for this refund. Only present after the refund is processed.
merchantIdstringID of the merchant.
customerIdstringID of the customer receiving the refund.
testmodebooleanWhether this refund is in test mode.
statusstringThe current status of the refund. Can be pending, completed, failed, or canceled.
originalOrderIdstringID of the original order being refunded.
totalMoneyTotal refund amount including taxes. A Money object with value (decimal string) and currency (ISO 4217 code).
subtotalMoneyRefund subtotal before taxes.
taxSummaryMoneyTotal tax amount being refunded.
linesarrayArray of refund line items. See RefundLine properties below.
createdAtstringWhen this refund was created (ISO 8601 format).
linksobjectHATEOAS links to related resources. Contains self, originalOrder, and optionally order (the credit note).

RefundLine Properties

NameTypeDescription
idstringUnique identifier for this refund line (starts with rli_).
resourcestringThe resource type. Always refundline.
descriptionstringDescription of the refunded item.
quantityintegerNumber of units being refunded.
basePriceMoneyRefund amount per unit before taxes.
totalMoneyTotal refund amount including taxes.
subtotalMoneyRefund subtotal before taxes.
taxesMoneyTax amount being refunded.

Create a refund

POST /v1/orders/:orderId/refunds

This endpoint allows you to create a partial refund for a specific order. You specify which order line items to refund and the amount for each.

Parameters

NameTypeDescription
orderIdstringThe unique identifier of the order.

Request body

NameTypeDescription
itemsarray(Required) Array of items to refund. Each item has: itemId (string, required) - ID of the order line item, amount (Money, required) - amount to refund before taxes, description (string, optional) - custom description, descriptionAdditionalLine (string, optional) - additional description line.
metadataobjectArbitrary key-value metadata for your application.
curl -X POST https://api.vatly.com/v1/orders/ord_abc123/refunds \
  -H "Authorization: Bearer live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "itemId": "oli_abc123",
        "amount": {
          "value": "15.00",
          "currency": "EUR"
        },
        "description": "Partial refund for service issue"
      }
    ]
  }'

Create a full refund

POST /v1/orders/:orderId/refunds/full

This endpoint allows you to create a full refund for a specific order. This will refund the entire remaining amount of the order.

Parameters

NameTypeDescription
orderIdstringThe unique identifier of the order.

Request body (optional)

NameTypeDescription
metadataobjectArbitrary key-value metadata for your application.
curl -X POST https://api.vatly.com/v1/orders/ord_abc123/refunds/full \
  -H "Authorization: Bearer live_your_api_key_here"

List order refunds

GET /v1/orders/:orderId/refunds

This endpoint allows you to retrieve a list of all refunds for a specific order.

Parameters

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

Get an order refund

GET /v1/orders/:orderId/refunds/:refundId

This endpoint allows you to retrieve details of a specific refund for a specific order.

Parameters

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

Cancel an order refund

DELETE /v1/orders/:orderId/refunds/:refundId

This endpoint allows you to cancel a pending refund for a specific order. Only pending refunds can be cancelled.

Parameters

NameTypeDescription
orderIdstringThe unique identifier of the order.
refundIdstringThe unique identifier of the refund to cancel.
curl -X DELETE https://api.vatly.com/v1/orders/ord_abc123/refunds/ref_abc123def456 \
  -H "Authorization: Bearer live_your_api_key_here"

Returns 204 No Content on success.

Copyright © 2026