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 refund_).
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, queued, processing, refunded, 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.
taxSummaryarrayTax breakdown by rate being refunded. Array of objects with taxRate (name, percentage, taxablePercentage) and amount (Money).
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).

Status values

StatusDescription
pendingRefund is ready to be sent to the bank.
queuedRefund is queued due to a lack of balance.
processingRefund is being processed (cancellation no longer possible).
refundedRefund has been processed successfully.
failedRefund has failed after processing.
canceledRefund was canceled.

RefundLine Properties

NameTypeDescription
idstringUnique identifier for this refund line (starts with refund_item_).
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.
taxesarrayTax breakdown by rate being refunded. Array of objects with taxRate and amount.

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/order_Fp2kQrSvWm8NjLhYbUcP/refunds \
  -H "Authorization: Bearer live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "itemId": "order_item_Jk4pQrSvWm8NjLhYbUcP",
        "amount": {
          "value": "15.00",
          "currency": "EUR"
        },
        "description": "50% 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/order_Fp2kQrSvWm8NjLhYbUcP/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/order_Fp2kQrSvWm8NjLhYbUcP/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/order_Fp2kQrSvWm8NjLhYbUcP/refunds/refund_Xk9pQrSvWm4NjLhYbUcP \
  -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/order_Fp2kQrSvWm8NjLhYbUcP/refunds/refund_Mn6xBtPvKw2RjTgYcZaE \
  -H "Authorization: Bearer live_your_api_key_here"

Returns 204 No Content on success.

Copyright © 2026