Refunds
Attach an accepted credit-note Invoice to a refund
const url = 'https://api.timbro.do/v1/refunds/example/invoice';const options = { method: 'PUT', headers: { 'idempotency-key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"invoiceId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","receipt":{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","accessToken":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.timbro.do/v1/refunds/example/invoice \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'idempotency-key: example' \ --data '{ "invoiceId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "receipt": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "accessToken": "example" } }'Verifies the E34 Invoice against the original Invoice, issuer, environment, currency, and refund amount. Independent Sources supply a restricted receipt credential. This association does not change the provider refund outcome. Retry with the same Idempotency-Key, and retrieve the Refund to confirm its current state.
Authentication
Section titled “Authentication”Parameters
Section titled “Parameters”Path parameters
Section titled “Path parameters”Refund associated with the credit note.
Header parameters
Section titled “Header parameters”Request bodyrequired
Section titled “Request bodyrequired”Examplegenerated
{ "invoiceId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "receipt": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "accessToken": "example" }}Associates an accepted credit-note Invoice after verifying its original Invoice, issuer, environment, currency, and amount. An independent Source supplies its restricted receipt credential.
object
The accepted E34 Invoice for this refund’s original Invoice.
Optional fields
object
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.
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": "route_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_invoice_not_ready", "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 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.