Skip to content
Documentation
Get started

Refunds

Create a full or partial refund

POST
/v1/refunds
curl --request POST \
--url https://api.timbro.do/v1/refunds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "paymentId": "example", "source": { "id": "example", "version": "example" }, "refundReference": "example", "amount": { "currency": "DOP", "value": "example" }, "taxAmount": { "currency": "DOP", "value": "example" }, "voluntaryTipAmount": { "currency": "DOP", "value": "example" }, "allocationIds": [ "example" ] }'

Creates a durable refund request against captured Payment money. The request records exact allocation attribution before any provider work begins. refundReference is the immutable identity of this refund within the merchant and mode. Retrying it with the same caller intent returns the current Refund; changing the intent returns a conflict. Omitting amount reserves the remaining captured balance for the selected allocations when the Refund is first created. voluntaryTipAmount declares the exact returned voluntary-tip portion. For a partial refund it defaults to zero; refunding the entire remaining captured balance includes the remaining tip. Each portion must fit its own captured balance. Voluntary tips are excluded from the credit-note amount. source is optional for ERP coordination. When supplied, its immutable ID and version cannot identify a different Refund. taxAmount declares the exact returned ITBIS, never a proportional estimate. Refunding the original full captured balance uses its retained tax when omitted; an explicit amount must match. Later refunds preserve caller-declared tax within the remaining captured tax, and omission leaves it unproven. A Refund is submitted without an operator for the full captured amount of an unsplit DOP TEST card Payment with no earlier Refund other than declined ones. An eligible Azul Sale can instead return one lower amount with an explicit exact taxAmount, within refundable.automaticPartial limits. Partial refunds of authorization captures, CardNet, split, LIVE, wallet, and sandbox Payments remain operator_required. Azul retains the original full capture binding and credentials, submits the exact returned amount and tax on a unique correlation, and requires matching VerifyPayment inquiry. CardNet full refunds use the captured Ztrans transaction and active refund credential; before CardNet’s 7:00 p.m. close, when CardNet refuses the Refund, the same request voids the Sale instead. Read refundable.automaticAmount for the full amount and refundable.automaticPartial for partial support. A submitted Refund can still end declined or operator_required. A successful provider refund never creates a fiscal credit or debit note; associate the accepted credit-note Invoice separately. When Idempotency-Key is omitted, the Refund reference supplies a stable retry key. If a key is provided, reuse it for retries. Retrieve the Refund to confirm its current state.

idempotency-key
string
>= 1 characters <= 255 characters /^[\x20-\x7e]+$/
Media typeapplication/json

Creates a full refund when amount equals the remaining captured balance, or a partial refund for a lower amount.

object
paymentId
required

Payment with captured money to refund.

string
/^payment_[0-9a-hjkmnp-tv-z]{24,}$/
refundReference
required

Stable Refund identity. Retrying the same intent returns the current Refund; changed intent conflicts.

string
>= 1 characters <= 128 characters
Optional fields
source

Immutable commercial source coordinate supplied by the merchant adapter.

object
id
required
string
>= 1 characters <= 256 characters
version
required
string
>= 1 characters <= 128 characters
amount

An exact decimal monetary amount.

object
currency
required

Example

DOP
string
/^[A-Z]{3}$/
value
required

Exact nonnegative decimal amount, with at most two fractional digits.

string
/^(0|[1-9][0-9]{0,15})(\.[0-9]{1,2})?$/
taxAmount

Exact returned ITBIS, never inferred proportionally. A full original refund uses captured tax when omitted.

object
currency
required

Example

DOP
string
/^[A-Z]{3}$/
value
required

Exact nonnegative decimal amount, with at most two fractional digits.

string
/^(0|[1-9][0-9]{0,15})(\.[0-9]{1,2})?$/
voluntaryTipAmount

Exact voluntary-tip portion of the refund’s returned money, excluded from the fiscal credit-note amount.

object
currency
required

Example

DOP
string
/^[A-Z]{3}$/
value
required

Exact nonnegative decimal amount, with at most two fractional digits.

string
/^(0|[1-9][0-9]{0,15})(\.[0-9]{1,2})?$/
allocationIds
Array<string>
>= 1 items <= 100 items

