Guides

Change Guide State

Changes the state of guide documents (shippings, transports, devolutions).

FromToEvent
draftfinalfinalized
draftdeleteddeleted
finalcanceledcanceled
put/{guides-type}/{document-id}/change-state.json

Path parameters

guides-type'shippings' | 'transports' | 'devolutions' required

The type of the guide document.

document-idinteger required
Example:1050

The ID of the document.

Query parameters

api_keystring required
Example:YOUR_API_KEY

Your API Key.

Request body

Example request

{
  "shipping": {
    "state": "finalized",
    "message": "Wrong value"
  }
}

Response

SUCCESS

Possible values for field atcud:

  • ABCD1234-1 (or similar) - Unique document identifier to the Tax Authority, when the sequence is registered.
  • N/D - The document's sequence is relevant for ATCUD but is not registered in the Tax Authority.
  • N/A - The document's sequence is not relevant for ATCUD and is not registered in the Tax Authority.

Example response

{
  "shipping": {
    "id": 541797,
    "status": "final",
    "type": "Shipping",
    "sequence_number": "1/D",
    "inverted_sequence_number": "D/1",
    "atcud": "ABCD1234-1",
    "date": "13/07/2017",
    "due_date": "27/07/2026",
    "loaded_at": "27/07/2026 23:00:00",
    "license_plate": "11-AA-22",
    "permalink": "https://web.invoicexpress.com/documents/541797d75bbee48911934cbd4a4294946a324295f52b08",
    "saft_hash": "vaDf",
    "sum": 1,
    "before_taxes": 1,
    "taxes": 0.07,
    "total": 1.07,
    "currency": "Euro",
    "address_from": {
      "country": "Portugal",
      "postal_code": "1050-083",
      "detail": "Avenida Duque D'Avila, 46 - 3ºA",
      "city": "Lisboa"
    },
    "address_to": {
      "country": "Portugal",
      "postal_code": "4000-327",
      "detail": "Avenida dos Aliados",
      "city": "Porto"
    },
    "client": {
      "id": 1310176,
      "name": "John",
      "country": "Portugal"
    },
    "items": [
      {
        "name": "iPhone",
        "unit_price": "1.0",
        "unit": "service",
        "quantity": "1.0",
        "tax": {
          "id": 31597,
          "name": "IVA7",
          "value": 7
        },
        "subtotal": 1,
        "tax_amount": 0.07,
        "total": 1.07
      }
    ],
    "sequence_id": 12345,
    "tax_exemption": "M01",
    "at_doc_code_id": "999"
  }
}

Changes

Changed in 1 of the 2 revisions of this API.1012

  • 5b82d4eb0d9f1012See the full diff
    • the response property shipping/at_doc_code_id became nullable for the status 200

      response-property-became-nullable

    • the response property shipping/items/items/description became nullable for the status 200

      response-property-became-nullable

    • the response property shipping/items/items/unit became nullable for the status 200

      response-property-became-nullable

    • the response property shipping/license_plate became nullable for the status 200

      response-property-became-nullable

    • the response property shipping/observations became nullable for the status 200

      response-property-became-nullable

    • the response property shipping/reference became nullable for the status 200

      response-property-became-nullable

    • the response property shipping/retention became nullable for the status 200

      response-property-became-nullable

    • the response property shipping/sequence_id became nullable for the status 200

      response-property-became-nullable

    • the errors response's property type/format changed from object/ to array/ for status 401

      response-property-type-changed

    • the shipping/sequence_id response's property type/format changed from string/ to integer null/ for status 200

      response-property-type-changed

    • removed the optional property errors/error from the response with the 401 status

      response-optional-property-removed

    • added the optional property shipping/loaded_at to the response with the 200 status

      response-optional-property-added

    • the response optional property shipping/at_doc_code_id became read-only for the status 200

      response-optional-property-became-read-only

    This revision also has 10 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog