Delivery notes

Issue delivery note

POST
/v1/ec/delivery-notes

A delivery note ("guía de remisión") supports moving goods: it has no amounts. Give where the goods leave from (origin_address), the carrier and its vehicle plate, when the transport starts and ends (transport_start not before today), and the recipients, each with its address, why the goods move (reason), its items and, for a sale, the invoice behind it in support_document.

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/delivery-notes/preview, which spends no number, and pass its preview_id to issue exactly what was previewed. Send an Idempotency-Key to retry without duplicating.

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

wait?|

Seconds, up to 25, to wait for the SRI's decision before answering: the answer comes as soon as the document leaves pending and submitted (authorized, returned or not_authorized), or when the time runs out, still undecided. Without it, at once. The SRI usually decides within seconds; when it is slow, keep the webhook or retrieve the document later.

Range0 <= value <= 25
preview_id?string

The preview_id of POST /v1/ec/delivery-notes/preview for this same body: if the body isn't the one previewed, or the preview is from an earlier day, nothing is issued and the answer is 409 preview_mismatch.

Match^[0-9a-f]{64}$

Header Parameters

idempotency-key?string
Length1 <= length <= 255

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.

origin_address*string
Match^[^\n\r]*$
Length1 <= length <= 300
carrier*||
plate*string
Match^[A-Z0-9-]{1,20}$
transport_start*string
Formatdate
transport_end*string
Formatdate
recipients*array<>
Items1 <= items
fiscal_machine?

The fiscal machine the document is issued from (annex 13). Only when one issues it.

additional_info?array<>
Default[]
establishment?string

The establishment whose series numbers it, such as 001. Without it, the first active series of the document type.

Match^\d{3}$
emission_point?string

The emission point of that establishment, such as 001. Without it, the first active one.

Match^\d{3}$
metadata?

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).

Default{}
simulate?

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/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/v1/ec/delivery-notes" \  -H "Content-Type: application/json" \  -d '{    "origin_address": "string",    "carrier": {      "identification_type": "ruc",      "identification": "string",      "name": "string"    },    "plate": "string",    "transport_start": "2019-08-24",    "transport_end": "2019-08-24",    "recipients": [      {        "identification": "string",        "name": "string",        "address": "string",        "email": "user@example.com",        "reason": "string",        "items": [          {            "description": "string",            "quantity": "string"          }        ]      }    ]  }'
{  "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": "delivery_note",  "issue_date": "string",  "origin_address": "string",  "carrier": {    "identification_type": "ruc",    "identification": "string",    "name": "string"  },  "plate": "string",  "transport_start": "string",  "transport_end": "string",  "recipients": [    {      "identification": "string",      "name": "string",      "address": "string",      "email": "string",      "reason": "string",      "route": "string",      "customs_document": "string",      "destination_establishment": "string",      "support_document": {        "document_type": "factura",        "number": "string",        "issue_date": "string",        "authorization_number": "string"      },      "items": [        {          "code": "string",          "auxiliary_code": "string",          "description": "string",          "quantity": "string",          "additional_info": [            {              "name": "string",              "value": "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"}