A durable full or partial refund request. Provider money movement and fiscal note coordination are independent state machines.

Media typeapplication/json
Response fields and codes

A durable full or partial refund request. Provider money movement and fiscal note coordination are independent state machines.

object
id
required

Refund identifier.

string
/^refund_[0-9a-hjkmnp-tv-z]{24,}$/
object
required
string
Allowed value: refund
paymentId
required

Payment whose captured money is being returned.

string
/^payment_[0-9a-hjkmnp-tv-z]{24,}$/
source
required

Immutable commercial source coordinate supplied by the merchant adapter.

object
id
required
string
>= 1 characters <= 256 characters
version
required
string
>= 1 characters <= 128 characters
refundReference
required

Immutable Refund identity within this merchant and TEST/LIVE mode.

string
>= 1 characters <= 128 characters
amount
required

An exact decimal monetary amount.

object
currency
required

Example

DOP
string
/^[A-Z]{3}$/
value
required

Exact nonnegative decimal amount, with at most two fractional digits.

string
/^(0|[1-9][0-9]{0,15})(\.[0-9]{1,2})?$/
taxAmount
required
Any of:

Exact returned ITBIS, never inferred proportionally. A full original refund uses captured tax when omitted.

object
currency
required

Example

DOP
string
/^[A-Z]{3}$/
value
required

Exact nonnegative decimal amount, with at most two fractional digits.

string
/^(0|[1-9][0-9]{0,15})(\.[0-9]{1,2})?$/
voluntaryTipAmount
required
Any of:

Exact voluntary-tip portion of the refund’s returned money, excluded from the fiscal credit-note amount.

object
currency
required

Example

DOP
string
/^[A-Z]{3}$/
value
required

Exact nonnegative decimal amount, with at most two fractional digits.

string
/^(0|[1-9][0-9]{0,15})(\.[0-9]{1,2})?$/
allocationIds
required
Array<string>
allocationAmounts
required
Array<object>
object
id
required

Captured allocation attributed to this refund.

string
/^payment_allocation_[0-9a-hjkmnp-tv-z]{24,}$/
amount
required

An exact decimal monetary amount.

object
currency
required

Example

DOP
string
/^[A-Z]{3}$/
value
required

Exact nonnegative decimal amount, with at most two fractional digits.

string
/^(0|[1-9][0-9]{0,15})(\.[0-9]{1,2})?$/
kind
required
Any of:
string
Allowed value: partial
status
required

Refund lifecycle. verifying means the provider outcome is ambiguous and is being recovered without resubmitting the refund.

string
Allowed values: processing succeeded declined verifying operator_required
providerOutcome
required

Provider outcome kept separate from fiscal credit-note coordination. Provider-specific references are not exposed.

object
status
required
string
Allowed values: not_attempted pending succeeded declined unknown operator_required
lastAttemptAt
required
Any of:
string format: date-time
nextRetryAt
required
Any of:
string format: date-time
message
string
>= 1 characters <= 500 characters
reasonCode
string
>= 1 characters <= 128 characters
invoiceId
required
Any of:
string format: uuid
webhookEvents
required
Array<object>
object
id
required

Webhook event identifier related to this Refund.

string
/^event_[0-9a-hjkmnp-tv-z]{24,}$/
type
required
string
>= 1 characters <= 128 characters
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Optional fields
merchantReference

Merchant label retained from the original refund request.

string
>= 1 characters <= 128 characters
completedAt
string format: date-time
decline
object
code
required
string
Allowed value: refund_declined
canTryAgain
required
boolean
message
required
string
>= 1 characters <= 256 characters
problem
object
code
required

Normalized classification of an unresolved refund.

string
Allowed values: provider_refund_capability_not_qualified refund_recovery_exhausted refund_provider_reference_unavailable refund_provider_credentials_rejected
message
required
string
>= 1 characters <= 256 characters
request-id
required
string

Identifies this request. Quote it when you contact support.

Idempotent-Replayed
string
Allowed value: true

true when this response replays the stored result of an earlier request with the same Idempotency-Key.