Withholdings

List withholdings

GET
/v1/ec/withholdings

From newest to oldest, in your key's environment.

Authorization

AuthorizationBearer <token>

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

Query Parameters

limit?integer

How many per page, from 1 to 100.

Range1 <= value <= 100
Default20
cursor?string

The next_cursor or prev_cursor of a previous response. Without a cursor, the first page.

Lengthlength <= 200
status?|array<>

Only in these statuses; repeat it for several (status=returned&status=not_authorized).

channel?|array<>

Only those that arrived through these channels; repeat it for several.

counterparty?string

The identification of the document's buyer or supplier; on a delivery note, that of the carrier or of any of its recipients.

q?string

Searches words in the number (001-001-000000123), the access key, the name of whoever appears on the document (ignoring case and accents) or the start of their identification. Each word must appear somewhere; it combines with the other filters.

Length1 <= length <= 100
issue_date[gte]?string
Formatdate
issue_date[lte]?string
Formatdate
created_at[gte]?string
Formatdate-time
created_at[lte]?string
Formatdate-time
metadata?

Only the documents whose metadata has exactly these pairs, for example metadata[shopify_order_id]=5812345678901. Up to 20; all must match.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/v1/ec/withholdings"
{  "object": "list",  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "country": "ec",      "currency": "string",      "environment": "sandbox",      "status": "pending",      "status_transitions": {        "pending": "2019-08-24T14:15:22Z",        "submitted": "2019-08-24T14:15:22Z",        "authorized": "2019-08-24T14:15:22Z",        "returned": "2019-08-24T14:15:22Z",        "not_authorized": "2019-08-24T14:15:22Z",        "annulled": "2019-08-24T14:15:22Z"      },      "entity_id": "8161163a-f227-466f-bc01-090a01e80165",      "number": "string",      "access_key": "stringstringstringstringstringstringstringstrings",      "authorization": {        "number": "string",        "authorized_at": "2019-08-24T14:15:22Z"      },      "sri_messages": [        {          "code": "string",          "message": "string",          "detail": "string",          "type": "error",          "cause": "string",          "remedy": "string"        }      ],      "metadata": {        "property1": "string",        "property2": "string"      },      "issued_at": "2019-08-24T14:15:22Z",      "delivery_status": "sent",      "emails": [        {          "to": "string",          "status": "sent",          "sent_at": "2019-08-24T14:15:22Z",          "delivered_at": "2019-08-24T14:15:22Z",          "opened_at": "2019-08-24T14:15:22Z",          "bounced_at": "2019-08-24T14:15:22Z",          "complained_at": "2019-08-24T14:15:22Z",          "bounce_type": "permanent"        }      ],      "portal_views": 0,      "portal_last_viewed_at": "2019-08-24T14:15:22Z",      "channel": "api",      "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",      "verification": "sri",      "listing": {        "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",        "file": "string",        "entry": "string",        "sha256": "stringstringstringstringstringstringstringstringstringstringstri",        "line": 1,        "authorized_at": "2019-08-24T14:15:22Z"      },      "object": "withholding",      "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"        }      ],      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string",  "prev_cursor": "string",  "total_count": 0,  "offset": 0}

Issue withholding POST

A withholding receipt ("comprobante de retención") records what you, as the buyer, withhold of renta, IVA or ISD from a supplier's documents. Give the `supplier` and, in `support_documents`, each document withheld from (usually the supplier's invoice: its number, date, access key, `tax_support`, subtotal, total, taxes and payments) with its `withholdings`. `POST /v1/ec/withholding-suggestions` builds that entry from the invoice's access key, with the renta code and IVA percent that apply; `GET /v1/ec/catalogs/renta_withholdings`, `iva_withholdings` and `tax_support` explain the codes. Issuing numbers the document, stores it and queues it to be signed and sent to the SRI, all at once: the issue date is today in Ecuador. The status then advances on its own (`pending`, `submitted`, then `authorized`, `returned` or `not_authorized`): send `wait` to answer once the SRI decides, or retrieve it or receive a webhook. A refused document says why in `sri_messages`, each with its `remedy`. Check the body first with `POST /v1/ec/withholdings/preview`, which spends no number, and pass its `preview_id` to issue exactly what was previewed. Send an `Idempotency-Key` to retry without duplicating.

Preview withholding POST

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.