Refunds
Create a full or partial refund
const url = 'https://api.timbro.do/v1/refunds';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authentication
Section titled “Authentication”Parameters
Section titled “Parameters”Header parameters
Section titled “Header parameters”Request bodyrequired
Section titled “Request bodyrequired”Creates a full refund when amount equals the remaining captured balance, or a partial refund for a lower amount.
object
Payment with captured money to refund.
Stable Refund identity. Retrying the same intent returns the current Refund; changed intent conflicts.
Optional fields
Immutable commercial source coordinate supplied by the merchant adapter.
object
An exact decimal monetary amount.
object
Example
DOPExact nonnegative decimal amount, with at most two fractional digits.
Exact returned ITBIS, never inferred proportionally. A full original refund uses captured tax when omitted.
object
Example
DOPExact nonnegative decimal amount, with at most two fractional digits.
Exact voluntary-tip portion of the refund’s returned money, excluded from the fiscal credit-note amount.
object
Example
DOPExact nonnegative decimal amount, with at most two fractional digits.
Responses
Section titled “Responses”A durable full or partial refund request. Provider money movement and fiscal note coordination are independent state machines.
Response fields and codes
A durable full or partial refund request. Provider money movement and fiscal note coordination are independent state machines.
object
Refund identifier.
Payment whose captured money is being returned.
Immutable commercial source coordinate supplied by the merchant adapter.
object
Immutable Refund identity within this merchant and TEST/LIVE mode.
An exact decimal monetary amount.
object
Example
DOPExact nonnegative decimal amount, with at most two fractional digits.
object
Captured allocation attributed to this refund.
An exact decimal monetary amount.
object
Example
DOPExact nonnegative decimal amount, with at most two fractional digits.
Refund lifecycle. verifying means the provider outcome is ambiguous and is being recovered without resubmitting the refund.
Provider outcome kept separate from fiscal credit-note coordination. Provider-specific references are not exposed.
object
Webhook event identifier related to this Refund.
Optional fields
Merchant label retained from the original refund request.
object
object
Normalized classification of an unresolved refund.
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
true when this response replays the stored result of an earlier request with the same Idempotency-Key.
A durable full or partial refund request. Provider money movement and fiscal note coordination are independent state machines.
Response fields and codes
A durable full or partial refund request. Provider money movement and fiscal note coordination are independent state machines.
object
Refund identifier.
Payment whose captured money is being returned.
Immutable commercial source coordinate supplied by the merchant adapter.
object
Immutable Refund identity within this merchant and TEST/LIVE mode.
An exact decimal monetary amount.
object
Example
DOPExact nonnegative decimal amount, with at most two fractional digits.
object
Captured allocation attributed to this refund.
An exact decimal monetary amount.
object
Example
DOPExact nonnegative decimal amount, with at most two fractional digits.
Refund lifecycle. verifying means the provider outcome is ambiguous and is being recovered without resubmitting the refund.
Provider outcome kept separate from fiscal credit-note coordination. Provider-specific references are not exposed.
object
Webhook event identifier related to this Refund.
Optional fields
Merchant label retained from the original refund request.
object
object
Normalized classification of an unresolved refund.
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
true when this response replays the stored result of an earlier request with the same Idempotency-Key.
The request could not be understood.
Example
{ "type": "about:blank", "title": "The request could not be understood.", "status": 400, "code": "parameter_missing", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
The credential is missing, malformed, or no longer valid.
Example
{ "type": "about:blank", "title": "The credential is missing, malformed, or no longer valid.", "status": 401, "code": "api_key_missing", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
The credential is valid but not permitted to perform this operation.
Example
{ "type": "about:blank", "title": "The credential is valid but not permitted to perform this operation.", "status": 403, "code": "operation_not_permitted", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
No endpoint serves this method and path, or no resource with this identifier exists within the caller’s scope.
Example
{ "type": "about:blank", "title": "No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.", "status": 404, "code": "payment_not_found", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
Example
{ "type": "about:blank", "title": "The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.", "status": 409, "code": "refund_reference_conflict", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
Seconds to wait before repeating this request or reading the resource again.
The request body is larger than this endpoint accepts.
Example
{ "type": "about:blank", "title": "The request body is larger than this endpoint accepts.", "status": 413, "code": "request_body_too_large", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
The request body carries a content type this endpoint does not accept.
Example
{ "type": "about:blank", "title": "The request body carries a content type this endpoint does not accept.", "status": 415, "code": "unsupported_media_type", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
The request is well-formed but cannot be carried out.
Example
{ "type": "about:blank", "title": "The request is well-formed but cannot be carried out.", "status": 422, "code": "refund_tip_amount_invalid", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
The request could not complete. Recover by the retained resource reference or retry with the same command identity.
Example
{ "type": "about:blank", "title": "The request could not complete. Recover by the retained resource reference or retry with the same command identity.", "status": 500, "code": "internal_error", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
A required service is temporarily unavailable. Retry with the same reference or command identity.
Example
{ "type": "about:blank", "title": "A required service is temporarily unavailable. Retry with the same reference or command identity.", "status": 503, "code": "integration_authorization_unavailable", "requestId": "request_000000000000000000000001"}Response fields and codes
RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows code to the subset it can emit.
object
Stable machine-readable code. Branch on this, never on title.
Optional fields
Present only when the rejected request produced a Fiscal operation.
Present only when the authoritative issuance rules refused to issue.
Present only when the rejection points at a value the request carried.
One stable public document problem retained for a rejected admission.
object
Headers
Section titled “Headers”Identifies this request. Quote it when you contact support.
Seconds to wait before repeating this request or reading the resource again.