Paytrim
Refunds

Create a refund

POST
/v1/orders/{order_id}/refunds/

Refunds the full amount or part of a completed order. A refund is a new order, linked to the original order through refund_of_order_id. It always uses the currency of the original order.

You can refund an order several times, as long as the total doesn't exceed the original amount. See Refunds.

Authorization

apiKey
headerAuthorizationBasic <token>

Use your project's API key as the username and leave the password empty. Only use the API key from your server: it gives full access to your project.

Path Parameters

order_id*string

The id of the order.

Formatuuid

Request Body

application/json
  1. body
amount*Amount

Amount to refund in the smallest currency unit. The original amount for a full refund, less for a partial refund.

Range0 <= value
description?string

Description of the refund. Without it, the description of the original order is used.

merchant_order_id?string

Your own reference for the refund.

extra?

Your own data to store with the refund.

Response Body

The refund has been created. The response contains the refund order.

application/json
  1. response
id?string

Order ID.

Formatuuid
project_id?string

ID of the project the order belongs to.

Formatuuid
merchant_id?string

ID of your merchant account.

Formatuuid
merchant_order_id?string

Your own order reference. Recommended.

merchant_name?string

Your merchant name.

description?string

Description of the order. Recommended.

currency*Currency

ISO 4217 currency code, such as EUR, GBP or USD. Get supported currencies lists the currencies of your project.

Match^[A-Z]{3}$
amount*Amount

Amount in the smallest currency unit, including VAT. 1234 is € 12.34. For currencies without minor units, send the whole amount.

Range0 <= value
status?string

Status of the order. completed, cancelled, expired and error are final. With see-transactions, the transactions have different statuses: check each of them. See Order statuses.

Value in"new""processing""completed""cancelled""expired""error""see-transactions"
flags?array<string>

Labels of the order, such as is-test for orders in a test project and is-refund for refund orders.

created?Timestamp

Date and time in ISO 8601 format.

Formatdate-time
modified?Timestamp

Date and time in ISO 8601 format.

Formatdate-time
completed?Timestamp

Date and time in ISO 8601 format.

Formatdate-time
expiration_period?Duration

How long the order stays valid, such as PT1H for one hour.

payment_methods?array<>

The payment methods to show on the hosted payment page. Without it, every payment method that's active in your project is shown.

transactions?array<>

The payment attempts of the order. When you create the order, send one transaction to pick the payment method yourself. Without it, your customer picks a payment method on the hosted payment page.

order_url?string

The hosted payment page of the order. Redirect your customer here when you didn't send a transaction.

Formaturi
return_url?string

Where your customer goes after the payment. Recommended.

Formaturi
failure_url?string

Where your customer goes when the payment fails, with status cancelled, expired or error. Without it, your customer goes to the return_url.

Formaturi
webhook_url?string

Where webhooks for this order are sent. Overrides the webhook URL of your project.

Formaturi
customer?

Your customer. Card schemes use these details for 3-D Secure risk assessment, so complete details lead to more frictionless payments. Your acquirer can require some of them.

client?

The software that sends the request, such as your e-commerce platform or plugin.

extra?

Your own data to store with the order. It's returned when you retrieve the order.

refunded_amount?integer

The amount refunded on this order so far, in the smallest currency unit.

refund_of_order_id?string

For a refund order, the ID of the original order.

Formatuuid
refund_orders?array<>

IDs of the refund orders of this order.

capture_of_order_id?string

For a capture order, the ID of the original order.

Formatuuid
void_of_order_id?string

For a void order, the ID of the original order.

Formatuuid
chargeback_of_order_id?string

For a chargeback order, the ID of the original order.

Formatuuid
chargeback_orders?array<>

IDs of the chargeback orders of this order.

reversal_of_order_id?string

For a reversal order, the ID of the original order.

Formatuuid
reversal_orders?array<>

IDs of the reversal orders of this order.

related_order_id?string

ID of the original order, for any order created from another one.

Formatuuid
related_orders?array<>

IDs of the orders created from this order.

related_payment_link_id?string

ID of the payment link the order was created from.

Formatuuid
curl -X POST 'https://api.pay.paytrim.com/v1/orders/8078d78f-8700-4cfe-94b1-4a777d3400f2/refunds/' \  -H 'Content-Type: application/json' \  -d '{  "amount": 1337,  "description": "Example refund"}'
{  "id": "97e825b2-c77d-4d56-aeaf-7af9c7c4087f",  "project_id": "05ad138f-52fa-40dc-9751-5fde949dcb57",  "merchant_id": "b251b220-5d8b-4b9d-9915-b89676dc0948",  "created": "2026-10-12T11:48:59.630958+00:00",  "completed": "2026-10-12T11:48:59.912726+00:00",  "currency": "EUR",  "amount": 1337,  "description": "Example refund",  "flags": [    "is-refund",    "is-test"  ],  "refund_of_order_id": "8189619d-748e-4333-81ee-fca65b1f47bc",  "status": "completed",  "transactions": [    {      "id": "8deb1542-fbe7-442e-9510-ea7c819e3bea",      "order_id": "97e825b2-c77d-4d56-aeaf-7af9c7c4087f",      "amount": 1337,      "currency": "EUR",      "credit_debit": "debit",      "payment_method": "credit-card-refund",      "payment_method_brand": "mastercard",      "refund_of_transaction_id": "6fbaeb49-6c55-408b-82ac-1b410db9fe1c",      "status": "accepted"    }  ]}