Choose a fiscal document
const url = 'https://api.timbro.dev/v1/payments/example/fiscal-document-choice';const options = { method: 'PUT', headers: { 'idempotency-key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"kind":"consumer","buyer":{"identityKind":"domestic","taxId":"example"},"governmentEligibility":{"entityKind":"central_government","authorityReference":"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.dev/v1/payments/example/fiscal-document-choice \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'idempotency-key: example' \ --data '{ "kind": "consumer", "buyer": { "identityKind": "domestic", "taxId": "example" }, "governmentEligibility": { "entityKind": "central_government", "authorityReference": "example" } }'Choose the fiscal document kind and buyer before payment submission.
Authorizations
Sección titulada «Authorizations»Parameters
Sección titulada «Parameters»Path Parameters
Sección titulada «Path Parameters»Payment to update.
Header Parameters
Sección titulada «Header Parameters»Caller-derived unique key, stable under retry. Printable ASCII. Required.
Request Bodyrequired
Sección titulada «Request Bodyrequired»The fiscal choice collected before payment submission.
The fiscal choice collected before payment submission.
object
Responses
Sección titulada «Responses»The bill projection safe for a scoped hosted-checkout or receipt holder.
The bill projection safe for a scoped hosted-checkout or receipt holder.
object
Payment identifier. Opaque; do not parse beyond the prefix.
partially_authorized means some shares have reserved funds, authorized means every share is reserved and awaits the organizer's capture command, capturing means capture is running, and releasing means reserved funds are being released. verifying is a real, non-terminal status; it is not an error or decline.
A monetary amount. Never a floating-point number.
object
ISO 4217 alphabetic code.
Amount in base-10 minor units of currency. DOP and USD use two decimal places, so 125000 is 1,250.00.
A monetary amount. Never a floating-point number.
object
ISO 4217 alphabetic code.
Amount in base-10 minor units of currency. DOP and USD use two decimal places, so 125000 is 1,250.00.
A monetary amount. Never a floating-point number.
object
ISO 4217 alphabetic code.
Amount in base-10 minor units of currency. DOP and USD use two decimal places, so 125000 is 1,250.00.
Merchant-owned searchable business reference. It is immutable after create, need not be unique, and does not identify command retries.
Merchant web destination offered after Checkout. Payment status must be retrieved from the API.
Merchant-authored context label such as Mesa 12.
Concise description of the product or service being purchased.
Server-computed money composition. The only totals a checkout page renders.
object
object
object
object
Read-only checkout presentation assembled from merchant configuration.
object
object
object
object
object
object
Card brands certified for this Payment's Merchant Account snapshot.
3-D Secure programs selected for this immutable Payment journey. An empty list means card submission does not use 3DS.
Send the customer to the hosted checkout page.
object
Open in a top-level browsing context.
Reconciliation progress while status is verifying.
object
object
object
object
object
Fiscal document identifier.
Payment that requested the fiscal document.
Whether fiscal issuance is required before Checkout presents the purchase as complete or may finish after the paid receipt is shown.
object
Whether this line belongs to the merchant's mandatory legal-tip base. Non-billable lines cannot be eligible.
object
object
object
object
object
object
object
object
Fiscal document identifier.
Payment that requested the fiscal document.
Whether fiscal issuance is required before Checkout presents the purchase as complete or may finish after the paid receipt is shown.
object
Whether this line belongs to the merchant's mandatory legal-tip base. Non-billable lines cannot be eligible.
object
object
object
object
object
object
object
object
Fiscal document identifier.
Payment that requested the fiscal document.
Whether fiscal issuance is required before Checkout presents the purchase as complete or may finish after the paid receipt is shown.
object
Whether this line belongs to the merchant's mandatory legal-tip base. Non-billable lines cannot be eligible.
object
object
object
object
object
object
object
object
Fiscal document identifier.
Payment that requested the fiscal document.
Whether fiscal issuance is required before Checkout presents the purchase as complete or may finish after the paid receipt is shown.
object
Whether this line belongs to the merchant's mandatory legal-tip base. Non-billable lines cannot be eligible.
object
object
object
object
object
object
object
object
Fiscal document identifier.
Payment that requested the fiscal document.
Whether fiscal issuance is required before Checkout presents the purchase as complete or may finish after the paid receipt is shown.
object
Whether this line belongs to the merchant's mandatory legal-tip base. Non-billable lines cannot be eligible.
object
object
object
object
object
object
object
object
Fiscal document identifier.
Payment that requested the fiscal document.
Whether fiscal issuance is required before Checkout presents the purchase as complete or may finish after the paid receipt is shown.
object
Whether this line belongs to the merchant's mandatory legal-tip base. Non-billable lines cannot be eligible.
object
object
object
object
object
object
object
object
Fiscal document identifier.
Payment that requested the fiscal document.
Whether fiscal issuance is required before Checkout presents the purchase as complete or may finish after the paid receipt is shown.
object
Whether this line belongs to the merchant's mandatory legal-tip base. Non-billable lines cannot be eligible.
object
object
object
object
object
object
object
Example
{ "object": "payment", "status": "requires_customer_action", "amount": { "currency": "DOP", "minorUnits": 125000 }, "voluntaryTip": { "currency": "DOP", "minorUnits": 125000 }, "totalAmount": { "currency": "DOP", "minorUnits": 125000 }, "breakdown": { "taxableBases": [ { "taxTreatment": "itbis_18" } ], "serviceCharges": [ { "kind": "propina_legal" } ] }, "checkoutDisplay": { "mode": "itemized", "merchant": { "deliveryPolicy": { "kind": "not_offered" } }, "fiscal": { "availableKinds": [ { "kind": "consumer", "buyerRequirement": "none" } ] }, "wallets": [ "apple_pay" ], "acceptedCardBrands": [ "visa" ], "threeDsPrograms": [ "visa_secure" ] }, "nextAction": { "kind": "redirect_to_url" }, "decline": { "code": "insufficient_funds" }, "paymentMethodSummary": { "kind": "card" }, "fiscalDocument": { "object": "fiscal_document", "kind": "consumer", "issuanceMode": "required", "buyer": { "identityKind": "domestic" }, "governmentEligibility": { "entityKind": "central_government" }, "lines": [ { "measurementUnit": "unit", "itemKind": "good", "taxTreatment": "itbis_18" } ], "status": "requested", "delivery": { "status": "waiting_for_document" } }}The request could not be understood or is not valid for this merchant account.
The request could not be understood or is not valid for this merchant account.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "invalid_request", "code": "parameter_missing" }}The credential is missing, malformed, or no longer valid.
The credential is missing, malformed, or no longer valid.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "authentication_error", "code": "api_key_missing" }}The credential is valid but not permitted to perform this operation on this resource.
The credential is valid but not permitted to perform this operation on this resource.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "permission_error", "code": "merchant_account_not_owned" }}No endpoint serves this method and path, or no resource with this identifier exists within the caller's tenant.
No endpoint serves this method and path, or no resource with this identifier exists within the caller's tenant.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "invalid_request", "code": "endpoint_not_found" }}The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "conflict_error", "code": "idempotency_key_reused" }}Default Response
The request is well-formed but cannot be carried out for this payment or this merchant account.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
The taxpayer cannot be used for this fiscal operation.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "invalid_request", "code": "merchant_account_not_ready" }}Too many requests. Retry after the interval in the Retry-After header.
Too many requests. Retry after the interval in the Retry-After header.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded" }}The gateway failed before reaching a payment outcome. Retry with the same Idempotency-Key.
The gateway failed before reaching a payment outcome. Retry with the same Idempotency-Key.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "api_error", "code": "internal_error" }}The payment provider rejected the request or could not be reached before anything was submitted. Safe to retry with the same Idempotency-Key.
The payment provider rejected the request or could not be reached before anything was submitted. Safe to retry with the same Idempotency-Key.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "provider_error", "code": "provider_unavailable" }}A required Gateway dependency is temporarily unavailable. The request is safe to retry.
A required Gateway dependency is temporarily unavailable. The request is safe to retry.
object
object
Stable machine-readable code. Branch on this, never on message.
Human-readable. Wording may change; not a stable contract.
Dotted path to the offending request field.
Correlation id, also returned as the Request-Id header.
Example
{ "error": { "type": "api_error", "code": "taxpayer_directory_unavailable" }}