Preview withholding
Checks the body of POST /v1/ec/withholdings and computes the document as it would be issued today, without numbering, storing or sending anything. What is wrong with the body is refused with 422, as issuing would refuse it; what would stop issuing it right now (no plan, certificate or numbering, a business not live yet, the spending cap reached) comes back in warnings. Pass its preview_id to POST /v1/ec/withholdings?preview_id=… to issue exactly this body.
Your API key, which acts for the one business it was created for: fb_sandbox_… issues in sandbox, fb_test_… in test, the tax authority's testing service, and fb_live_… in live.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
The issue date is always today in Ecuador: documents are transmitted when issued.
Natural person or company (tipoSujetoRetenido), required if the supplier has a foreign identification.
Value in
- "persona_natural"
- "sociedad"
Whether the supplier is a related party (parteRel).
falseThe supplier's documents that support the withholding.
1 <= itemsThe fiscal machine the document is issued from (annex 13). Only when one issues it.
[]The establishment whose series numbers it, such as 001. Without it, the first active series of the document type.
^\d{3}$The emission point of that establishment, such as 001. Without it, the first active one.
^\d{3}$Up to 20 pairs of your own, such as your order id, returned as sent and never interpreted; lists filter by them (metadata[key]=value).
{}Only with a sandbox key (422 in test and live, where the SRI decides): the outcome the simulator gives this revision, to rehearse how your system handles each one. Without it, it is authorized.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/v1/ec/withholdings/preview" \ -H "Content-Type: application/json" \ -d '{ "supplier": { "identification_type": "ruc", "identification": "string", "name": "string", "email": "user@example.com" }, "support_documents": [ { "document_type": "factura", "number": "string", "issue_date": "2019-08-24", "tax_support": "10", "subtotal": "string", "total": "string", "taxes": [ { "type": "iva", "rate": "iva_15", "base": "string", "value": "string" } ], "withholdings": [ { "tax": "renta", "code": "strin", "base": "string" } ], "payments": [ { "method": "sin_sistema_financiero" } ] } ] }'{ "object": "document_preview", "type": "withholding", "preview_id": "stringstringstringstringstringstringstringstringstringstringstri", "environment": "sandbox", "entity_id": "8161163a-f227-466f-bc01-090a01e80165", "issue_date": "2019-08-24", "total": "string", "tax_total": "string", "warnings": [ { "code": "string", "message": "string", "detail": "string" } ], "document": { "issue_date": "string", "fiscal_period": "string", "supplier": { "identification_type": "ruc", "identification": "string", "name": "string", "address": "string", "email": "string" }, "supplier_type": "persona_natural", "related_party": true, "support_documents": [ { "document_type": "factura", "number": "string", "issue_date": "string", "authorization_number": "string", "accounting_date": "string", "tax_support": "10", "foreign_payment": { "regime": "general", "country": "string", "double_taxation_treaty": true, "subject_to_withholding": true, "preferential_regime_payment": true }, "subtotal": "string", "total": "string", "taxes": [ { "type": "iva", "rate": "iva_15", "base": "string", "value": "string" } ], "withholdings": [ { "tax": "renta", "code": "string", "percent": "string", "base": "string", "value": "string", "dividends": { "payment_date": "string", "income_tax_paid": "string", "fiscal_year": "string" }, "banana_boxes": { "boxes": 0, "box_price": "string" } } ], "reimbursement": { "document_type": "factura", "total": "string", "base": "string", "tax": "string", "documents": [ { "supplier": { "identification_type": "ruc", "identification": "string" }, "supplier_type": "persona_natural", "payment_country": "string", "document_type": "factura", "number": "string", "issue_date": "string", "authorization_number": "string", "taxes": [ { "type": "iva", "rate": "iva_15", "base": "string", "value": "string" } ], "compensations": [ { "code": "string", "rate": "string", "value": "string" } ] } ] }, "payments": [ { "method": "sin_sistema_financiero", "amount": "string", "term": { "length": 0, "unit": "days" } } ] } ], "renta": "string", "iva": "string", "isd": "string", "total": "string", "fiscal_machine": { "brand": "string", "model": "string", "serial": "string" }, "additional_info": [ { "name": "string", "value": "string" } ] }}List withholdings GET
From newest to oldest, in your key's environment.
Retrieve withholding GET
The document with its current status and its access key, as Fiscalbase knows it. It only reads: it does not ask the SRI at that moment; for that there is `POST /v1/ec/documents/{id}/refresh-status`. Send `wait` to answer once the SRI decides on a `pending` or `submitted` one.