# Qargo TMS API

For support, please contact integrations@qargo.com.
# Overview

<div style="background: linear-gradient(135deg, #1C2C31 0%, #304045 100%); color: white; padding: 20px; border-radius: 10px; margin: 20px 0;">
  <h2 style="color: white; margin-top: 0;">Tenant API Documentation</h2>
  <p style="font-size: 16px; margin-bottom: 0;">You are currently viewing the <strong>Tenant API Documentation</strong>. This API provides access to tenant-level integrations and operational endpoints.</p>
</div>

<br/>

### Documentation for Other Parties

<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 30px 0;">

<div style="border: 2px solid #00E85B; border-radius: 10px; padding: 20px; background: #F4FBF7; transition: transform 0.2s;">
  <h3 style="color: #36BB6B; margin-top: 0;">Subcontractor API</h3>
  <p>Fleet dispatch and subcontractor-specific endpoints for transportation management.</p>
  <div style="text-align: center; margin-top: 15px;">
    <a href="/subcontractor/docs" style="
      display: inline-block;
      background: #00E85B;
      color: white;
      padding: 12px 24px;
      text-decoration: none;
      border-radius: 6px;
      font-weight: bold;
      transition: background 0.3s;
    ">Subcontractor Documentation</a>
  </div>
</div>

<div style="border: 2px solid #6F82FB; border-radius: 10px; padding: 20px; background: #F4FBF7; transition: transform 0.2s;">
  <h3 style="color: #6F82FB; margin-top: 0;">Customer API</h3>
  <p>Customer portal endpoints for order tracking, status monitoring, and customer-facing operations.</p>
  <div style="text-align: center; margin-top: 15px;">
    <a href="/customer/docs" style="
      display: inline-block;
      background: #6F82FB;
      color: white;
      padding: 12px 24px;
      text-decoration: none;
      border-radius: 6px;
      font-weight: bold;
      transition: background 0.3s;
    ">Customer Documentation</a>
  </div>
</div>

</div>

# Authentication

The api requires oauth2 authentication with client id/secret. This should only be used for service to service communication.

## Creating application credentials

Application client credentials can be created by users with the `Super admin` role in the Qargo application.
Users can create and remove application clients by navigating to Configuration -> Organisation Settings (API clients sections).

Applications need to be linked to a valid integration id, identifying the Qargo approved integrator.
Please contact [us](mailto:integrations@qargo.com) if you don't have an id yet.

## Obtaining an access token

To interact with the API, you need a valid access token in JWT (JSON Web Token) format. This token authenticates your requests and authorizes access to protected endpoints. The process involves using Basic Authentication to request the token via the `/auth/token` endpoint.

The [/auth/token endpoint](#tag/API-Authentication/operation/generate_token_v1_auth_token_post) can be used to generate an access token (JWT):

This token will need to be refreshed after expiration (we provide the 'expires_in' in the token response to check validity).

### Understanding Basic Authentication

Basic Authentication is a simple HTTP authentication scheme that allows clients to provide credentials (such as a client ID and secret) directly in the request header. It works by encoding the credentials in Base64 and including them in the `Authorization` header of the HTTP request. For example:

- **Format**: `Authorization: Basic <base64-encoded-credentials>`
- **Credentials Encoding**: The client ID and secret are concatenated with a colon (e.g., `client_id:secret_id`) and then Base64-encoded.

### The API Call to Request Tokens

The `/auth/token` endpoint ([API reference](#tag/API-Authentication/operation/generate_token_v1_auth_token_post)) is a POST request used to generate a JWT access token. You authenticate this request using Basic Auth with your provided `client_id` and `secret_id`.

#### Request Details

- **Method**: POST
- **URL**: `https://api.qargo.com/v1/auth/token`
- **Headers**:
  - `Content-Type: application/json`
  - `Authorization: Basic <base64-encoded-client_id:secret_id>`
- **Body**: Empty.
- **Parameters**: None.

Example using `curl`:

```
curl -XPOST https://api.qargo.com/v1/auth/token -H 'Content-type: application/json' -u '<client_id:secret_id>'
```

## Webhook authentication

> **Important:** Webhook endpoints use a **different authentication method** than regular API endpoints. Do not use OAuth tokens for webhooks.

Qargo webhooks, such as those for order import and status updates, use **Basic Authentication** instead of OAuth. See [Understanding Basic Authentication](#understanding-basic-authentication) for details on the Basic Auth scheme.

When setting up a webhook integration in Qargo, you will be provided with dedicated webhook credentials (client id and secret id). These are **separate from your API credentials** and must be used exclusively for webhook endpoints.

### API vs Webhook authentication summary

| | **API endpoints** | **Webhook endpoints** |
|---|---|---|
| **Auth method** | OAuth2 (Client Credentials) | Basic Authentication |
| **Credentials** | API client_id + secret_id → Bearer JWT token | Webhook client_id + secret_id (directly in header) |
| **Header format** | `Authorization: Bearer <jwt_token>` | `Authorization: Basic <base64(client_id:secret_id)>` |
| **Where to find credentials** | Configuration → Organisation Settings → API clients | Configuration → Integrations → (your integration) → Incoming API credentials |
| **Token refresh needed?** | Yes (JWT expires) | No (credentials sent with each request) |

### Common mistake

Webhook credentials can technically be used to obtain an OAuth token via the `/auth/token` endpoint, but this token **will not work** for authenticating webhook requests. Always use Basic Authentication with your webhook credentials directly in the `Authorization` header.

### Example webhook request

```
curl -XPOST https://api.qargo.com/v1/webhook/order-import \
  -H 'Content-Type: application/json' \
  -u '<webhook_client_id>:<webhook_secret_id>' \
  -d '{ ... }'
```

# Rate Limits

To maintain API stability and prevent abuse, we enforce rate limits on a per-tenant basis.

### Limits

The limits below are estimates based on normal operating conditions. Under increased system load, these limits may be tightened without prior notice to protect API stability.

| **Category** | **Scope** | **Limit** |
| --- | --- | --- |
| Authentication | `/auth/token` | 5 requests per hour |
| General API Usage | All endpoints *except* authentication and webhooks | 2 requests per second (sustained); up to 3 per second (bursts) |

### Enforcement

Rate limits are enforced by tracking requests over several sliding time windows-per second, per 10 minutes, and per hour. Exceeding any of these limits will result in an HTTP `429 Too Many Requests` response. The response includes a `Retry-After` header specifying the number of seconds your application should wait before making a new request.

Example response:
```http
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 58

{"error":"Rate limit exceeded"}
```

Applications must handle this response correctly by respecting the `Retry-After` header and retrying after the specified delay, regardless of whether the request appeared to be within the estimated limits.

For any concerns about these limits, please contact us at [integrations@qargo.com](mailto:integrations@qargo.com).

# API Best Practices

This section outlines recommended practices for efficiently working with the Qargo API.

## Pagination

Some list endpoints support pagination. This means the endpoint offers a `next_cursor` in the response payload and accepts a `cursor` as query parameter. If pagination is supported and their response contains a `next_cursor` property, then you can use the `cursor` as a query parameter in a subsequent request to fetch the next page of results. Using query parameters is mutually exclusive with using the cursor.

<br/>

### How Pagination Works

1. **Initial Request**: Make a request to a paginated endpoint without any cursor parameter
2. **Check Response**: If the response includes a `next_cursor` field, more data is available
3. **Subsequent Requests**: Use the `next_cursor` value as the `cursor` parameter in your next request
4. **Continue**: Repeat until no `next_cursor` is returned

<br/>

### Example Usage

```http
GET /api/v1/orders
```

Response:
```json
{
  "data": [...],
  "next_cursor": "eyJpZCI6MTIzfQ=="
}
```

Next request:
```http
GET /api/v1/orders?cursor=eyJpZCI6MTIzfQ==
```
</br>

### Recommendations

- Always check for the presence of `next_cursor` before making additional requests
- Store cursor values temporarily; they may expire after a certain period
- Avoid using other query parameters when using cursor-based pagination

# Concepts

## Company

A company in Qargo can be both a customer as well as a subcontractor (supplier).
The entity will have a single id within Qargo. The api client can link companies by this id,
or by the accounting code, which is a user defined code field.

## Order

Transport order to execute. Also called job in other TMS systems. It contains all transport details:

- Order references
- Customer [company](#section/Concepts/Company)
- Consigments, with their [stop](#section/Concepts/Stop) locations, time windows, references
- Definition of the goods to transport

## Stop

- A stop is a part of a transport, at a certain date, optional timeslot and location.
  In addition to the planned times, it also tracks the actual times for a completed stop.
  Stops can be linked to [orders](#section/Concepts/Order), or can be defined standalone (for example a cleaning stop).
  All stops are linked to a Trip.

### Stop group

Stops can be grouped together according to their activity and location. This is called a stop group.

## Trip

A trip contains [stops](#section/Concepts/Stop) from various [orders](#section/Concepts/Order), or standalone [stops](#section/Concepts/Stop). It tracks how a certain
transport is planned, and who will execute that transport.

## Task

A task is the primary workflow concept in Qargo. Users can define their own flow,
using both built-in tasks as well a custom defined ones. For the current accounting use case,
we only expose the `post invoice/credit note` task, that allows users to send invoices to an accounting system.

## Resource

A resource in Qargo is a vehicle, driver, trailer or other entity that can be assigned to a [trip](#section/Concepts/Trip).

## Unavailability

An unavailability indicates that a specific [resource](<(#section/Concepts/Resource)>) is not available for use for a given time range. An unavailability has a reason to indicate why the resource is not available.

## Status update

A status update reflects a status change in an entity.

## Document

A document in Qargo can be identified by a unique id. It has a type and is linked to a certain entity (for example an order).

# Postman collection

We have a [postman](https://www.postman.com/downloads/) collection [available](/docs/postman.json "download")
with interactive examples (right click to download). Download this to a local folder, and import it into Postman for usage.

### Instructions

- Make sure you have a Postman client available. This can either be a local installed version or the web based version.
- Request credentials for the Qargo API for order creation
- Download and import the collection
- Set the collection variables username and password with the credentials received
- Execute the Request Access token request in the Authentication folder. You have now a valid access key for 1 hour. If you get the error message that the key is no longer valid, please refresh the access key by invoking this endpoint again.
- You can now explore the different order endpoints

# Functionality

The api exposes the following functionality:

- Order management: create/update and get the status of transport orders.
- Retrieve trip information: retrieve information about Qargo [trips](#section/Concepts/Trip).
- Visibility: send events to an external system using webhooks.
- Order dispatch: send transport orders to a 3rd party using webhooks.
- Accounting: interface an accounting system using the api endpoints.
- Documents: interface to download documents

## Order management

Available functionality:

- Create [orders](#section/Concepts/Order) in Qargo and track order status.
- Export any existing order to be used as a template for future order creation.

The api reference is available here: [order api](#tag/API-Order).

## Trip information

[Trips](#section/Concepts/Trip) can't be manipulated yet through the api, but it is possible to retrieve trip information.
We currently have an endpoint available to retrieve the charge information for a certain endpoint.

You can update the status of [stops](#section/Concepts/Stop) and [stop groups](#section/Concepts/Stop) of a trip using a [webhook](#tag/Webhooks-inbound/operation/External_status_updatestatus_update_webhook_post).

## Resource management

### Resource

[Resources](#section/Concepts/Resource) this should be used together with the endpoints to fetch unavailabilities as a resource unavailability is linked to a resource.

### Unavailability

[Resource unavailabilities](#section/Concepts/Unavailability) can be managed through the API. The following operations are supported:

- Creating an unavailability for a resource
- Updating an unavailability for a resource
- Deleting an unavailability for a resource
- Fetching an unavailability for a resource
- Fetching all unavailabilities for a resource

The goal of these endpoints is to allow external systems to manage the availability of resources in Qargo. An `external_id` is stored alongside the unavailability to allow for easy linking between the external system and Qargo. This `external_id` should be provided if a referential link is needed between the external system and Qargo.

See the [examples](#section/Resources/Unavailabilities) on how to use the unavailability endpoints.

## Visibility

We support visibility (sending messages triggered by Qargo system events) in the api as well.
These messages can be send out as a [webhook](#tag/Reference-Webhooks-outbound/operation/Visibility_eventvisibility_webhook_post), or an EDI connection.

For most endpoints, visibility only trigger on status changes (for example, from stop `IN_PROGRESS` -> `COMPLETED`).
There are a few exceptions, these will be indicated in the overview:

- Order level
  - We send out a visibility event on `ACCEPTED` (order created), `REJECTED` (order skipped) and `COMPLETED` (all stops for order completed).
- Stop level
  - We send out a visibility event on `AT_STOP` (arrived at stop), `COMPLETED` (all activities completed for stop).
- Position level (note: for every telematics update)
- Trip level
  - We send a visibility event when a trip changes to `PLANNED` and when it transitions to `COMPLETED`.
- Resource level
  - We send an event when a resource is assigned to a certain [trip](#section/Concepts/Trip).

## Order dispatch

It is also possible to subcontract trips to other parties. This is possible using two push endpoints:

- Outgoing dispatched trip [payload](#tag/Reference-Webhooks-outbound/operation/Trip_dispatch_payloadtrip_dispatch_payload_post).
- Incoming [message format](#tag/Reference-Webhooks-inbound/operation/External_status_updatestatus_update_webhook_post) to update subcontracted status.


## Documents

We offer an interface to download documents. The documents can be fetched using the [document endpoints](#tag/API-Document).

## Request additional endpoints

Please contact [us](mailto:integrations@qargo.com) for inqueries regarding additional api functionality.

# Transport order creation & status

This sections details how to construct payloads to create transport orders using the order upload endpoint([/orders/order/upload](#operation/import_order_v1_orders_order_upload_post)).

## Order creation metadata

Orders are not created synchronously via the API. When creating orders via the `POST /orders/order/upload` endpoint, you will receive the following response when creating an order.

```json
{
  "upload_id": "<UPLOAD UUID>",
  "upload_status": "IN_PROGRESS",
  "upload_url": "v1/orders/order/upload/<UPLOAD UUID>",
  "order_id": null,
  "order_url": null
}
```

You need to store the `upload_id` so you can fetch the status of the order creation by calling `GET /orders/order/upload/<UPLOAD UUID>`

Based on the status of the upload (`upload_status`), you can know if the order is still in the progress of being created or has already been created. Both `order_id` and `order_url` will be filled in when the order has been created. The `order_id` will be filled in with the order id, which can then be used to fetch the order data and status from the system.

**Example payload `GET /orders/order/upload/e01b3db1-4e49-4241-a91e-7534da884d46`** with a created order

```json
{
  "upload_id": "e01b3db1-4e49-4241-a91e-7534da884d46",
  "upload_status": "COMPLETED",
  "upload_url": "v1/orders/order/upload/e01b3db1-4e49-4241-a91e-7534da884d46",
  "order_id": "a2a84715-0027-49af-ad30-494c0ccf75cc",
  "order_url": "v1/orders/order/a2a84715-0027-49af-ad30-494c0ccf75cc"
}
```

## Order identifier

The `order_identifier` is used to uniquely identify orders that are being created via the API. This means that the same `order_identifier` needs to be used when updating orders. Multiple identical updates after each other are idempotent and will not fail the request.

The `order_identifier` main usage is for `deduplication`, you cannot use the `order_identifier` to fetch an order.

## Create an order

The first example is a simple transport from our london office to our Ghent office.
Please note that the transport service will need to be matched with the one in your system.

```json
{
  "operation": "CREATE",
  "consignments": [
    {
      "delivery_stop": {
        "date": "2022-05-03",
        "location": {
          "name": "Qargo Ghent office",
          "address": "Gaston Crommenlaan 4",
          "postal_code": "9050",
          "city": "Ghent",
          "country": "BE"
        },
        "reference_number": "D12345"
      },
      "pickup_stop": {
        "date": "2022-04-21",
        "location": {
          "name": "Qargo London office",
          "address": "71-91 Aldwych",
          "postal_code": "WC2B 4HN",
          "city": "London",
          "country": "UK"
        },
        "reference_number": "P123456"
      }
    }
  ],
  "customer_reference_number": "T12345",
  "customer": {
    "code": "00020"
  },
  "instructions": "<instructions go here>",
  "message_timestamp": "2022-05-02T11:37:15.417Z",
  "order_identifier": "T1234393",
  "transport_service": {
    "name": "General"
  }
}
```

Note: it is possible to 'export' existing orders in the api to use as examples/templates.
See the [Export existing orders](#section/Transport-order-creation-and-status/Export-an-existing-order) section.

## Update an order

The following order is an update of an existing order. Note the `UPDATE` value of the operation field.

Important remarks:

- Not all the fields of the order can be updated
- the `order_identifier` field is used to identify the order to update

**Example of an order update**

```json
{
  "order_identifier": "QARGO_TEST_0001",
  "operation": "UPDATE",
  "customer": {
    "name": "UPS SCS Coventry"
  },
  "consignments": [
    {
      "pickup_stop": {
        "location": {
          "name": "Qargo HQ",
          "address": "Gaston Crommenlaan 4,",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": "Qargo HQ building"
        },
        "note": "Pickup 4 boxes of pasta",
        "date": "2024-08-20",
        "reference_number": "QACOLLI001",
        "instructions": "If closed, call mobile number",
        "email": "info@qargo.com",
        "phone_number": "+0912341431",
        "mobile_number": "+324567890"
      },
      "delivery_stop": {
        "location": {
          "name": "Grocery store",
          "address": "Resedastraat 20",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": "Grocery store"
        },
        "note": "Don't forget sign the documsn",
        "date": "2024-08-21",
        "reference_number": "QADELIV001",
        "instructions": "Alarm code: 123456",
        "email": "info@qargo.com",
        "phone_number": "02123456",
        "mobile_number": "+329998888"
      },
      "goods": [
        {
          "description": "4 boxes of pasta",
          "quantity": 4
        }
      ]
    }
  ],
  "customer_reference_number": "QARGO_TEST_0001",
  "transport_service": {
    "code": "CONTAINER_BOOKING"
  }
}
```

## Cancel an order

To cancel an order, pass `DELETE` as `operation` value. This will cancel the order. If the order has already been cancelled, this will not result in an error. Executing multiple cancellations is a idempotent operation and will not fail the request.

A cancelled order cannot be uncancelled. If you need to revert the cancel, you will need to recreate the original order **using a different order identifier**. Using the same order identifier will cause the system to try to update the cancelled order, which results in an error.

```json
{
  "operation": "DELETE",
  "consignments": [
    {
      "delivery_stop": {
        "date": "2022-05-03",
        "location": {
          "name": "Qargo Ghent office",
          "address": "Gaston Crommenlaan 4",
          "postal_code": "9050",
          "city": "Ghent",
          "country": "BE"
        },
        "reference_number": "D12345"
      },
      "pickup_stop": {
        "date": "2022-04-21",
        "location": {
          "name": "Qargo London office",
          "address": "71-91 Aldwych",
          "postal_code": "WC2B 4HN",
          "city": "London",
          "country": "UK"
        },
        "reference_number": "P123456"
      }
    }
  ],
  "customer_reference_number": "T12345",
  "customer": {
    "code": "00020"
  },
  "instructions": "<instructions go here>",
  "message_timestamp": "2022-05-02T11:37:15.417Z",
  "order_identifier": "T1234393",
  "transport_service": {
    "name": "General"
  }
}
```

## Export an existing order

It is possible to export a manually created order in the api. We first need to determine the technical id of this order.

![Retrieve order id](/docs/static/order_id.png).

The order can be exported with the following endpoint:
[Export order](#tag/API-Order/operation/order_export_v1_orders_order__order_id__export_get).
The output of this endpoint corresponds to the order creation format. Just make sure to use a different [`order_identifier`](#section/Transport-order-creation-and-status/Order-identifier), otherwise the 'new' order will be interpreted as an update.


## Fetch order data and status

With the `GET /orders/order/<ORDER UUID>` [endpoint](#operation/get_order_details_v1_orders_order__order_id__get), you can fetch the data related to the order. This contains the current `status` of the order along with other data.

## Container orders

There are 2 types of container orders that can be created using the API, `IMPORT` and `EXPORT`.

### Import

This scenario contains of 2 main stops additional optional stops.

1. Pickup of a loaded container
2. Unload container
3. Drop off empty container (Optional, configured in `teardown_stops`)

The `container_scenario` property is set as `IMPORT` and the drop off location of the container is specified in the the `teardown_stops` property. The optional `teardown_stops` describe the stops of the container after the consignment has been completed

**Example `IMPORT` container scenario**

```json
{
  "order_identifier": "QARGO_TEST_0002",
  "operation": "CREATE",
  "customer": {
    "name": "UPS SCS Coventry"
  },
  "teardown_stops": [
    {
      "location": {
        "name": "Container yard",
        "address": "Scheepzatestraat 1",
        "postal_code": "9000",
        "city": "Gent",
        "state": "Oost-Vlaanderen",
        "country": "BE"
      },
      "note": "Drop off the container on the designated location",
      "date": "2024-08-20",
      "reference_number": "CONT0001",
      "instructions": "Put next to the red container",
      "email": "info@qargo.com",
      "phone_number": "+0912341431",
      "mobile_number": "+324567890"
    }
  ],
  "consignments": [
    {
      "pickup_stop": {
        "location": {
          "name": "Container pickup location",
          "address": "Gaston Crommenlaan 4,",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": "This is the container pickup location"
        },
        "note": "Pick up the green container",
        "date": "2024-08-20",
        "reference_number": "CONT0002",
        "instructions": "Code of the container is 1234",
        "email": "info@qargo.com",
        "phone_number": "+0912341431",
        "mobile_number": "+324567890"
      },
      "delivery_stop": {
        "location": {
          "name": "Sports store",
          "address": "Resedastraat 20",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": "This is the delivery location of the container goods"
        },
        "note": "1000 boxes of shoes",
        "date": "2024-08-21",
        "reference_number": "CONT0003",
        "instructions": "Use mobile number if gate is closed",
        "email": "info@qargo.com",
        "phone_number": "02123456",
        "mobile_number": "+329998888"
      }
    }
  ],
  "container": {
    "container_scenario": "IMPORT"
  },
  "customer_reference_number": "QARGO_TEST_0002",
  "transport_service": {
    "code": "CONTAINERS"
  }
}
```

### Export

This scenario contains 2 main stops with additional optional stops:

1. Pickup empty container (Optional, configured in `setup_stops`)
2. Load empty container
3. Drop off loaded container

The `container_scenario` is set as `EXPORT` and the `setup_stops` property allows to define additional optional stops.

**Example of an `EXPORT` `container_scenario`**

```json
{
  "order_identifier": "QARGO_TEST_0003",
  "operation": "CREATE",
  "customer": {
    "name": "UPS SCS Coventry"
  },
  "setup_stops": [
    {
      "location": {
        "name": "Container yard",
        "address": "Scheepzatestraat 1",
        "postal_code": "9000",
        "city": "Gent",
        "state": "Oost-Vlaanderen",
        "country": "BE"
      },
      "note": "Pickup empty container on the designated location",
      "date": "2024-08-20",
      "reference_number": "CONT0001",
      "instructions": "Blue container, next to the red container",
      "email": "info@qargo.com",
      "phone_number": "+0912341431",
      "mobile_number": "+324567890"
    }
  ],
  "consignments": [
    {
      "pickup_stop": {
        "location": {
          "name": "Container loading location",
          "address": "Gaston Crommenlaan 4,",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": "Qargo HQ, has a container loading bay"
        },
        "note": "Fill with 1000 boxes of Qargo shirts",
        "date": "2024-08-20",
        "reference_number": "CONT0002",
        "instructions": "Code of the container is 1234",
        "email": "info@qargo.com",
        "phone_number": "+0912341431",
        "mobile_number": "+324567890"
      },
      "delivery_stop": {
        "location": {
          "name": "Train station container hub",
          "address": "Resedastraat 20",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": "This is the dropoff location of the loaded container"
        },
        "note": "1000 boxes of shoes",
        "date": "2024-08-21",
        "reference_number": "CONT0003",
        "instructions": "Use mobile number if gate is closed",
        "email": "info@qargo.com",
        "phone_number": "02123456",
        "mobile_number": "+329998888"
      }
    }
  ],
  "container": {
    "container_scenario": "EXPORT"
  },
  "customer_reference_number": "QARGO_TEST_0003",
  "transport_service": {
    "code": "CONTAINERS"
  }
}
```

### Create a loaded container import transport order

The following order picks up a filled container, delivers it to our office, and returns the empty container.
This examples also demonstrates how to model ADR information.

```json
{
  "operation": "CREATE",
  "consignments": [
    {
      "delivery_stop": {
        "location": {
          "name": "Qargo Ghent office",
          "address": "Gaston Crommenlaan 4",
          "postal_code": "9050",
          "city": "Ghent",
          "country": "BE"
        },
        "note": "unloading address comments",
        "reference_number": "D123956"
      },
      "pickup_stop": {
        "location": {
          "address": "Europaweg",
          "city": "Rotterdam",
          "country": "NL",
          "name": "APM terminals Maasvlakte II"
        },
        "reference_number": "P123956"
      },
      "goods": [
        {
          "good_items": {
            "adr": {
              "name": "DISINFECTANT, LIQUID, CORROSIVE, N.O.S.",
              "un_number": "1903"
            }
          },
          "ordered_quantity": 100,
          "ordered_total_volume_value": 43000,
          "packaging_type": {
            "code": "PYZ"
          }
        }
      ]
    }
  ],
  "container_number": "MSCU5285725",
  "container_scenario": "IMPORT",
  "container_type": {
    "code": "22G0"
  },
  "customer": {
    "code": "00083"
  },
  "customer_reference_number": "C2325995",
  "message_timestamp": "2022-05-02T11:28:01.232Z",
  "order_identifier": "ord-12332423",
  "teardown_input": [
    {
      "location": {
        "address": "Butaanweg 52-54",
        "city": "Rotterdam",
        "country": "NL",
        "name": "OCC Overbeek Cont. Control."
      }
    }
  ],
  "transport_service": {
    "name": "Container"
  }
}
```

### Create a loaded container export transport order

This example shows how to create a transport that exports a loaded container.
The setup section specifies the empty container pickup.

```json
{
  "operation": "CREATE",
  "consignments": [
    {
      "delivery_stop": {
        "location": {
          "address": "Europaweg",
          "city": "Rotterdam",
          "country": "NL",
          "name": "APM terminals Maasvlakte II"
        },
        "reference_number": "3432423908987"
      },
      "pickup_stop": {
        "location": {
          "name": "Qargo Ghent office",
          "address": "Gaston Crommenlaan 4",
          "postal_code": "9050",
          "city": "Ghent",
          "country": "BE"
        },
        "reference_number": "3432441"
      },
      "goods": [
        {
          "absolute_max_temperature_value": "-8.0",
          "description": "Plastic buckets",
          "ordered_quantity": 1500,
          "packaging_type": {
            "code": "PE"
          }
        }
      ]
    }
  ],
  "container_number": "MSCU5285725",
  "container_scenario": "EXPORT",
  "container_type": {
    "code": "22RE"
  },
  "customer": {
    "code": "00007"
  },
  "customer_reference_number": "PUC-888315",
  "message_timestamp": "2022-05-02T11:48:12.746Z",
  "order_identifier": "d18f8309-0f26-4687-b32b-749008a0cb8e",
  "setup_input": [
    {
      "location": {
        "address": "Butaanweg 52-54",
        "city": "Rotterdam",
        "country": "NL",
        "name": "OCC Overbeek Cont. Control."
      }
    }
  ],
  "transport_service": {
    "name": "Container"
  }
}
```

## Adding custom stops

In Qargo you can define custom stop actions. These stops can be added to configure additional stops related to the order.

These stops can be defined in the `standalone_stops` property.

Using `standalone_stops` to configure stops adds the following requirements to the order:

1. Every stop needs to have a unique positive integer assigned to it. This will determine the sequence of the stops in the order.
2. Every stops needs to have a `custom_activity` assigned to it. This will determine the type of stop that is being added to the order.

**Example custom stops for an order**

```json
{
  "import_configuration": {
    "code": "API"
  },
  "transport_service": {
    "code": "YOUR_TRANSPORT_SERVICE_CODE"
  },
  "customer": {
    "code": "CUSTOMER_CODE"
  },
  "operation": "CREATE",
  "order_identifier": "EXT-ORDER-001",
  "customer_reference_number": "CUST-REF-001",
  "consignments": [
    {
      "pickup_stop": {
        "activity": "PICKUP",
        "date": "2026-04-01",
        "location": {
          "name": "Warehouse Antwerp",
          "address": "Kaai 100",
          "city": "Antwerp",
          "postal_code": "2000",
          "country": "BE"
        },
        "position": {
          "optimal": true,
          "position": 1
        }
      },
      "delivery_stop": {
        "activity": "DELIVERY",
        "date": "2026-04-01",
        "location": {
          "name": "Distribution Center Ghent",
          "address": "Industrieweg 50",
          "city": "Ghent",
          "postal_code": "9000",
          "country": "BE"
        },
        "position": {
          "optimal": true,
          "position": 3
        }
      },
      "standalone_stops": [
        {
          "activity": "CUSTOM",
          "custom_activity_label": "WEEG",
          "date": "2026-04-01",
          "location": {
            "name": "Weigh Station Mechelen",
            "address": "Weegbrug 1",
            "city": "Mechelen",
            "postal_code": "2800",
            "country": "BE"
          },
          "position": {
            "optimal": true,
            "position": 2
          }
        }
      ],
      "goods": [
        {
          "description": "Palletized goods",
          "quantity": 10,
          "package_type": "EURO_PALLET",
          "total_weight": 5000
        }
      ]
    }
  ]
}
```

**Example custom stops for an container order**

```json
{
  "order_identifier": "QARGO_TEST_0005",
  "operation": "CREATE",
  "customer": {
    "name": "UPS SCS Coventry"
  },
  "setup_stops": [
    {
      "location": {
        "name": "Stop 1",
        "address": "Scheepzatestraat 1",
        "postal_code": "9000",
        "city": "Gent",
        "state": "Oost-Vlaanderen",
        "country": "BE"
      },
      "note": "Stop 1 notes",
      "date": "2024-08-20",
      "reference_number": "Stop 1 reference number",
      "instructions": "Stop 1 instructions",
      "email": "info@qargo.com",
      "phone_number": "+0912341431",
      "mobile_number": "+324567890",
      "activity": "COLLECT_EMPTY_CONTAINER",
      "position": {
        "position": 1
      }
    }
  ],
  "consignments": [
    {
      "standalone_stops": [
        {
          "location": {
            "name": "Stop 2",
            "address": "Vlierstraat 4,",
            "postal_code": "9000",
            "city": "Gent",
            "state": "Oost-Vlaanderen",
            "country": "BE",
            "description": "HQ"
          },
          "note": "Stop 2 notes",
          "date": "2024-08-20",
          "reference_number": "Stop 2 number",
          "instructions": "Stop 2 instructions",
          "email": "info@qargo.com",
          "phone_number": "+0912341431",
          "mobile_number": "+324567890",
          "custom_activity": "WEGEN",
          "position": {
            "position": 2
          }
        },
        {
          "location": {
            "name": "Stop 6",
            "address": "Vlierstraat 4,",
            "postal_code": "9000",
            "city": "Gent",
            "state": "Oost-Vlaanderen",
            "country": "BE",
            "description": "HQ"
          },
          "note": "Stop 6 notes",
          "date": "2024-08-20",
          "reference_number": "Stop 6 number",
          "instructions": "Stop 6 instructions",
          "email": "info@qargo.com",
          "phone_number": "+0912341431",
          "mobile_number": "+324567890",
          "custom_activity": "WEGEN",
          "position": {
            "position": 6
          }
        },
        {
          "location": {
            "name": "Stop 3",
            "address": "Corbiestraat 4,",
            "postal_code": "9000",
            "city": "Gent",
            "state": "Oost-Vlaanderen",
            "country": "BE"
          },
          "note": "Stop 3 notes",
          "date": "2024-08-22",
          "reference_number": "Stop 3 reference number",
          "instructions": "Stop 3 instructions",
          "email": "info@qargo.com",
          "phone_number": "+0912341431",
          "mobile_number": "+324567890",
          "custom_activity": "INKLAREN",
          "position": {
            "position": 3
          }
        }
      ],
      "pickup_stop": {
        "location": {
          "name": "Stop 4",
          "address": "Gaston Crommenlaan 4,",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": "HQ"
        },
        "note": "Stop 4 notes",
        "date": "2024-08-20",
        "reference_number": "Stop 4 reference number",
        "instructions": "Stop 4 instructions",
        "email": "info@qargo.com",
        "phone_number": "+0912341431",
        "mobile_number": "+324567890",
        "activity": "PICKUP_EXPORT",
        "position": {
          "position": 4
        }
      },
      "delivery_stop": {
        "location": {
          "name": "Stop 5",
          "address": "Resedastraat 20",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": "Delivery"
        },
        "note": "Stop 5 notes",
        "date": "2024-08-21",
        "reference_number": "Stop 5 reference number",
        "instructions": "Stop 5 instructions",
        "email": "info@qargo.com",
        "phone_number": "02123456",
        "mobile_number": "+329998888",
        "activity": "DELIVERY_EXPORT",
        "position": {
          "position": 5
        }
      }
    }
  ],
  "container": {
    "container_scenario": "EXPORT"
  },
  "customer_reference_number": "QARGO_TEST_0005",
  "transport_service": {
    "code": "CONTAINER_BOOKING"
  }
}
```

## Examples

### Basic order

```json
{
  "order_identifier": "DEFAULT_ORDER",
  "operation": "CREATE",
  "customer": { "name": "Qargo" },
  "import_configuration": { "code": "API" },
  "consignments": [
    {
      "pickup_stop": {
        "location": {
          "name": "Qargo",
          "address": "Gaston Crommenlaan 4",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": "HQ"
        },
        "note": "Collection notes",
        "date": "2024-07-19",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      },
      "delivery_stop": {
        "location": {
          "name": "Qargo London",
          "address": "71-91 Aldwych",
          "postal_code": "WC2B 4HN",
          "city": "London",
          "country": "GB",
          "description": "Delivery"
        },
        "note": "Delivery notes",
        "date": "2024-07-19",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      },
      "goods": [{ "quantity": 1 }]
    }
  ],
  "customer_reference_numbers": ["QARGO-123"],
  "transport_service": { "code": "QARGO" },
  "service_level": { "code": "QARGO_NEXT_DAY" }
}
```

### Container IMPORT scenario

```json
{
  "order_identifier": "CONTAINER_IMPORT_ORDER",
  "operation": "CREATE",
  "customer": { "name": "QARGO" },
  "import_configuration": { "code": "API" },
  "teardown_stops": [
    {
      "location": {
        "name": "Ghent Container Yard",
        "address": "Scheepzatestraat 1",
        "postal_code": "9000",
        "city": "Gent",
        "state": "Oost-Vlaanderen",
        "country": "BE"
      },
      "note": "Empty container drop-off",
      "date": "2024-08-24",
      "reference_number": "",
      "instructions": "",
      "email": "",
      "phone_number": "",
      "mobile_number": ""
    }
  ],
  "consignments": [
    {
      "pickup_stop": {
        "location": {
          "name": "Qargo Ghent",
          "address": "Gaston Crommenlaan 4,",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": ""
        },
        "note": "",
        "date": "2024-08-20",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      },
      "delivery_stop": {
        "location": {
          "name": "Qargo London",
          "address": "71-91 Aldwych",
          "postal_code": "WC2B 4HN",
          "city": "London",
          "country": "GB",
          "description": "Delivery"
        },
        "note": "Delivery notes",
        "date": "2024-08-22",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      }
    }
  ],
  "container": { "container_scenario": "IMPORT", "seal_number": "SEAL12345" },
  "customer_reference_numbers": ["QARGO-01"],
  "transport_service": { "code": "CONTAINER_TRANSPORT_SERVICE" }
}
```

### Container EXPORT scenario

```json
{
  "order_identifier": "CONTAINER_EXPORT_ORDER",
  "operation": "CREATE",
  "customer": { "name": "QARGO" },
  "import_configuration": { "code": "API" },
  "setup_stops": [
    {
      "location": {
        "name": "Ghent Container Yard",
        "address": "Scheepzatestraat 1",
        "postal_code": "9000",
        "city": "Gent",
        "state": "Oost-Vlaanderen",
        "country": "BE"
      },
      "note": "Empty container pickup location",
      "date": "2024-08-20",
      "reference_number": "",
      "instructions": "",
      "email": "",
      "phone_number": "",
      "mobile_number": ""
    }
  ],
  "consignments": [
    {
      "pickup_stop": {
        "location": {
          "name": "Qargo Ghent",
          "address": "Gaston Crommenlaan 4,",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": ""
        },
        "note": "",
        "date": "2024-08-20",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      },
      "delivery_stop": {
        "location": {
          "name": "Qargo London",
          "address": "71-91 Aldwych",
          "postal_code": "WC2B 4HN",
          "city": "London",
          "country": "GB",
          "description": "Delivery"
        },
        "note": "Delivery notes",
        "date": "2024-08-22",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      }
    }
  ],
  "container": { "container_scenario": "EXPORT", "seal_number": "SEAL12345" },
  "customer_reference_numbers": ["QARGO-00003"],
  "transport_service": { "code": "CONTAINER_TRANSPORT_SERVICE" }
}
```

### Order with multiple stops example

```json
{
  "order_identifier": "MULTIPLE_STOPS_ORDER",
  "operation": "CREATE",
  "customer": { "name": "QARGO" },
  "consignments": [
    {
      "standalone_stops": [
        {
          "location": {
            "name": "Customs Ghent",
            "address": "Sint-Lievenslaan 27",
            "postal_code": "9000",
            "city": "Gent",
            "state": "Oost-Vlaanderen",
            "country": "BE",
            "description": "Customs office location"
          },
          "note": "",
          "date": "2024-08-20",
          "reference_number": "",
          "instructions": "",
          "email": "",
          "phone_number": "",
          "mobile_number": "",
          "custom_activity": "CUSTOMS",
          "position": { "position": 1 }
        },
        {
          "location": {
            "name": "Truck wiehgt station",
            "address": "Belgicastraat 10",
            "postal_code": "9000",
            "city": "Gent",
            "state": "Oost-Vlaanderen",
            "country": "BE",
            "description": "HQ"
          },
          "note": "",
          "date": "2024-08-20",
          "reference_number": "",
          "instructions": "",
          "email": "",
          "phone_number": "",
          "mobile_number": "",
          "custom_activity": "WEIGHT_STATION",
          "position": { "position": 2 }
        },
        {
          "location": {
            "name": "Truckwash Ghent",
            "address": "Traktaatweg 23",
            "postal_code": "9000",
            "city": "Gent",
            "state": "Oost-Vlaanderen",
            "country": "BE"
          },
          "note": "",
          "date": "2024-08-23",
          "reference_number": "",
          "instructions": "",
          "email": "",
          "phone_number": "",
          "mobile_number": "",
          "custom_activity": "WASHING",
          "position": { "position": 5 }
        }
      ],
      "pickup_stop": {
        "location": {
          "name": "Qargo Ghent",
          "address": "Gaston Crommenlaan 4,",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": ""
        },
        "note": "",
        "date": "2024-08-20",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": "",
        "activity": "PICKUP",
        "position": { "position": 3 }
      },
      "delivery_stop": {
        "location": {
          "name": "Qargo London",
          "address": "71-91 Aldwych",
          "postal_code": "WC2B 4HN",
          "city": "London",
          "country": "GB",
          "description": "Delivery"
        },
        "note": "Delivery notes",
        "date": "2024-08-22",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": "",
        "activity": "DELIVERY",
        "position": { "position": 4 }
      }
    }
  ],
  "customer_reference_numbers": ["QARGO_001"],
  "transport_service": { "code": "FULL_LOADS" }
}
```

### Order with ADR goods

```json
{
  "order_identifier": "DANGEROUS_GOODS_ORDER",
  "operation": "CREATE",
  "customer": { "name": "QARGO" },
  "import_configuration": { "code": "API" },
  "consignments": [
    {
      "pickup_stop": {
        "location": {
          "name": "Qargo Ghent",
          "address": "Gaston Crommenlaan 4,",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": ""
        },
        "note": "",
        "date": "2024-08-20",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      },
      "delivery_stop": {
        "location": {
          "name": "Qargo London",
          "address": "71-91 Aldwych",
          "postal_code": "WC2B 4HN",
          "city": "London",
          "country": "GB",
          "description": "Delivery"
        },
        "note": "Delivery notes",
        "date": "2024-08-22",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      },
      "goods": [
        {
          "packaged_items": [
            {
              "adr": {
                "un_number": "1956",
                "packaging_type": "BOX",
                "emergency_phone_number": "+32456789010",
                "technical_name_by_locale": { "en": "Dangerous goods" }
              },
              "quantity": 5,
              "total_volume_l": 100,
              "total_weight_kg": 100,
              "description": "Dangerous and flamable goods"
            }
          ],
          "description": "Fuel",
          "quantity": 1,
          "product_name": "FUEL"
        }
      ]
    }
  ],
  "customer_reference_numbers": ["QARGO-001"],
  "transport_service": { "code": "HAZARDOUS" },
  "service_level": { "code": "NEXT_DAY" }
}
```

### Order with pallets and custom barcodes

```json
{
  "order_identifier": "PALLETS_WITH_BARCODES_ORDER",
  "operation": "CREATE",
  "customer": { "name": "QARGO" },
  "import_configuration": { "code": "API" },
  "consignments": [
    {
      "pickup_stop": {
        "location": {
          "name": "Qargo Ghent",
          "address": "Gaston Crommenlaan 4,",
          "postal_code": "9000",
          "city": "Gent",
          "state": "Oost-Vlaanderen",
          "country": "BE",
          "description": ""
        },
        "note": "",
        "date": "2024-08-20",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      },
      "delivery_stop": {
        "location": {
          "name": "Qargo London",
          "address": "71-91 Aldwych",
          "postal_code": "WC2B 4HN",
          "city": "London",
          "country": "GB",
          "description": "Delivery"
        },
        "note": "Delivery notes",
        "date": "2024-08-22",
        "reference_number": "",
        "instructions": "",
        "email": "",
        "phone_number": "",
        "mobile_number": ""
      },
      "goods": [
        {
          "quantity": 1,
          "packaging_type": {
            "name": "Full Pallet",
            "packaging_size": { "code": "FP" }
          },
          "handling_units": [
            { "barcode": { "value": "01J93R8V517R7133FVCM3ZCJNN" } }
          ]
        },
        {
          "quantity": 2,
          "packaging_type": {
            "name": "Half Pallet",
            "packaging_size": { "code": "HP" }
          },
          "handling_units": [
            { "barcode": { "value": "01J93R9024CNTJJPQG8WDP2PVX" } },
            { "barcode": { "value": "01J93R9PKY3A5C9S6T4VV12C8B" } }
          ]
        }
      ]
    }
  ],
  "customer_reference_numbers": ["QARGO-0001"],
  "transport_service": { "code": "PALLETS" },
  "service_level": { "code": "PREMIUM_NEXT_DAY" }
}
```


# Status updates

The API supports status updates for specific entities. This can either be via an endpoint or webhook.

## Task

This [endpoint](#tag/API-Task/operation/update_task_status_v1_tasks_task__id__update_status_post) allows you to update the status of a task. A task in Qargo is linked to a side effect in an external system.

## Order

You can change the status of an order via the [webhook](#tag/Webhooks-inbound/operation/Create_update_cancel_ordersorder_import_webhook_post) or [endpoint](#tag/API-Order/operation/import_order_v1_orders_order_upload_post).

## Stop

This [webhook](#tag/Webhooks-inbound/operation/External_status_updatestatus_update_webhook_post) allows you to either update:

1. stops
2. stop groups

Using this [webhook](#tag/Webhooks-inbound/operation/External_status_updatestatus_update_webhook_post) you can provide status updates for stops or stop groups. You can also provide additional information in the payload
which can be mapped to different fields in Qargo.

## Booking

This [webhook](#tag/Webhooks-inbound/operation/Intermodal_booking_status_webhook_payloadintermodal_booking_status_incoming_post) is not yet available at this time.

# Visibility

We support visibility (sending messages triggered by Qargo system events) in the api as well.
These messages can be send out as a [webhook](#tag/Reference-Webhooks-outbound/operation/Visibility_eventvisibility_webhook_post), or an EDI connection.

For most endpoints, visibility only trigger on status changes (for example, from stop `IN_PROGRESS` -> `COMPLETED`).
There are a few exceptions, these will be indicated in the overview:

- Order level
  - We send out a visibility event on `ACCEPTED` (order created), `REJECTED` (order skipped) and `COMPLETED` (all stops for order completed).
- Stop level
  - We send out a visibility event on `AT_STOP` (arrived at stop), `COMPLETED` (all activities completed for stop).
- Position level (note: for every telematics update)
- Trip level
  - We send a visibility event when a trip changes to `PLANNED` and when it transitions to `COMPLETED`.
- Resource level
  - We send an event when a resource is assigned to a certain [trip](#section/Concepts/Trip).
# Accounting

The following section details how to use our api for accounting integrations.
You can push/pull accounting information between Qargo and the accounting system.

Please note that this is not suitable for BI/analytics purposes.
We offer a SQL based data warehouse connector to support this use case.

## Synchronize invoices/credit notes

The flow for sales/purchase invoices and sales credit notes is the same, with a different payload.
We will show an example of syncing a sales invoices below

We use a task oriented approach to indicate which invoice to sync (post in the accounting software).
The implementer should take the following steps:

- Fetch a list of available tasks (tasks in a TODO state)
- For each available task:
- Fetch the payload in the task details
- Sync the data to the accounting system.
- Report the status back, this result can be success or failure.

![Sync invoice/credit note flow](/docs/static/sync_invoice_flow.svg)

It is allowed to only process a subset of the available tasks and process the remaining invoices later.

### Example

Fetch the Invoice/Credit notes to sync using [sync tasks endpoint](#tag/API-Accounting/operation/List_invoices_credit_notes_to_sync_v1_accounting_sync_tasks_get)

```
curl https://api.qargo.com/v1/accounting/sync-tasks -H 'Content-type: application/json' -H 'Authorization: Bearer *access_token*'
```

Response:

```json
{ "tasks": [{ "id": "*id_of_first_task*" }] }
```

Note that as long as an endpoint is not marked as completed/failed, it will still show up as an available POST task.

Fetch the first payload:

<pre>
curl https://api.qargo.com/v1/accounting/sync-tasks/*id_of_first_task* -H 'Content-type: application/json' -H 'Authorization: Bearer *access_token*'
</pre>

Response:

<pre>
{"id": "<id_of_first_task>", "status": "TODO", "TASK_TYPE": "POST_INVOICE", "payload": {....}}
</pre>

<!--
Fetch the invoice document (when required).

```
curl https://api.qargo.com/v1/documents/document/*id_of_document*/download -H 'Content-type: application/json' -H 'Authorization: Bearer *access_token*' -O
```

Response:

```
* Document content *
```

Complete the first task:

```
curl -X POST https://api.qargo.com/v1/accounting/sync-tasks/*id_of_first_task*/update-status -H 'Content-type: application/json' -H 'Authorization: Bearer *access_token*' -d '{"status": "COMPLETED"}'
```

Response:

```json
{"id": "<id_of_first_task>", "status": "COMPLETED", "TASK_TYPE": "POST_INVOICE"}
```

-->

## Fetch updated customer information

### Example

```
curl https://api.qargo.com/v1/company/*id_of_customer* -H 'Content-type: application/json' -H 'Authorization: Bearer *access_token*'
```

Response:

```
{"id": "<id_of_customer>", ...}
```

Note: since we embed the customer/supplier company in the invoice payload, it is possible to synchronise these companies as part of the invoice posting flow.

## Synchronize blocked status of customer

### Example

Update the customer blocked status:

```
curl -X POST https://api.qargo.com/v1/company/*id_of_customer* -H 'Content-type: application/json' -H 'Authorization: Bearer *access_token*' -d  '{"blocked": true}'
```

Response:

```
{"id": "<id_of_customer>", "blocked": true, ....}
```

## Creating contacts for a customer or subcontractor

You can create a contact for a customer or subcontractor by providing a `contacts` list in the payload.

### Example

```
curl -X PATCH https://api.qargo.com/v1/company/*id_of_customer* -H 'Content-type: application/json' -H 'Authorization: Bearer *access_token*' -d  '{"contacts":[{"name":"Contact name","note":"Notes on the contact","phone":"+32456789016","email":"hello@qargo.com","roles":["BILLING","OPERATIONS"]}]}'
```

## Updating contacts for a customer or subcontractor

To update a contact, you need to provide the `id` of the contact you want to update in the payload.

### Example

```
curl -X PATCH https://api.qargo.com/v1/company/*id_of_customer* -H 'Content-type: application/json' -H 'Authorization: Bearer *access_token*' -d  '{"id": "3ba86d22-0183-4575-804d-60e0a6fa2f74", "contacts":[{"name":"Contact name","note":"Notes on the contact","phone":"+32456789016","email":"hello@qargo.com","roles":["BILLING","OPERATIONS"]}]}'
```

## Archiving a contact for a customer or subcontractor

To archive a contact, you need to provide the `is_archived` field in the payload along with the `id` of the contact you want to archive.

### Example

```
curl -X PATCH https://api.qargo.com/v1/company/*id_of_customer* -H 'Content-type: application/json' -H 'Authorization: Bearer *access_token*' -d  '{"is_archived": true, "id": "3ba86d22-0183-4575-804d-60e0a6fa2f74", "contacts":[{"name":"Contact name","note":"Notes on the contact","phone":"+32456789016","email":"hello@qargo.com","roles":["BILLING","OPERATIONS"]}]}'
```

# Resources

## Unavailabilities

### Creating a unavailability

Creating an unavailability is always for a single resource. Currently no bulk unavailability creation is supported.

```json
{
  "reason": "DRIVER_HOLIDAY",
  "start_time": "2025-01-08T00:00:00+00:00",
  "end_time": "2025-01-12T00:00:00+00:00",
  "description": "HR reference HR00001",
  "external_id": "YOUR_REFERENCE_00001"
}
```

### Updating an unavailability

Updating an unavailability is always for a single resource. Currently no bulk unavailability updates are supported.

```json
{
  "reason": "DRIVER_HOLIDAY",
  "start_time": "2025-01-09T00:00:00+00:00",
  "end_time": "2025-01-12T00:00:00+00:00",
  "description": "HR reference HR00002, correction 1 day",
  "external_id": "YOUR_REFERENCE_00001"
}
```

### Deleting an unavailability

Deleting a unavailability will remove the unavailability from the system. This is not reversable.
# E-invoicing

> E-invoicing refers to the automated, digital exchange of structured invoice data between businesses (e.g., suppliers and buyers) in a standardized format.

We support receiving purchase invoices and credit notes in multiple formats:

- **JSON** — Qargo's own structured purchase invoice/credit note schema
- **XML (UBL)** — Peppol-compliant UBL documents
- **Multipart** — JSON data combined with file attachments (PDF, XML, etc.)
- **Custom formats** — CSV, EDIFACT, fixed-width, or other proprietary formats via the Qargo integration framework

Attachments (e.g. the invoice PDF, CMR documents) can be included either via the `attachments[].document` object in JSON (with base64-encoded content), or as additional parts in a multipart upload.

## Peppol

For more information on Peppol E-invoicing, see https://help.qargo.com/en/articles/304774-faq-e-invoicing-aka-peppol.

## Workflows

### Importing E-invoices into Qargo via webhook

This [endpoint](#tag/Use-case-E-invoicing/operation/e-invoicing-webhook) allows importing e-invoices into Qargo. The e-invoice can either be a purchase invoice or a purchase credit note. See the endpoint documentation for detailed format examples and attachment handling.

# Question paths and answers

Question paths are a configuration mechanism that maps fields in incoming data to specific fields, documents or actions in Qargo. A `question_answers` dict can be included on updates in two webhooks:

* [Status update](#tag/Webhooks-inbound/operation/External_status_updatestatus_update_webhook_post) — on stop or stop group updates
* [Partial order update](#tag/Webhooks-inbound/operation/partial-order-update) — on order, consignment, stop, good, or handling unit updates

The keys of this dict correspond to question paths configured on an integration; the values are the answers.

**Status update example**

```json
{
  "updates": [
    {
      "event_time": "2024-08-20T10:00:00Z",
      "stop": {
        "id": "a2a84715-0027-49af-ad30-494c0ccf75cc",
        "status": "COMPLETED",
        "question_answers": {
          "trailer_number": "VB-123-AB"
        }
      }
    }
  ]
}
```

**Partial order update example**

```json
{
  "updates": [
    {
      "match": {
        "matches_all": [
          { "order": { "customer_reference_number": { "matches_any": ["T1234393"] } } }
        ]
      },
      "consignment": {
        "updates": [
          {
            "good": {
              "updates": [
                {
                  "handling_unit": {
                    "updates": [
                      {
                        "match": { "barcode": "ABC123" },
                        "question_answers": {
                          "scan_barcode": [
                            {
                              "timestamp": "2024-08-20T10:00:00Z",
                              "status": "SCANNED_IN",
                              "stop_location_code": "DEPOT-001",
                              "stop_match": {
                                "location": {
                                  "postal_code": { "matches_any": ["NW1 2AB"] }
                                }
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

## Actions

Apart from updating fields and documents, question paths can be configured to trigger one of the following actions.

### `assign_resource`

Assigns a resource (trailer, container, or full trailer) to an order or trip based on a plain-text identifier.
If no matching resource is found the answer is silently ignored.

**Answer format**: plain string — the resource's name, code, licence plate, or container number.

```
VB-123-AB
```

Matching strips all non-alphanumeric characters and is case-insensitive, so `VB-123-AB`, `VB 123 AB`, and `VB123AB` all resolve to the same resource. 

### `scan_barcode`

Records a barcode scan event on a handling unit. An optional stop match is provided, which if matched will record which stop the scan is related to alongside the scan. If the stop is not matched the scan will still succeed, but the stop will not be recorded.

**Answer format**: JSON array of scan objects.

```json
[
  {
    "timestamp": "2024-08-20T10:00:00Z",
    "status": "SCANNED_IN",
    "stop_location_code": "DEPOT-001",
    "stop_match": {
      "location": {
        "postal_code": { "matches_any": ["NW1 2AB"] }
      }
    }
  }
]
```

| Field                | Type              | Required | Description                                                                                                                 |
| -------------------- | ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| `timestamp`          | ISO 8601 datetime | Yes      | Time of the scan event                                                                                                      |
| `status`             | string            | No       | Scan status (see below)                                                                                                     |
| `barcode`            | string            | No       | Barcode value; used to identify the handling unit. Optional as the unit will have been matched in the partial order update. |
| `stop_match`         | object            | No       | Criteria for matching the scan to a specific stop on the trip (see below)                                                   |
| `stop_location_code` | string            | No       | Location identifier code                                                                                                    |
| `description`        | string            | No       | Free-text description                                                                                                       |

#### `stop_match` fields

| Field              | Type   | Description                                                          |
| ------------------ | ------ | -------------------------------------------------------------------- |
| `stop_type`        | string | Type of stop to match: `PICKUP` or `DELIVERY`                        |
| `id`               | object | Match by stop ID: `{ "matches_any": ["<id>"] }`                      |
| `reference_number` | object | Match by stop reference number: `{ "matches_any": ["<reference>"] }` |
| `location`         | object | Match by the stop's location (see below)                             |

#### `stop_match.location` fields

| Field          | Type   | Description                                                    |
| -------------- | ------ | -------------------------------------------------------------- |
| `id`           | object | Match by location ID: `{ "matches_any": ["<id>"] }`            |
| `name`         | object | Match by location name: `{ "matches_any": ["<name>"] }`        |
| `postal_code`  | object | Match by postal code: `{ "matches_any": ["<postal_code>"] }`   |
| `country_code` | object | Match by country code: `{ "matches_any": ["<country_code>"] }` |

Available status values:

| Value         | Description                                                         |
|---------------|---------------------------------------------------------------------|
| `SCANNED_IN`  | Handling unit has been scanned in at a pickup stop or at a depot    |
| `STORED`      | Handling unit is in storage at a depot                              |
| `SCANNED_OUT` | Handling unit has been scanned out of a depot or at a delivery stop |


Version: 1.2.0

## Security

### oAuth2ClientCredentials

Type: oauth2

### BasicAuthWebhookCredentials

Type: http
Scheme: basic

## Download OpenAPI description

[Qargo TMS API](https://api-docs.qargo.com/_bundle/openapi.yaml)

## API / Accounting

### Create An Exchange Rate

 - [POST /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-accounting/create_an_exchange_rate_v1_accounting_exchange_rate_post.md): Creates an exchange rate in Qargo for the given currency pair and date.

### List Exchange Rates

 - [GET /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-accounting/list_exchange_rates_v1_accounting_exchange_rate_get.md): Retrieves a list of exchange rates with optional currency and date filters. When filtering by both from_currency and to_currency, results are returned in the requested direction regardless of how they are stored internally.

### Retrieve Purchase Credit Note

 - [GET /v1/accounting/purchase-credit-note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_credit_note_v1_accounting_purchase_credit_note__id__get.md)

### Update Purchase Credit Note

 - [PATCH /v1/accounting/purchase-credit-note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_purchase_credit_note_v1_accounting_purchase_credit_note__id__patch.md)

### Retrieve Purchase Credit Note Documents

 - [GET /v1/accounting/purchase-credit-note/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_credit_note_documents_v1_accounting_purchase_credit_note__id__documents_get.md)

### Report Refund Status For Purchase Credit Note

 - [POST /v1/accounting/purchase-credit-note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_refund_status_for_purchase_credit_note_v1_accounting_purchase_credit_note__id__refund_update_status_post.md)

### Retrieve Purchase Invoice

 - [GET /v1/accounting/purchase-invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice_v1_accounting_purchase_invoice__id__get.md)

### Update Purchase Invoice

 - [PATCH /v1/accounting/purchase-invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_purchase_invoice_v1_accounting_purchase_invoice__id__patch.md)

### Retrieve Purchase Invoice Documents

 - [GET /v1/accounting/purchase-invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice_documents_v1_accounting_purchase_invoice__id__documents_get.md)

### Report Payment Status For Purchase Invoice

 - [POST /v1/accounting/purchase-invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_purchase_invoice_v1_accounting_purchase_invoice__id__payment_update_status_post.md)

### Create A Sales Credit Note

 - [POST /v1/accounting/sales-credit-note/](https://api-docs.qargo.com/openapi/use-case-accounting/create_a_sales_credit_note_v1_accounting_sales_credit_note__post.md)

### Retrieve Sales Credit Note

 - [GET /v1/accounting/sales-credit-note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note_v1_accounting_sales_credit_note__id__get.md)

### Update Credit Note

 - [PATCH /v1/accounting/sales-credit-note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_credit_note_v1_accounting_sales_credit_note__id__patch.md)

### Retrieve Sales Credit Note Documents

 - [GET /v1/accounting/sales-credit-note/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note_documents_v1_accounting_sales_credit_note__id__documents_get.md)

### Report Refund Status For Sales Credit Note

 - [POST /v1/accounting/sales-credit-note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_refund_status_for_sales_credit_note_v1_accounting_sales_credit_note__id__refund_update_status_post.md)

### Create A Sales Invoice

 - [POST /v1/accounting/sales-invoice/](https://api-docs.qargo.com/openapi/use-case-accounting/create_a_sales_invoice_v1_accounting_sales_invoice__post.md)

### Retrieve Sales Invoice

 - [GET /v1/accounting/sales-invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice_v1_accounting_sales_invoice__id__get.md)

### Update Sales Invoice

 - [PATCH /v1/accounting/sales-invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_sales_invoice_v1_accounting_sales_invoice__id__patch.md)

### Retrieve Sales Invoice Documents

 - [GET /v1/accounting/sales-invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice_documents_v1_accounting_sales_invoice__id__documents_get.md)

### Report Payment Status For Sales Invoice

 - [POST /v1/accounting/sales-invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_sales_invoice_v1_accounting_sales_invoice__id__payment_update_status_post.md)

### List Invoices/Credit Notes To Sync

 - [GET /v1/accounting/sync-tasks](https://api-docs.qargo.com/openapi/use-case-accounting/list_invoices_credit_notes_to_sync_v1_accounting_sync_tasks_get.md)

### Get Details Of Invoice/Credit Note To Sync

 - [GET /v1/accounting/sync-tasks/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/get_details_of_invoice_credit_note_to_sync_v1_accounting_sync_tasks__id__get.md)

### Report Sync Status For Invoice/Credit Note

 - [POST /v1/accounting/sync-tasks/{id}/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_sync_status_for_invoice_credit_note_v1_accounting_sync_tasks__id__update_status_post.md)

### List Companies (Deprecated) (deprecated)

 - [GET /v1/accounting/company](https://api-docs.qargo.com/openapi/use-case-accounting/list_companies__deprecated__v1_accounting_company_get.md): (deprecated, use /company instead)

### Create Company (Deprecated) (deprecated)

 - [POST /v1/accounting/company](https://api-docs.qargo.com/openapi/use-case-accounting/create_company__deprecated__v1_accounting_company_post.md): (deprecated, use /company instead)

### Get Company (Deprecated) (deprecated)

 - [GET /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/get_company__deprecated__v1_accounting_company__id__get.md): (deprecated, use /company/{id} instead)

### Update Company (Deprecated) (deprecated)

 - [PUT /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_company__deprecated__v1_accounting_company__id__put.md): (deprecated, use /company/{id} instead)

### Update Company (Deprecated) (deprecated)

 - [PATCH /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_company__deprecated__v1_accounting_company__id__patch.md): (deprecated, use /company/{id} instead)

### Delete Company (Deprecated) (deprecated)

 - [DELETE /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/delete_company__deprecated__v1_accounting_company__id__delete.md): (deprecated, use /company/{id} instead)

### Retrieve Purchase Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__get.md): (deprecated, use /purchase-invoice/{id} instead)

### Retrieve Purchase Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__get.md): (deprecated, use /purchase-invoice/{id} instead)

### Update Purchase Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__patch.md): (deprecated, use /purchase-invoice/{id} instead)

### Update Purchase Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__patch.md): (deprecated, use /purchase-invoice/{id} instead)

### Retrieve Purchase Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice_documents__deprecated__v1_accounting_purchase_invoice__id__documents_get.md): (deprecated, use /purchase-invoice/{id}/documents instead)

### Retrieve Purchase Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice_documents__deprecated__v1_accounting_purchase_invoice__id__documents_get.md): (deprecated, use /purchase-invoice/{id}/documents instead)

### Report Payment Status For Purchase Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/purchase_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__payment_update_status_post.md): (deprecated, use /purchase-invoice/{id}/payment/update-status instead)

### Report Payment Status For Purchase Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/purchase_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__payment_update_status_post.md): (deprecated, use /purchase-invoice/{id}/payment/update-status instead)

### Retrieve Sales Credit Note (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__get.md): (deprecated, use /sales-credit-note/{id} instead)

### Retrieve Sales Credit Note (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__get.md): (deprecated, use /sales-credit-note/{id} instead)

### Update Credit Note (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_credit_note__deprecated__v1_accounting_sales_credit_note__id__patch.md): (deprecated, use /sales-credit-note/{id} instead)

### Update Credit Note (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_credit_note__deprecated__v1_accounting_sales_credit_note__id__patch.md): (deprecated, use /sales-credit-note/{id} instead)

### Retrieve Sales Credit Note Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note_documents__deprecated__v1_accounting_sales_credit_note__id__documents_get.md): (deprecated, use /sales-credit-note/{id}/documents instead)

### Retrieve Sales Credit Note Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note_documents__deprecated__v1_accounting_sales_credit_note__id__documents_get.md): (deprecated, use /sales-credit-note/{id}/documents instead)

### Report Refund Status For Sales Credit Note (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_credit_note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_refund_status_for_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__refund_update_status_post.md): (deprecated, use /sales-credit-note/{id}/refund/update-status instead)

### Report Refund Status For Sales Credit Note (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_credit_note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_refund_status_for_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__refund_update_status_post.md): (deprecated, use /sales-credit-note/{id}/refund/update-status instead)

### Retrieve Sales Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice__deprecated__v1_accounting_sales_invoice__id__get.md): (deprecated, use /sales-invoice/{id} instead)

### Retrieve Sales Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice__deprecated__v1_accounting_sales_invoice__id__get.md): (deprecated, use /sales-invoice/{id} instead)

### Update Sales Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_sales_invoice__deprecated__v1_accounting_sales_invoice__id__patch.md): (deprecated, use /sales-invoice/{id} instead)

### Update Sales Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_sales_invoice__deprecated__v1_accounting_sales_invoice__id__patch.md): (deprecated, use /sales-invoice/{id} instead)

### Retrieve Sales Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice_documents__deprecated__v1_accounting_sales_invoice__id__documents_get.md): (deprecated, use /sales-invoice/{id}/documents instead)

### Retrieve Sales Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice_documents__deprecated__v1_accounting_sales_invoice__id__documents_get.md): (deprecated, use /sales-invoice/{id}/documents instead)

### Report Payment Status For Sales Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_sales_invoice__deprecated__v1_accounting_sales_invoice__id__payment_update_status_post.md): (deprecated, use /sales-invoice/{id}/payment/update-status instead)

### Report Payment Status For Sales Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_sales_invoice__deprecated__v1_accounting_sales_invoice__id__payment_update_status_post.md): (deprecated, use /sales-invoice/{id}/payment/update-status instead)

### Create An Exchange Rate

 - [POST /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_an_exchange_rate_v1_accounting_exchange_rate_post.md): Creates an exchange rate in Qargo for the given currency pair and date.

### List Exchange Rates

 - [GET /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_exchange_rates_v1_accounting_exchange_rate_get.md): Retrieves a list of exchange rates with optional currency and date filters. When filtering by both from_currency and to_currency, results are returned in the requested direction regardless of how they are stored internally.

### Create An Exchange Rate

 - [POST /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/api-accounting/create_an_exchange_rate_v1_accounting_exchange_rate_post.md): Creates an exchange rate in Qargo for the given currency pair and date.

### List Exchange Rates

 - [GET /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/api-accounting/list_exchange_rates_v1_accounting_exchange_rate_get.md): Retrieves a list of exchange rates with optional currency and date filters. When filtering by both from_currency and to_currency, results are returned in the requested direction regardless of how they are stored internally.

### Retrieve Purchase Credit Note

 - [GET /v1/accounting/purchase-credit-note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_credit_note_v1_accounting_purchase_credit_note__id__get.md)

### Update Purchase Credit Note

 - [PATCH /v1/accounting/purchase-credit-note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_credit_note_v1_accounting_purchase_credit_note__id__patch.md)

### Retrieve Purchase Credit Note Documents

 - [GET /v1/accounting/purchase-credit-note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_credit_note_documents_v1_accounting_purchase_credit_note__id__documents_get.md)

### Report Refund Status For Purchase Credit Note

 - [POST /v1/accounting/purchase-credit-note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_purchase_credit_note_v1_accounting_purchase_credit_note__id__refund_update_status_post.md)

### Retrieve Purchase Invoice

 - [GET /v1/accounting/purchase-invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_v1_accounting_purchase_invoice__id__get.md)

### Update Purchase Invoice

 - [PATCH /v1/accounting/purchase-invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_invoice_v1_accounting_purchase_invoice__id__patch.md)

### Retrieve Purchase Invoice Documents

 - [GET /v1/accounting/purchase-invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_documents_v1_accounting_purchase_invoice__id__documents_get.md)

### Report Payment Status For Purchase Invoice

 - [POST /v1/accounting/purchase-invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_purchase_invoice_v1_accounting_purchase_invoice__id__payment_update_status_post.md)

### Create A Sales Credit Note

 - [POST /v1/accounting/sales-credit-note/](https://api-docs.qargo.com/openapi/api-accounting/create_a_sales_credit_note_v1_accounting_sales_credit_note__post.md)

### Retrieve Sales Credit Note

 - [GET /v1/accounting/sales-credit-note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_v1_accounting_sales_credit_note__id__get.md)

### Update Credit Note

 - [PATCH /v1/accounting/sales-credit-note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_credit_note_v1_accounting_sales_credit_note__id__patch.md)

### Retrieve Sales Credit Note Documents

 - [GET /v1/accounting/sales-credit-note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_documents_v1_accounting_sales_credit_note__id__documents_get.md)

### Report Refund Status For Sales Credit Note

 - [POST /v1/accounting/sales-credit-note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_sales_credit_note_v1_accounting_sales_credit_note__id__refund_update_status_post.md)

### Create A Sales Invoice

 - [POST /v1/accounting/sales-invoice/](https://api-docs.qargo.com/openapi/api-accounting/create_a_sales_invoice_v1_accounting_sales_invoice__post.md)

### Retrieve Sales Invoice

 - [GET /v1/accounting/sales-invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_v1_accounting_sales_invoice__id__get.md)

### Update Sales Invoice

 - [PATCH /v1/accounting/sales-invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_sales_invoice_v1_accounting_sales_invoice__id__patch.md)

### Retrieve Sales Invoice Documents

 - [GET /v1/accounting/sales-invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_documents_v1_accounting_sales_invoice__id__documents_get.md)

### Report Payment Status For Sales Invoice

 - [POST /v1/accounting/sales-invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_sales_invoice_v1_accounting_sales_invoice__id__payment_update_status_post.md)

### List Invoices/Credit Notes To Sync

 - [GET /v1/accounting/sync-tasks](https://api-docs.qargo.com/openapi/api-accounting/list_invoices_credit_notes_to_sync_v1_accounting_sync_tasks_get.md)

### Get Details Of Invoice/Credit Note To Sync

 - [GET /v1/accounting/sync-tasks/{id}](https://api-docs.qargo.com/openapi/api-accounting/get_details_of_invoice_credit_note_to_sync_v1_accounting_sync_tasks__id__get.md)

### Report Sync Status For Invoice/Credit Note

 - [POST /v1/accounting/sync-tasks/{id}/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_sync_status_for_invoice_credit_note_v1_accounting_sync_tasks__id__update_status_post.md)

### List Companies (Deprecated) (deprecated)

 - [GET /v1/accounting/company](https://api-docs.qargo.com/openapi/api-accounting/list_companies__deprecated__v1_accounting_company_get.md): (deprecated, use /company instead)

### Create Company (Deprecated) (deprecated)

 - [POST /v1/accounting/company](https://api-docs.qargo.com/openapi/api-accounting/create_company__deprecated__v1_accounting_company_post.md): (deprecated, use /company instead)

### Get Company (Deprecated) (deprecated)

 - [GET /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/api-accounting/get_company__deprecated__v1_accounting_company__id__get.md): (deprecated, use /company/{id} instead)

### Update Company (Deprecated) (deprecated)

 - [PUT /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_company__deprecated__v1_accounting_company__id__put.md): (deprecated, use /company/{id} instead)

### Update Company (Deprecated) (deprecated)

 - [PATCH /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_company__deprecated__v1_accounting_company__id__patch.md): (deprecated, use /company/{id} instead)

### Delete Company (Deprecated) (deprecated)

 - [DELETE /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/api-accounting/delete_company__deprecated__v1_accounting_company__id__delete.md): (deprecated, use /company/{id} instead)

### Retrieve Purchase Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__get.md): (deprecated, use /purchase-invoice/{id} instead)

### Retrieve Purchase Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__get.md): (deprecated, use /purchase-invoice/{id} instead)

### Retrieve Purchase Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__get.md): (deprecated, use /purchase-invoice/{id} instead)

### Retrieve Purchase Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__get.md): (deprecated, use /purchase-invoice/{id} instead)

### Update Purchase Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__patch.md): (deprecated, use /purchase-invoice/{id} instead)

### Update Purchase Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__patch.md): (deprecated, use /purchase-invoice/{id} instead)

### Update Purchase Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__patch.md): (deprecated, use /purchase-invoice/{id} instead)

### Update Purchase Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__patch.md): (deprecated, use /purchase-invoice/{id} instead)

### Retrieve Purchase Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_documents__deprecated__v1_accounting_purchase_invoice__id__documents_get.md): (deprecated, use /purchase-invoice/{id}/documents instead)

### Retrieve Purchase Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_documents__deprecated__v1_accounting_purchase_invoice__id__documents_get.md): (deprecated, use /purchase-invoice/{id}/documents instead)

### Retrieve Purchase Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_documents__deprecated__v1_accounting_purchase_invoice__id__documents_get.md): (deprecated, use /purchase-invoice/{id}/documents instead)

### Retrieve Purchase Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_documents__deprecated__v1_accounting_purchase_invoice__id__documents_get.md): (deprecated, use /purchase-invoice/{id}/documents instead)

### Report Payment Status For Purchase Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/purchase_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__payment_update_status_post.md): (deprecated, use /purchase-invoice/{id}/payment/update-status instead)

### Report Payment Status For Purchase Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/purchase_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__payment_update_status_post.md): (deprecated, use /purchase-invoice/{id}/payment/update-status instead)

### Report Payment Status For Purchase Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/purchase_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__payment_update_status_post.md): (deprecated, use /purchase-invoice/{id}/payment/update-status instead)

### Report Payment Status For Purchase Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/purchase_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__payment_update_status_post.md): (deprecated, use /purchase-invoice/{id}/payment/update-status instead)

### Retrieve Sales Credit Note (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__get.md): (deprecated, use /sales-credit-note/{id} instead)

### Retrieve Sales Credit Note (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__get.md): (deprecated, use /sales-credit-note/{id} instead)

### Retrieve Sales Credit Note (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__get.md): (deprecated, use /sales-credit-note/{id} instead)

### Retrieve Sales Credit Note (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__get.md): (deprecated, use /sales-credit-note/{id} instead)

### Update Credit Note (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_credit_note__deprecated__v1_accounting_sales_credit_note__id__patch.md): (deprecated, use /sales-credit-note/{id} instead)

### Update Credit Note (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_credit_note__deprecated__v1_accounting_sales_credit_note__id__patch.md): (deprecated, use /sales-credit-note/{id} instead)

### Update Credit Note (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_credit_note__deprecated__v1_accounting_sales_credit_note__id__patch.md): (deprecated, use /sales-credit-note/{id} instead)

### Update Credit Note (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_credit_note__deprecated__v1_accounting_sales_credit_note__id__patch.md): (deprecated, use /sales-credit-note/{id} instead)

### Retrieve Sales Credit Note Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_documents__deprecated__v1_accounting_sales_credit_note__id__documents_get.md): (deprecated, use /sales-credit-note/{id}/documents instead)

### Retrieve Sales Credit Note Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_documents__deprecated__v1_accounting_sales_credit_note__id__documents_get.md): (deprecated, use /sales-credit-note/{id}/documents instead)

### Retrieve Sales Credit Note Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_documents__deprecated__v1_accounting_sales_credit_note__id__documents_get.md): (deprecated, use /sales-credit-note/{id}/documents instead)

### Retrieve Sales Credit Note Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_documents__deprecated__v1_accounting_sales_credit_note__id__documents_get.md): (deprecated, use /sales-credit-note/{id}/documents instead)

### Report Refund Status For Sales Credit Note (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_credit_note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__refund_update_status_post.md): (deprecated, use /sales-credit-note/{id}/refund/update-status instead)

### Report Refund Status For Sales Credit Note (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_credit_note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__refund_update_status_post.md): (deprecated, use /sales-credit-note/{id}/refund/update-status instead)

### Report Refund Status For Sales Credit Note (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_credit_note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__refund_update_status_post.md): (deprecated, use /sales-credit-note/{id}/refund/update-status instead)

### Report Refund Status For Sales Credit Note (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_credit_note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__refund_update_status_post.md): (deprecated, use /sales-credit-note/{id}/refund/update-status instead)

### Retrieve Sales Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice__deprecated__v1_accounting_sales_invoice__id__get.md): (deprecated, use /sales-invoice/{id} instead)

### Retrieve Sales Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice__deprecated__v1_accounting_sales_invoice__id__get.md): (deprecated, use /sales-invoice/{id} instead)

### Retrieve Sales Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice__deprecated__v1_accounting_sales_invoice__id__get.md): (deprecated, use /sales-invoice/{id} instead)

### Retrieve Sales Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice__deprecated__v1_accounting_sales_invoice__id__get.md): (deprecated, use /sales-invoice/{id} instead)

### Update Sales Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_sales_invoice__deprecated__v1_accounting_sales_invoice__id__patch.md): (deprecated, use /sales-invoice/{id} instead)

### Update Sales Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_sales_invoice__deprecated__v1_accounting_sales_invoice__id__patch.md): (deprecated, use /sales-invoice/{id} instead)

### Update Sales Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_sales_invoice__deprecated__v1_accounting_sales_invoice__id__patch.md): (deprecated, use /sales-invoice/{id} instead)

### Update Sales Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_sales_invoice__deprecated__v1_accounting_sales_invoice__id__patch.md): (deprecated, use /sales-invoice/{id} instead)

### Retrieve Sales Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_documents__deprecated__v1_accounting_sales_invoice__id__documents_get.md): (deprecated, use /sales-invoice/{id}/documents instead)

### Retrieve Sales Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_documents__deprecated__v1_accounting_sales_invoice__id__documents_get.md): (deprecated, use /sales-invoice/{id}/documents instead)

### Retrieve Sales Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_documents__deprecated__v1_accounting_sales_invoice__id__documents_get.md): (deprecated, use /sales-invoice/{id}/documents instead)

### Retrieve Sales Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_documents__deprecated__v1_accounting_sales_invoice__id__documents_get.md): (deprecated, use /sales-invoice/{id}/documents instead)

### Report Payment Status For Sales Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_sales_invoice__deprecated__v1_accounting_sales_invoice__id__payment_update_status_post.md): (deprecated, use /sales-invoice/{id}/payment/update-status instead)

### Report Payment Status For Sales Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_sales_invoice__deprecated__v1_accounting_sales_invoice__id__payment_update_status_post.md): (deprecated, use /sales-invoice/{id}/payment/update-status instead)

### Report Payment Status For Sales Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_sales_invoice__deprecated__v1_accounting_sales_invoice__id__payment_update_status_post.md): (deprecated, use /sales-invoice/{id}/payment/update-status instead)

### Report Payment Status For Sales Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_sales_invoice__deprecated__v1_accounting_sales_invoice__id__payment_update_status_post.md): (deprecated, use /sales-invoice/{id}/payment/update-status instead)

## Use case / Master data sync

Required api role: `API_MASTER_DATA`, or `API_ACCOUNTING` for company sync only.


### Create An Exchange Rate

 - [POST /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-accounting/create_an_exchange_rate_v1_accounting_exchange_rate_post.md): Creates an exchange rate in Qargo for the given currency pair and date.

### List Exchange Rates

 - [GET /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-accounting/list_exchange_rates_v1_accounting_exchange_rate_get.md): Retrieves a list of exchange rates with optional currency and date filters. When filtering by both from_currency and to_currency, results are returned in the requested direction regardless of how they are stored internally.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-accounting/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-customer-portal/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Create An Exchange Rate

 - [POST /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_an_exchange_rate_v1_accounting_exchange_rate_post.md): Creates an exchange rate in Qargo for the given currency pair and date.

### List Exchange Rates

 - [GET /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_exchange_rates_v1_accounting_exchange_rate_get.md): Retrieves a list of exchange rates with optional currency and date filters. When filtering by both from_currency and to_currency, results are returned in the requested direction regardless of how they are stored internally.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-master-data-sync/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### List Companies

 - [GET /v1/companies/company](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_companies_v1_companies_company_get.md)

### Create Company

 - [POST /v1/companies/company](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_company_v1_companies_company_post.md)

### Get Company Documents

 - [GET /v1/companies/company/{company_id}/documents](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_company_documents_v1_companies_company__company_id__documents_get.md): Fetch all documents for a specific company.

### Create Company Document

 - [POST /v1/companies/company/{company_id}/documents](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_company_document_v1_companies_company__company_id__documents_post.md): Upload a document for a specific company.

### List Company Validities

 - [GET /v1/companies/company/{company_id}/validity](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_company_validities_v1_companies_company__company_id__validity_get.md): List all validities for a company.

### Create Company Validity Request

 - [POST /v1/companies/company/{company_id}/validity](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_company_validity_request_v1_companies_company__company_id__validity_post.md): Create a new validity request for a company.

### Get Company Validity

 - [GET /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_company_validity_v1_companies_company__company_id__validity__id__get.md): Fetches a specific validity for a company.

### Update Company Validity

 - [PUT /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_company_validity_v1_companies_company__company_id__validity__id__put.md): Update an existing validity for a company.

### Delete Company Validity

 - [DELETE /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/delete_company_validity_v1_companies_company__company_id__validity__id__delete.md): Delete a company validity.

### Get Company Validity Documents

 - [GET /v1/companies/company/{company_id}/validity/{id}/documents](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_company_validity_documents_v1_companies_company__company_id__validity__id__documents_get.md): Fetch all documents associated with a specific company validity.

### Get Company

 - [GET /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_company_v1_companies_company__id__get.md)

### Update Company

 - [PUT /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_company_v1_companies_company__id__put.md)

### Update Company

 - [PATCH /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_company_v1_companies_company__id__patch.md)

### Delete Company

 - [DELETE /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/delete_company_v1_companies_company__id__delete.md)

### Create Resource

 - [POST /v1/resources/resource](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_resource_v1_resources_resource_post.md): Create a new resource.

### List Resources

 - [GET /v1/resources/resource](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_resources_v1_resources_resource_get.md): List all resources

### Update Resource

 - [PUT /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_resource_v1_resources_resource__resource_id__put.md): Update an existing resource.

### Patch Resource

 - [PATCH /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/patch_resource_v1_resources_resource__resource_id__patch.md): Partially update an existing resource.

### Archive Resource

 - [DELETE /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/archive_resource_v1_resources_resource__resource_id__delete.md): Archive a resource

### Get Resource

 - [GET /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_resource_v1_resources_resource__resource_id__get.md): Fetches a resource

### List Resource Unavailabilities

 - [GET /v1/resources/resource/{resource_id}/unavailability](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_resource_unavailabilities_v1_resources_resource__resource_id__unavailability_get.md): List all unavailabilities for a resource

### Create Resource Unavailabilities

 - [POST /v1/resources/resource/{resource_id}/unavailability](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_resource_unavailabilities_v1_resources_resource__resource_id__unavailability_post.md): Create a new unavailability for a resource.

### Get Resource Unavailability

 - [GET /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_resource_unavailability_v1_resources_resource__resource_id__unavailability__id__get.md): Fetch a resource unavailability

### Update Resource Unavailabilities

 - [PUT /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_resource_unavailabilities_v1_resources_resource__resource_id__unavailability__id__put.md): Update an existing unavailability for a resource.

### Delete Resource Unavailabilities

 - [DELETE /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/delete_resource_unavailabilities_v1_resources_resource__resource_id__unavailability__id__delete.md): Delete a resource unavailability

### List Resource Validities

 - [GET /v1/resources/resource/{resource_id}/validity](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_resource_validities_v1_resources_resource__resource_id__validity_get.md): List all validities for a resource

### Create Resource Validity Request

 - [POST /v1/resources/resource/{resource_id}/validity](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_resource_validity_request_v1_resources_resource__resource_id__validity_post.md): Create a new validity request for a resource.

### Get Resource Validity

 - [GET /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_resource_validity_v1_resources_resource__resource_id__validity__id__get.md): Fetches a specific validity for a resource

### Update Resource Validity

 - [PUT /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_resource_validity_v1_resources_resource__resource_id__validity__id__put.md): Update an existing validity for a resource.

### Delete Resource Validity

 - [DELETE /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/delete_resource_validity_v1_resources_resource__resource_id__validity__id__delete.md): Delete a resource validity

### Get Resource Validity Documents

 - [GET /v1/resources/resource/{resource_id}/validity/{id}/documents](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_resource_validity_documents_v1_resources_resource__resource_id__validity__id__documents_get.md): Fetch all documents associated with a specific resource validity.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-order/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Create An Exchange Rate

 - [POST /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/api-accounting/create_an_exchange_rate_v1_accounting_exchange_rate_post.md): Creates an exchange rate in Qargo for the given currency pair and date.

### List Exchange Rates

 - [GET /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/api-accounting/list_exchange_rates_v1_accounting_exchange_rate_get.md): Retrieves a list of exchange rates with optional currency and date filters. When filtering by both from_currency and to_currency, results are returned in the requested direction regardless of how they are stored internally.

### List Companies

 - [GET /v1/companies/company](https://api-docs.qargo.com/openapi/api-company/list_companies_v1_companies_company_get.md)

### Create Company

 - [POST /v1/companies/company](https://api-docs.qargo.com/openapi/api-company/create_company_v1_companies_company_post.md)

### Get Company Documents

 - [GET /v1/companies/company/{company_id}/documents](https://api-docs.qargo.com/openapi/api-company/get_company_documents_v1_companies_company__company_id__documents_get.md): Fetch all documents for a specific company.

### Create Company Document

 - [POST /v1/companies/company/{company_id}/documents](https://api-docs.qargo.com/openapi/api-company/create_company_document_v1_companies_company__company_id__documents_post.md): Upload a document for a specific company.

### List Company Validities

 - [GET /v1/companies/company/{company_id}/validity](https://api-docs.qargo.com/openapi/api-company/list_company_validities_v1_companies_company__company_id__validity_get.md): List all validities for a company.

### Create Company Validity Request

 - [POST /v1/companies/company/{company_id}/validity](https://api-docs.qargo.com/openapi/api-company/create_company_validity_request_v1_companies_company__company_id__validity_post.md): Create a new validity request for a company.

### Get Company Validity

 - [GET /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-company/get_company_validity_v1_companies_company__company_id__validity__id__get.md): Fetches a specific validity for a company.

### Update Company Validity

 - [PUT /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-company/update_company_validity_v1_companies_company__company_id__validity__id__put.md): Update an existing validity for a company.

### Delete Company Validity

 - [DELETE /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-company/delete_company_validity_v1_companies_company__company_id__validity__id__delete.md): Delete a company validity.

### Get Company Validity Documents

 - [GET /v1/companies/company/{company_id}/validity/{id}/documents](https://api-docs.qargo.com/openapi/api-company/get_company_validity_documents_v1_companies_company__company_id__validity__id__documents_get.md): Fetch all documents associated with a specific company validity.

### Get Company

 - [GET /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/api-company/get_company_v1_companies_company__id__get.md)

### Update Company

 - [PUT /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/api-company/update_company_v1_companies_company__id__put.md)

### Update Company

 - [PATCH /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/api-company/update_company_v1_companies_company__id__patch.md)

### Delete Company

 - [DELETE /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/api-company/delete_company_v1_companies_company__id__delete.md)

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/api-document/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Create Resource

 - [POST /v1/resources/resource](https://api-docs.qargo.com/openapi/api-resource/create_resource_v1_resources_resource_post.md): Create a new resource.

### List Resources

 - [GET /v1/resources/resource](https://api-docs.qargo.com/openapi/api-resource/list_resources_v1_resources_resource_get.md): List all resources

### Update Resource

 - [PUT /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/api-resource/update_resource_v1_resources_resource__resource_id__put.md): Update an existing resource.

### Patch Resource

 - [PATCH /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/api-resource/patch_resource_v1_resources_resource__resource_id__patch.md): Partially update an existing resource.

### Archive Resource

 - [DELETE /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/api-resource/archive_resource_v1_resources_resource__resource_id__delete.md): Archive a resource

### Get Resource

 - [GET /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/api-resource/get_resource_v1_resources_resource__resource_id__get.md): Fetches a resource

### List Resource Unavailabilities

 - [GET /v1/resources/resource/{resource_id}/unavailability](https://api-docs.qargo.com/openapi/api-resource/list_resource_unavailabilities_v1_resources_resource__resource_id__unavailability_get.md): List all unavailabilities for a resource

### Create Resource Unavailabilities

 - [POST /v1/resources/resource/{resource_id}/unavailability](https://api-docs.qargo.com/openapi/api-resource/create_resource_unavailabilities_v1_resources_resource__resource_id__unavailability_post.md): Create a new unavailability for a resource.

### Get Resource Unavailability

 - [GET /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/api-resource/get_resource_unavailability_v1_resources_resource__resource_id__unavailability__id__get.md): Fetch a resource unavailability

### Update Resource Unavailabilities

 - [PUT /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/api-resource/update_resource_unavailabilities_v1_resources_resource__resource_id__unavailability__id__put.md): Update an existing unavailability for a resource.

### Delete Resource Unavailabilities

 - [DELETE /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/api-resource/delete_resource_unavailabilities_v1_resources_resource__resource_id__unavailability__id__delete.md): Delete a resource unavailability

### List Resource Validities

 - [GET /v1/resources/resource/{resource_id}/validity](https://api-docs.qargo.com/openapi/api-resource/list_resource_validities_v1_resources_resource__resource_id__validity_get.md): List all validities for a resource

### Create Resource Validity Request

 - [POST /v1/resources/resource/{resource_id}/validity](https://api-docs.qargo.com/openapi/api-resource/create_resource_validity_request_v1_resources_resource__resource_id__validity_post.md): Create a new validity request for a resource.

### Get Resource Validity

 - [GET /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-resource/get_resource_validity_v1_resources_resource__resource_id__validity__id__get.md): Fetches a specific validity for a resource

### Update Resource Validity

 - [PUT /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-resource/update_resource_validity_v1_resources_resource__resource_id__validity__id__put.md): Update an existing validity for a resource.

### Delete Resource Validity

 - [DELETE /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-resource/delete_resource_validity_v1_resources_resource__resource_id__validity__id__delete.md): Delete a resource validity

### Get Resource Validity Documents

 - [GET /v1/resources/resource/{resource_id}/validity/{id}/documents](https://api-docs.qargo.com/openapi/api-resource/get_resource_validity_documents_v1_resources_resource__resource_id__validity__id__documents_get.md): Fetch all documents associated with a specific resource validity.

## Use case / Accounting

Required role: `API_ACCOUNTING`.

See [Accounting](#section/Accounting) for more information.


### Create An Exchange Rate

 - [POST /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-accounting/create_an_exchange_rate_v1_accounting_exchange_rate_post.md): Creates an exchange rate in Qargo for the given currency pair and date.

### List Exchange Rates

 - [GET /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-accounting/list_exchange_rates_v1_accounting_exchange_rate_get.md): Retrieves a list of exchange rates with optional currency and date filters. When filtering by both from_currency and to_currency, results are returned in the requested direction regardless of how they are stored internally.

### Retrieve Purchase Credit Note

 - [GET /v1/accounting/purchase-credit-note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_credit_note_v1_accounting_purchase_credit_note__id__get.md)

### Update Purchase Credit Note

 - [PATCH /v1/accounting/purchase-credit-note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_purchase_credit_note_v1_accounting_purchase_credit_note__id__patch.md)

### Retrieve Purchase Credit Note Documents

 - [GET /v1/accounting/purchase-credit-note/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_credit_note_documents_v1_accounting_purchase_credit_note__id__documents_get.md)

### Report Refund Status For Purchase Credit Note

 - [POST /v1/accounting/purchase-credit-note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_refund_status_for_purchase_credit_note_v1_accounting_purchase_credit_note__id__refund_update_status_post.md)

### Retrieve Purchase Invoice

 - [GET /v1/accounting/purchase-invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice_v1_accounting_purchase_invoice__id__get.md)

### Update Purchase Invoice

 - [PATCH /v1/accounting/purchase-invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_purchase_invoice_v1_accounting_purchase_invoice__id__patch.md)

### Retrieve Purchase Invoice Documents

 - [GET /v1/accounting/purchase-invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice_documents_v1_accounting_purchase_invoice__id__documents_get.md)

### Report Payment Status For Purchase Invoice

 - [POST /v1/accounting/purchase-invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_purchase_invoice_v1_accounting_purchase_invoice__id__payment_update_status_post.md)

### Create A Sales Credit Note

 - [POST /v1/accounting/sales-credit-note/](https://api-docs.qargo.com/openapi/use-case-accounting/create_a_sales_credit_note_v1_accounting_sales_credit_note__post.md)

### Retrieve Sales Credit Note

 - [GET /v1/accounting/sales-credit-note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note_v1_accounting_sales_credit_note__id__get.md)

### Update Credit Note

 - [PATCH /v1/accounting/sales-credit-note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_credit_note_v1_accounting_sales_credit_note__id__patch.md)

### Retrieve Sales Credit Note Documents

 - [GET /v1/accounting/sales-credit-note/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note_documents_v1_accounting_sales_credit_note__id__documents_get.md)

### Report Refund Status For Sales Credit Note

 - [POST /v1/accounting/sales-credit-note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_refund_status_for_sales_credit_note_v1_accounting_sales_credit_note__id__refund_update_status_post.md)

### Create A Sales Invoice

 - [POST /v1/accounting/sales-invoice/](https://api-docs.qargo.com/openapi/use-case-accounting/create_a_sales_invoice_v1_accounting_sales_invoice__post.md)

### Retrieve Sales Invoice

 - [GET /v1/accounting/sales-invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice_v1_accounting_sales_invoice__id__get.md)

### Update Sales Invoice

 - [PATCH /v1/accounting/sales-invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_sales_invoice_v1_accounting_sales_invoice__id__patch.md)

### Retrieve Sales Invoice Documents

 - [GET /v1/accounting/sales-invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice_documents_v1_accounting_sales_invoice__id__documents_get.md)

### Report Payment Status For Sales Invoice

 - [POST /v1/accounting/sales-invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_sales_invoice_v1_accounting_sales_invoice__id__payment_update_status_post.md)

### List Invoices/Credit Notes To Sync

 - [GET /v1/accounting/sync-tasks](https://api-docs.qargo.com/openapi/use-case-accounting/list_invoices_credit_notes_to_sync_v1_accounting_sync_tasks_get.md)

### Get Details Of Invoice/Credit Note To Sync

 - [GET /v1/accounting/sync-tasks/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/get_details_of_invoice_credit_note_to_sync_v1_accounting_sync_tasks__id__get.md)

### Report Sync Status For Invoice/Credit Note

 - [POST /v1/accounting/sync-tasks/{id}/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_sync_status_for_invoice_credit_note_v1_accounting_sync_tasks__id__update_status_post.md)

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-accounting/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### External Billing Document (Invoice/Credit-Note) Update

 - [POST /v1/webhook/billing-document-update](https://api-docs.qargo.com/openapi/use-case-accounting/billing-document-update-webhook.md): Update billing document metadata (invoices, credit notes) from an external accounting system.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

Use this endpoint to push document status changes or related metadata updates back to Qargo.
This is typically triggered when your external accounting system processes billing documents.

### Accounting Visibility Event

 - [POST https://<accounting-visibility-event-receiving-payload>](https://api-docs.qargo.com/openapi/use-case-accounting/accounting_visibility_eventhttps____accounting_visibility_event_receiving_payload__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### List Companies (Deprecated) (deprecated)

 - [GET /v1/accounting/company](https://api-docs.qargo.com/openapi/use-case-accounting/list_companies__deprecated__v1_accounting_company_get.md): (deprecated, use /company instead)

### Create Company (Deprecated) (deprecated)

 - [POST /v1/accounting/company](https://api-docs.qargo.com/openapi/use-case-accounting/create_company__deprecated__v1_accounting_company_post.md): (deprecated, use /company instead)

### Get Company (Deprecated) (deprecated)

 - [GET /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/get_company__deprecated__v1_accounting_company__id__get.md): (deprecated, use /company/{id} instead)

### Update Company (Deprecated) (deprecated)

 - [PUT /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_company__deprecated__v1_accounting_company__id__put.md): (deprecated, use /company/{id} instead)

### Update Company (Deprecated) (deprecated)

 - [PATCH /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_company__deprecated__v1_accounting_company__id__patch.md): (deprecated, use /company/{id} instead)

### Delete Company (Deprecated) (deprecated)

 - [DELETE /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/delete_company__deprecated__v1_accounting_company__id__delete.md): (deprecated, use /company/{id} instead)

### Retrieve Purchase Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__get.md): (deprecated, use /purchase-invoice/{id} instead)

### Update Purchase Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__patch.md): (deprecated, use /purchase-invoice/{id} instead)

### Retrieve Purchase Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_purchase_invoice_documents__deprecated__v1_accounting_purchase_invoice__id__documents_get.md): (deprecated, use /purchase-invoice/{id}/documents instead)

### Report Payment Status For Purchase Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/purchase_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__payment_update_status_post.md): (deprecated, use /purchase-invoice/{id}/payment/update-status instead)

### Retrieve Sales Credit Note (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__get.md): (deprecated, use /sales-credit-note/{id} instead)

### Update Credit Note (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_credit_note__deprecated__v1_accounting_sales_credit_note__id__patch.md): (deprecated, use /sales-credit-note/{id} instead)

### Retrieve Sales Credit Note Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_credit_note_documents__deprecated__v1_accounting_sales_credit_note__id__documents_get.md): (deprecated, use /sales-credit-note/{id}/documents instead)

### Report Refund Status For Sales Credit Note (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_credit_note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_refund_status_for_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__refund_update_status_post.md): (deprecated, use /sales-credit-note/{id}/refund/update-status instead)

### Retrieve Sales Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice__deprecated__v1_accounting_sales_invoice__id__get.md): (deprecated, use /sales-invoice/{id} instead)

### Update Sales Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/use-case-accounting/update_sales_invoice__deprecated__v1_accounting_sales_invoice__id__patch.md): (deprecated, use /sales-invoice/{id} instead)

### Retrieve Sales Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}/documents](https://api-docs.qargo.com/openapi/use-case-accounting/retrieve_sales_invoice_documents__deprecated__v1_accounting_sales_invoice__id__documents_get.md): (deprecated, use /sales-invoice/{id}/documents instead)

### Report Payment Status For Sales Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/use-case-accounting/report_payment_status_for_sales_invoice__deprecated__v1_accounting_sales_invoice__id__payment_update_status_post.md): (deprecated, use /sales-invoice/{id}/payment/update-status instead)

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-customer-portal/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Create An Exchange Rate

 - [POST /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_an_exchange_rate_v1_accounting_exchange_rate_post.md): Creates an exchange rate in Qargo for the given currency pair and date.

### List Exchange Rates

 - [GET /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_exchange_rates_v1_accounting_exchange_rate_get.md): Retrieves a list of exchange rates with optional currency and date filters. When filtering by both from_currency and to_currency, results are returned in the requested direction regardless of how they are stored internally.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-master-data-sync/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-order/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Accounting Visibility Event

 - [POST https://<accounting-visibility-event-receiving-payload>](https://api-docs.qargo.com/openapi/use-case-visibility/accounting_visibility_eventhttps____accounting_visibility_event_receiving_payload__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Create An Exchange Rate

 - [POST /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/api-accounting/create_an_exchange_rate_v1_accounting_exchange_rate_post.md): Creates an exchange rate in Qargo for the given currency pair and date.

### List Exchange Rates

 - [GET /v1/accounting/exchange-rate](https://api-docs.qargo.com/openapi/api-accounting/list_exchange_rates_v1_accounting_exchange_rate_get.md): Retrieves a list of exchange rates with optional currency and date filters. When filtering by both from_currency and to_currency, results are returned in the requested direction regardless of how they are stored internally.

### Retrieve Purchase Credit Note

 - [GET /v1/accounting/purchase-credit-note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_credit_note_v1_accounting_purchase_credit_note__id__get.md)

### Update Purchase Credit Note

 - [PATCH /v1/accounting/purchase-credit-note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_credit_note_v1_accounting_purchase_credit_note__id__patch.md)

### Retrieve Purchase Credit Note Documents

 - [GET /v1/accounting/purchase-credit-note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_credit_note_documents_v1_accounting_purchase_credit_note__id__documents_get.md)

### Report Refund Status For Purchase Credit Note

 - [POST /v1/accounting/purchase-credit-note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_purchase_credit_note_v1_accounting_purchase_credit_note__id__refund_update_status_post.md)

### Retrieve Purchase Invoice

 - [GET /v1/accounting/purchase-invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_v1_accounting_purchase_invoice__id__get.md)

### Update Purchase Invoice

 - [PATCH /v1/accounting/purchase-invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_invoice_v1_accounting_purchase_invoice__id__patch.md)

### Retrieve Purchase Invoice Documents

 - [GET /v1/accounting/purchase-invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_documents_v1_accounting_purchase_invoice__id__documents_get.md)

### Report Payment Status For Purchase Invoice

 - [POST /v1/accounting/purchase-invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_purchase_invoice_v1_accounting_purchase_invoice__id__payment_update_status_post.md)

### Create A Sales Credit Note

 - [POST /v1/accounting/sales-credit-note/](https://api-docs.qargo.com/openapi/api-accounting/create_a_sales_credit_note_v1_accounting_sales_credit_note__post.md)

### Retrieve Sales Credit Note

 - [GET /v1/accounting/sales-credit-note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_v1_accounting_sales_credit_note__id__get.md)

### Update Credit Note

 - [PATCH /v1/accounting/sales-credit-note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_credit_note_v1_accounting_sales_credit_note__id__patch.md)

### Retrieve Sales Credit Note Documents

 - [GET /v1/accounting/sales-credit-note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_documents_v1_accounting_sales_credit_note__id__documents_get.md)

### Report Refund Status For Sales Credit Note

 - [POST /v1/accounting/sales-credit-note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_sales_credit_note_v1_accounting_sales_credit_note__id__refund_update_status_post.md)

### Create A Sales Invoice

 - [POST /v1/accounting/sales-invoice/](https://api-docs.qargo.com/openapi/api-accounting/create_a_sales_invoice_v1_accounting_sales_invoice__post.md)

### Retrieve Sales Invoice

 - [GET /v1/accounting/sales-invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_v1_accounting_sales_invoice__id__get.md)

### Update Sales Invoice

 - [PATCH /v1/accounting/sales-invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_sales_invoice_v1_accounting_sales_invoice__id__patch.md)

### Retrieve Sales Invoice Documents

 - [GET /v1/accounting/sales-invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_documents_v1_accounting_sales_invoice__id__documents_get.md)

### Report Payment Status For Sales Invoice

 - [POST /v1/accounting/sales-invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_sales_invoice_v1_accounting_sales_invoice__id__payment_update_status_post.md)

### List Invoices/Credit Notes To Sync

 - [GET /v1/accounting/sync-tasks](https://api-docs.qargo.com/openapi/api-accounting/list_invoices_credit_notes_to_sync_v1_accounting_sync_tasks_get.md)

### Get Details Of Invoice/Credit Note To Sync

 - [GET /v1/accounting/sync-tasks/{id}](https://api-docs.qargo.com/openapi/api-accounting/get_details_of_invoice_credit_note_to_sync_v1_accounting_sync_tasks__id__get.md)

### Report Sync Status For Invoice/Credit Note

 - [POST /v1/accounting/sync-tasks/{id}/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_sync_status_for_invoice_credit_note_v1_accounting_sync_tasks__id__update_status_post.md)

### List Companies (Deprecated) (deprecated)

 - [GET /v1/accounting/company](https://api-docs.qargo.com/openapi/api-accounting/list_companies__deprecated__v1_accounting_company_get.md): (deprecated, use /company instead)

### Create Company (Deprecated) (deprecated)

 - [POST /v1/accounting/company](https://api-docs.qargo.com/openapi/api-accounting/create_company__deprecated__v1_accounting_company_post.md): (deprecated, use /company instead)

### Get Company (Deprecated) (deprecated)

 - [GET /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/api-accounting/get_company__deprecated__v1_accounting_company__id__get.md): (deprecated, use /company/{id} instead)

### Update Company (Deprecated) (deprecated)

 - [PUT /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_company__deprecated__v1_accounting_company__id__put.md): (deprecated, use /company/{id} instead)

### Update Company (Deprecated) (deprecated)

 - [PATCH /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_company__deprecated__v1_accounting_company__id__patch.md): (deprecated, use /company/{id} instead)

### Delete Company (Deprecated) (deprecated)

 - [DELETE /v1/accounting/company/{id}](https://api-docs.qargo.com/openapi/api-accounting/delete_company__deprecated__v1_accounting_company__id__delete.md): (deprecated, use /company/{id} instead)

### Retrieve Purchase Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__get.md): (deprecated, use /purchase-invoice/{id} instead)

### Retrieve Purchase Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__get.md): (deprecated, use /purchase-invoice/{id} instead)

### Update Purchase Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__patch.md): (deprecated, use /purchase-invoice/{id} instead)

### Update Purchase Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/purchase_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__patch.md): (deprecated, use /purchase-invoice/{id} instead)

### Retrieve Purchase Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_documents__deprecated__v1_accounting_purchase_invoice__id__documents_get.md): (deprecated, use /purchase-invoice/{id}/documents instead)

### Retrieve Purchase Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/purchase_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_purchase_invoice_documents__deprecated__v1_accounting_purchase_invoice__id__documents_get.md): (deprecated, use /purchase-invoice/{id}/documents instead)

### Report Payment Status For Purchase Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/purchase_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__payment_update_status_post.md): (deprecated, use /purchase-invoice/{id}/payment/update-status instead)

### Report Payment Status For Purchase Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/purchase_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_purchase_invoice__deprecated__v1_accounting_purchase_invoice__id__payment_update_status_post.md): (deprecated, use /purchase-invoice/{id}/payment/update-status instead)

### Retrieve Sales Credit Note (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__get.md): (deprecated, use /sales-credit-note/{id} instead)

### Retrieve Sales Credit Note (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__get.md): (deprecated, use /sales-credit-note/{id} instead)

### Update Credit Note (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_credit_note__deprecated__v1_accounting_sales_credit_note__id__patch.md): (deprecated, use /sales-credit-note/{id} instead)

### Update Credit Note (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_credit_note/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_credit_note__deprecated__v1_accounting_sales_credit_note__id__patch.md): (deprecated, use /sales-credit-note/{id} instead)

### Retrieve Sales Credit Note Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_documents__deprecated__v1_accounting_sales_credit_note__id__documents_get.md): (deprecated, use /sales-credit-note/{id}/documents instead)

### Retrieve Sales Credit Note Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_credit_note/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_credit_note_documents__deprecated__v1_accounting_sales_credit_note__id__documents_get.md): (deprecated, use /sales-credit-note/{id}/documents instead)

### Report Refund Status For Sales Credit Note (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_credit_note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__refund_update_status_post.md): (deprecated, use /sales-credit-note/{id}/refund/update-status instead)

### Report Refund Status For Sales Credit Note (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_credit_note/{id}/refund/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_refund_status_for_sales_credit_note__deprecated__v1_accounting_sales_credit_note__id__refund_update_status_post.md): (deprecated, use /sales-credit-note/{id}/refund/update-status instead)

### Retrieve Sales Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice__deprecated__v1_accounting_sales_invoice__id__get.md): (deprecated, use /sales-invoice/{id} instead)

### Retrieve Sales Invoice (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice__deprecated__v1_accounting_sales_invoice__id__get.md): (deprecated, use /sales-invoice/{id} instead)

### Update Sales Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_sales_invoice__deprecated__v1_accounting_sales_invoice__id__patch.md): (deprecated, use /sales-invoice/{id} instead)

### Update Sales Invoice (Deprecated) (deprecated)

 - [PATCH /v1/accounting/sales_invoice/{id}](https://api-docs.qargo.com/openapi/api-accounting/update_sales_invoice__deprecated__v1_accounting_sales_invoice__id__patch.md): (deprecated, use /sales-invoice/{id} instead)

### Retrieve Sales Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_documents__deprecated__v1_accounting_sales_invoice__id__documents_get.md): (deprecated, use /sales-invoice/{id}/documents instead)

### Retrieve Sales Invoice Documents (Deprecated) (deprecated)

 - [GET /v1/accounting/sales_invoice/{id}/documents](https://api-docs.qargo.com/openapi/api-accounting/retrieve_sales_invoice_documents__deprecated__v1_accounting_sales_invoice__id__documents_get.md): (deprecated, use /sales-invoice/{id}/documents instead)

### Report Payment Status For Sales Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_sales_invoice__deprecated__v1_accounting_sales_invoice__id__payment_update_status_post.md): (deprecated, use /sales-invoice/{id}/payment/update-status instead)

### Report Payment Status For Sales Invoice (Deprecated) (deprecated)

 - [POST /v1/accounting/sales_invoice/{id}/payment/update-status](https://api-docs.qargo.com/openapi/api-accounting/report_payment_status_for_sales_invoice__deprecated__v1_accounting_sales_invoice__id__payment_update_status_post.md): (deprecated, use /sales-invoice/{id}/payment/update-status instead)

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/api-document/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### External Billing Document (Invoice/Credit-Note) Update

 - [POST /v1/webhook/billing-document-update](https://api-docs.qargo.com/openapi/webhooks-inbound/billing-document-update-webhook.md): Update billing document metadata (invoices, credit notes) from an external accounting system.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

Use this endpoint to push document status changes or related metadata updates back to Qargo.
This is typically triggered when your external accounting system processes billing documents.

### Accounting Visibility Event

 - [POST https://<accounting-visibility-event-receiving-payload>](https://api-docs.qargo.com/openapi/webhooks-outbound/accounting_visibility_eventhttps____accounting_visibility_event_receiving_payload__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

## API / Document

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-accounting/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-customer-portal/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Upload Document Content

 - [POST /v1/documents/document/upload_content](https://api-docs.qargo.com/openapi/use-case-document-import/upload_document_content_v1_documents_document_upload_content_post.md): Upload document content.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-master-data-sync/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-order/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/api-document/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Upload Document Content

 - [POST /v1/documents/document/upload_content](https://api-docs.qargo.com/openapi/api-document/upload_document_content_v1_documents_document_upload_content_post.md): Upload document content.

## Use case / Order

Required api role: `API_ORDER`

All endpoints related to order creation and status retrieval/subscription.


### Getting started
See [this section](#section/Transport-order-creation-and-status) to get started.

### Customer portal
See [Customer portal](#tag/Use-case-Customer-portal) for the customer version.


### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-accounting/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-customer-portal/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Import Order

 - [POST /v1/orders/order/upload](https://api-docs.qargo.com/openapi/use-case-customer-portal/import_order_v1_orders_order_upload_post.md): Create or update orders in Qargo. See the "Transport order creation & status" section for more info.

### Get Order Import Status

 - [GET /v1/orders/order/upload/{upload_id}](https://api-docs.qargo.com/openapi/use-case-customer-portal/get_order_import_status_v1_orders_order_upload__upload_id__get.md): Get the status of an order import

### Get Order Details

 - [GET /v1/orders/order/{order_id}](https://api-docs.qargo.com/openapi/use-case-customer-portal/get_order_details_v1_orders_order__order_id__get.md): Fetch order detail

### List Order Charges

 - [GET /v1/orders/order/{order_id}/charges](https://api-docs.qargo.com/openapi/use-case-customer-portal/list_order_charges_v1_orders_order__order_id__charges_get.md): Charges for a certain order. Note that these charges are not final and may change

### Approve Order Charges

 - [POST /v1/orders/order/{order_id}/charges/approval](https://api-docs.qargo.com/openapi/use-case-customer-portal/approve_order_charges_v1_orders_order__order_id__charges_approval_post.md): Approve or reject certain charges on the order

### List Order Documents

 - [GET /v1/orders/order/{order_id}/documents](https://api-docs.qargo.com/openapi/use-case-customer-portal/list_order_documents_v1_orders_order__order_id__documents_get.md): Fetch documents for an order. This includes consignment documents

### Order Export

 - [GET /v1/orders/order/{order_id}/export](https://api-docs.qargo.com/openapi/use-case-customer-portal/order_export_v1_orders_order__order_id__export_get.md): Provides a minimal set of order data that can be used as a blueprint to create a new order

### Order Status

 - [GET /v1/orders/order/{order_id}/status](https://api-docs.qargo.com/openapi/use-case-customer-portal/order_status_v1_orders_order__order_id__status_get.md): Order status endpoint. Provides information on the status of the order

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-customer-portal/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-master-data-sync/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-order/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Import Order

 - [POST /v1/orders/order/upload](https://api-docs.qargo.com/openapi/use-case-order/import_order_v1_orders_order_upload_post.md): Create or update orders in Qargo. See the "Transport order creation & status" section for more info.

### Get Order Import Status

 - [GET /v1/orders/order/upload/{upload_id}](https://api-docs.qargo.com/openapi/use-case-order/get_order_import_status_v1_orders_order_upload__upload_id__get.md): Get the status of an order import

### Get Order Details

 - [GET /v1/orders/order/{order_id}](https://api-docs.qargo.com/openapi/use-case-order/get_order_details_v1_orders_order__order_id__get.md): Fetch order detail

### List Order Charges

 - [GET /v1/orders/order/{order_id}/charges](https://api-docs.qargo.com/openapi/use-case-order/list_order_charges_v1_orders_order__order_id__charges_get.md): Charges for a certain order. Note that these charges are not final and may change

### Approve Order Charges

 - [POST /v1/orders/order/{order_id}/charges/approval](https://api-docs.qargo.com/openapi/use-case-order/approve_order_charges_v1_orders_order__order_id__charges_approval_post.md): Approve or reject certain charges on the order

### List Order Documents

 - [GET /v1/orders/order/{order_id}/documents](https://api-docs.qargo.com/openapi/use-case-order/list_order_documents_v1_orders_order__order_id__documents_get.md): Fetch documents for an order. This includes consignment documents

### Order Export

 - [GET /v1/orders/order/{order_id}/export](https://api-docs.qargo.com/openapi/use-case-order/order_export_v1_orders_order__order_id__export_get.md): Provides a minimal set of order data that can be used as a blueprint to create a new order

### Order Status

 - [GET /v1/orders/order/{order_id}/status](https://api-docs.qargo.com/openapi/use-case-order/order_status_v1_orders_order__order_id__status_get.md): Order status endpoint. Provides information on the status of the order

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-order/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Partial Order Update

 - [POST /v1/webhook/partial-order-update](https://api-docs.qargo.com/openapi/use-case-order/partial-order-update.md): Webhook for partial order updates. Push to the endpoint to update specific fields of an existing order.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-visibility/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/api-document/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Import Order

 - [POST /v1/orders/order/upload](https://api-docs.qargo.com/openapi/api-order/import_order_v1_orders_order_upload_post.md): Create or update orders in Qargo. See the "Transport order creation & status" section for more info.

### Get Order Import Status

 - [GET /v1/orders/order/upload/{upload_id}](https://api-docs.qargo.com/openapi/api-order/get_order_import_status_v1_orders_order_upload__upload_id__get.md): Get the status of an order import

### Get Order Details

 - [GET /v1/orders/order/{order_id}](https://api-docs.qargo.com/openapi/api-order/get_order_details_v1_orders_order__order_id__get.md): Fetch order detail

### List Order Charges

 - [GET /v1/orders/order/{order_id}/charges](https://api-docs.qargo.com/openapi/api-order/list_order_charges_v1_orders_order__order_id__charges_get.md): Charges for a certain order. Note that these charges are not final and may change

### Approve Order Charges

 - [POST /v1/orders/order/{order_id}/charges/approval](https://api-docs.qargo.com/openapi/api-order/approve_order_charges_v1_orders_order__order_id__charges_approval_post.md): Approve or reject certain charges on the order

### List Order Documents

 - [GET /v1/orders/order/{order_id}/documents](https://api-docs.qargo.com/openapi/api-order/list_order_documents_v1_orders_order__order_id__documents_get.md): Fetch documents for an order. This includes consignment documents

### Order Export

 - [GET /v1/orders/order/{order_id}/export](https://api-docs.qargo.com/openapi/api-order/order_export_v1_orders_order__order_id__export_get.md): Provides a minimal set of order data that can be used as a blueprint to create a new order

### Order Status

 - [GET /v1/orders/order/{order_id}/status](https://api-docs.qargo.com/openapi/api-order/order_status_v1_orders_order__order_id__status_get.md): Order status endpoint. Provides information on the status of the order

### Partial Order Update

 - [POST /v1/webhook/partial-order-update](https://api-docs.qargo.com/openapi/webhooks-inbound/partial-order-update.md): Webhook for partial order updates. Push to the endpoint to update specific fields of an existing order.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

## Use case / Customer portal

Required api role: `CUSTOMER`

This is the api equivalent of our customer portal functionality.
Customers can use this api to create/update/cancel orders, view charges and receive status updates.


### Getting started
See [this section](#section/Transport-order-creation-and-status) to get started.


### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-accounting/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-customer-portal/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Import Order

 - [POST /v1/orders/order/upload](https://api-docs.qargo.com/openapi/use-case-customer-portal/import_order_v1_orders_order_upload_post.md): Create or update orders in Qargo. See the "Transport order creation & status" section for more info.

### Get Order Import Status

 - [GET /v1/orders/order/upload/{upload_id}](https://api-docs.qargo.com/openapi/use-case-customer-portal/get_order_import_status_v1_orders_order_upload__upload_id__get.md): Get the status of an order import

### Get Order Details

 - [GET /v1/orders/order/{order_id}](https://api-docs.qargo.com/openapi/use-case-customer-portal/get_order_details_v1_orders_order__order_id__get.md): Fetch order detail

### List Order Charges

 - [GET /v1/orders/order/{order_id}/charges](https://api-docs.qargo.com/openapi/use-case-customer-portal/list_order_charges_v1_orders_order__order_id__charges_get.md): Charges for a certain order. Note that these charges are not final and may change

### Approve Order Charges

 - [POST /v1/orders/order/{order_id}/charges/approval](https://api-docs.qargo.com/openapi/use-case-customer-portal/approve_order_charges_v1_orders_order__order_id__charges_approval_post.md): Approve or reject certain charges on the order

### List Order Documents

 - [GET /v1/orders/order/{order_id}/documents](https://api-docs.qargo.com/openapi/use-case-customer-portal/list_order_documents_v1_orders_order__order_id__documents_get.md): Fetch documents for an order. This includes consignment documents

### Order Export

 - [GET /v1/orders/order/{order_id}/export](https://api-docs.qargo.com/openapi/use-case-customer-portal/order_export_v1_orders_order__order_id__export_get.md): Provides a minimal set of order data that can be used as a blueprint to create a new order

### Order Status

 - [GET /v1/orders/order/{order_id}/status](https://api-docs.qargo.com/openapi/use-case-customer-portal/order_status_v1_orders_order__order_id__status_get.md): Order status endpoint. Provides information on the status of the order

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-customer-portal/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-master-data-sync/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/use-case-order/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Import Order

 - [POST /v1/orders/order/upload](https://api-docs.qargo.com/openapi/use-case-order/import_order_v1_orders_order_upload_post.md): Create or update orders in Qargo. See the "Transport order creation & status" section for more info.

### Get Order Import Status

 - [GET /v1/orders/order/upload/{upload_id}](https://api-docs.qargo.com/openapi/use-case-order/get_order_import_status_v1_orders_order_upload__upload_id__get.md): Get the status of an order import

### Get Order Details

 - [GET /v1/orders/order/{order_id}](https://api-docs.qargo.com/openapi/use-case-order/get_order_details_v1_orders_order__order_id__get.md): Fetch order detail

### List Order Charges

 - [GET /v1/orders/order/{order_id}/charges](https://api-docs.qargo.com/openapi/use-case-order/list_order_charges_v1_orders_order__order_id__charges_get.md): Charges for a certain order. Note that these charges are not final and may change

### Approve Order Charges

 - [POST /v1/orders/order/{order_id}/charges/approval](https://api-docs.qargo.com/openapi/use-case-order/approve_order_charges_v1_orders_order__order_id__charges_approval_post.md): Approve or reject certain charges on the order

### List Order Documents

 - [GET /v1/orders/order/{order_id}/documents](https://api-docs.qargo.com/openapi/use-case-order/list_order_documents_v1_orders_order__order_id__documents_get.md): Fetch documents for an order. This includes consignment documents

### Order Export

 - [GET /v1/orders/order/{order_id}/export](https://api-docs.qargo.com/openapi/use-case-order/order_export_v1_orders_order__order_id__export_get.md): Provides a minimal set of order data that can be used as a blueprint to create a new order

### Order Status

 - [GET /v1/orders/order/{order_id}/status](https://api-docs.qargo.com/openapi/use-case-order/order_status_v1_orders_order__order_id__status_get.md): Order status endpoint. Provides information on the status of the order

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-order/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-visibility/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Download Document

 - [GET /v1/documents/document/{id}/download](https://api-docs.qargo.com/openapi/api-document/download_document_v1_documents_document__id__download_get.md): Download a document by its ID. You can choose to download the document directly or stream it.

### Import Order

 - [POST /v1/orders/order/upload](https://api-docs.qargo.com/openapi/api-order/import_order_v1_orders_order_upload_post.md): Create or update orders in Qargo. See the "Transport order creation & status" section for more info.

### Get Order Import Status

 - [GET /v1/orders/order/upload/{upload_id}](https://api-docs.qargo.com/openapi/api-order/get_order_import_status_v1_orders_order_upload__upload_id__get.md): Get the status of an order import

### Get Order Details

 - [GET /v1/orders/order/{order_id}](https://api-docs.qargo.com/openapi/api-order/get_order_details_v1_orders_order__order_id__get.md): Fetch order detail

### List Order Charges

 - [GET /v1/orders/order/{order_id}/charges](https://api-docs.qargo.com/openapi/api-order/list_order_charges_v1_orders_order__order_id__charges_get.md): Charges for a certain order. Note that these charges are not final and may change

### Approve Order Charges

 - [POST /v1/orders/order/{order_id}/charges/approval](https://api-docs.qargo.com/openapi/api-order/approve_order_charges_v1_orders_order__order_id__charges_approval_post.md): Approve or reject certain charges on the order

### List Order Documents

 - [GET /v1/orders/order/{order_id}/documents](https://api-docs.qargo.com/openapi/api-order/list_order_documents_v1_orders_order__order_id__documents_get.md): Fetch documents for an order. This includes consignment documents

### Order Export

 - [GET /v1/orders/order/{order_id}/export](https://api-docs.qargo.com/openapi/api-order/order_export_v1_orders_order__order_id__export_get.md): Provides a minimal set of order data that can be used as a blueprint to create a new order

### Order Status

 - [GET /v1/orders/order/{order_id}/status](https://api-docs.qargo.com/openapi/api-order/order_status_v1_orders_order__order_id__status_get.md): Order status endpoint. Provides information on the status of the order

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

## Webhooks / Inbound

### External Billing Document (Invoice/Credit-Note) Update

 - [POST /v1/webhook/billing-document-update](https://api-docs.qargo.com/openapi/use-case-accounting/billing-document-update-webhook.md): Update billing document metadata (invoices, credit notes) from an external accounting system.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

Use this endpoint to push document status changes or related metadata updates back to Qargo.
This is typically triggered when your external accounting system processes billing documents.

### Generic Document Import

 - [POST /v1/webhook/document-import](https://api-docs.qargo.com/openapi/use-case-document-import/document-import-webhook.md): Webhook for importing documents and attaching them to existing orders in Qargo.

## How it works

1. An external system sends a file to this endpoint with metadata as query parameters.
2. The system matches the document to an order in Qargo using the provided query parameters.
3. The document is created and attached to the matched order.

## Query parameters

The filename parameter is always required. Additional query parameters are configurable
per integration during setup and are used to pass metadata about the file and to match
the document to an order.

Query parameters can carry two types of information:

### File metadata

Information about the document itself, for example:
- filename (required) — Name of the uploaded file including extension
- document_type — The type of document (e.g. PROOF_OF_DELIVERY, WAYBILL, INVOICE, CMR)
- document_name — Display name for the document in Qargo

### Matching to Qargo orders

Information used to resolve which order the document should be attached to.
The following order fields can be matched against:

- customer_reference_number — The customer reference number on the order
- name — The order name (e.g. OR-12345)
- id — The order UUID

The match must resolve to exactly one order. If no order or multiple orders match,
the import will be discarded.

The actual set of query parameters and how they map to the above is configured per integration.

## Content encoding

| Content format | Content-Type header | Behavior |
|---|---|---|
| Binary (e.g. PDF, image) | application/pdf, image/png, etc. | Passed through as-is |
| Text | text/plain, text/xml, etc. | Encoded as UTF-8 bytes |
| Base64-encoded string | Non-text or no header | Base64 decode attempted; raw string used on failure |

Please provide the Content-Type header matching the file format.

## Error handling

| Scenario | Behavior |
|----------|----------|
| No order matches the provided criteria | Import is discarded |
| Multiple orders match the criteria | Import is discarded  |
| Document metadata not provided | Import is discarded |

### External Document Upload From A Fleet Application

 - [POST /v1/webhook/fleet-document-upload](https://api-docs.qargo.com/openapi/use-case-document-import/fleet-document-upload-webhook.md): Upload a document to a specific stop or stop group on a fleet-dispatched trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | No* | The Qargo UUID of the stop to attach the document to |
| stop_group_id | No* | The Qargo UUID of the stop group to attach the document to |

*Provide either stop_id or stop_group_id to identify where to attach the document.

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/fleet-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Document Update With Payload

 - [POST /v1/webhook/subco-document-upload](https://api-docs.qargo.com/openapi/use-case-document-import/subcontractor-document-upload-webhook.md): Upload a document to a specific stop on a subcontracted trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### Send E-Invoices

 - [POST /v1/webhook](https://api-docs.qargo.com/openapi/use-case-e-invoicing/e-invoicing-webhook.md): Webhook to receive e-invoices in structured format or as file uploads.

## Supported Formats
This endpoint accepts e-invoices in multiple formats:

- JSON payloads: Structured data using application/json content type.
- XML payloads: Structured data using application/xml content type. Must be a valid UBL document.
- File uploads: JSON + binary files (PDF, XML, etc.) using multipart/form-data.

## Multipart Upload Support
When using multipart form data, the endpoint expects:
- First part: JSON document (PurchaseEInvoiceInput or PurchaseECreditNoteInput). XML is not supported at the moment.
- Subsequent parts: Supporting documents (invoice PDF, CMR PDF, etc.).

## Examples

JSON payload example (application/json).

json
{
  "name": "INV-2023-001",
  "date": "2023-01-15",
  "due_date": "2023-02-15",
  "invoice_type": "PURCHASE",
  "currency": "EUR",
  "total_excl_tax": 999.99,
  "total_incl_tax": 1209.99,
  "total_tax": 210.00,
  "custom_fields": {},
  "supplier": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Supplier Company Ltd",
    "vat_number": "BE1234.123.123",
    "billing_location": {
      "address": "Gaston Crommenlaan 4",
      "city": "Gent",
      "postal_code": "9050",
      "country": "BE"
    }
  },
  "customer_reference_numbers": ["12345"],
  "line_items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Transport Service",
      "description": "International freight transport",
      "amount": 999.99,
      "currency": "EUR",
      "tax_rate": {
        "rate": 21.0,
        "name": "VAT"
      },
      "account": {
        "code": "6000",
        "name": "Transport Costs"
      },
      "references": {
        "order_name": "OR-1234"
      }
    }
  ],
  "attachments": [
    {
      "document": {
        "base64": "JVBERi0xLjQKJcfs... (truncated for brevity) ...",
        "content_type": "application/pdf",
        "document_type": "INVOICE",
        "filename": "invoice_123.pdf"
      }
    }
  ]
}


XML payload example (application/xml).

xml

    urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0
    urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
    25900027
    2025-10-28
    2025-10-28
    380
    EUR
    25900027
    
        600947
        
            JVBERi0xLjQKJcfs... (truncated for brevity) ...
        
    
    
        
        0564730040
        
            qargo-peppol-dev
        
        
            Gaston Crommenlaan 4
            Gent
            9050
            Oost-Vlaanderen
            
            BE
            
        
        
            BE0772640434
            
            VAT
            
        
        
            qargo-peppol-dev
            0564730040
        
        
            +324854244512
            simon@qargo.com
        
        
    
    
        
        0772640434
        
            Qargo
        
        
            Gaston Crommenlaan 4
            Gent
            9050
            
            BE
            
        
        
            Qargo
            0772640434
        
        
    
    
        162.71
        
        774.83
        162.71
        
            S
            21.00
            
            VAT
            
        
        
    
    
        774.83
        774.83
        937.54
        937.54
    
    
        1
        1.0
        65.00
        
        Administratiekost
        
            S
            21.00
            
            VAT
            
        
        
        
        65.0
        
    
    
        2
        1.0
        709.83
        
        Transport charge
        
            S
            21.00
            
            VAT
            
        
        
        
        709.83
        
    



Multipart Form Data example.


POST /v1/webhook
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryABC123XYZ

----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="document"; filename="invoice_data.json"
Content-Type: application/json

{
  "name": "INV-2023-001",
  "date": "2023-01-15",
  "due_date": "2023-02-15",
  "invoice_type": "PURCHASE",
  "currency": "EUR",
  "total_excl_tax": 999.99,
  "total_incl_tax": 1209.99,
  "total_tax": 210.00,
  "custom_fields": {},
  "supplier": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Supplier Company Ltd",
    "vat_number": "BE1234.123.123",
    "billing_location": {
      "address": "Gaston Crommenlaan 4",
      "city": "Gent",
      "postal_code": "9050",
      "country": "BE"
    }
  },
  "customer_reference_numbers": ["12345"],
  "line_items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Transport Service",
      "description": "International freight transport",
      "amount": 999.99,
      "currency": "EUR",
      "tax_rate": {
        "rate": 21.0,
        "name": "VAT"
      },
      "account": {
        "code": "6000",
        "name": "Transport Costs"
      },
      "references": {
        "order_name": "OR-1234"
      }
    }
  ]
}
----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="invoice"; filename="invoice_123.pdf"
Content-Type: application/pdf

[binary PDF content]
----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="cmr"; filename="cmr_document.pdf"
Content-Type: application/pdf

[binary PDF content]
----WebKitFormBoundaryABC123XYZ--


## Processing Notes on Multipart Uploads
- First part must be the JSON document containing invoice/credit note data.
- Supporting documents follow as additional parts.
- Content-Type headers determine document processing.

### External Document Upload From A Fleet Application

 - [POST /v1/webhook/fleet-document-upload](https://api-docs.qargo.com/openapi/use-case-fleet-dispatch/fleet-document-upload-webhook.md): Upload a document to a specific stop or stop group on a fleet-dispatched trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | No* | The Qargo UUID of the stop to attach the document to |
| stop_group_id | No* | The Qargo UUID of the stop group to attach the document to |

*Provide either stop_id or stop_group_id to identify where to attach the document.

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/fleet-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Status Update From A Fleet Application

 - [POST /v1/webhook/fleet-status-update](https://api-docs.qargo.com/openapi/use-case-fleet-dispatch/fleet-status-update-webhook.md): Webhook for updating the status, ETA, and data of stops from an external fleet application.

Note that this webhook uses Basic Auth instead of the OAuth credentials used for the api.
Please contact integrations@qargo.com to request credentials.

---

## Identifying a stop

Each update targets either a single stop or a stop group. Provide one per update entry.

### By stop ID (preferred)

If you know the Qargo stop UUID, pass it directly in stop.id:

json
{
  "updates": [
    {
      "stop": { "id": "a1b2c3d4-0000-0000-0000-000000000000", "status": "AT_STOP" },
      "event_time": "2025-06-15T10:30:00Z"
    }
  ]
}


### By matching criteria

When the stop ID is not known, use stop.match to find the stop by its related entities.
The matcher uses all provided criteria combined (AND logic) and expects exactly one stop
to match. If zero or multiple stops match, the update is discarded.

Available matching fields:

| Object         | Field                        | Description                                          |
|----------------|------------------------------|------------------------------------------------------|
| trip         | name.matches_any           | Trip name(s)                                         |
| order        | name.matches_any           | Order name(s)                                        |
| order        | customer_reference_number.matches_any | Customer reference number(s)              |
| order        | id.matches_any             | Order UUID(s)                                        |
| consignment  | reference_number.matches_any | Consignment reference number(s)                    |
| consignment  | order_sequence_number      | Consignment sequence number within the order (integer) |
| stop         | reference_number.matches_any | Stop reference number(s)                           |
| stop         | stop_type                  | PICKUP or DELIVERY                               |

Each matches_any field accepts a list of values — the stop matches if its value equals any of them.
When multiple fields are provided, they are all required to match (AND).

Example — match by order reference + stop type:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "order": { "customer_reference_number": { "matches_any": ["REF-12345"] } },
              "stop": { "stop_type": "DELIVERY" }
            }
          ]
        },
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T14:00:00Z"
    }
  ]
}


Example — match by trip name + consignment reference:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "trip": { "name": { "matches_any": ["T-20250615-001"] } },
              "consignment": { "reference_number": { "matches_any": ["CONS-98765"] } }
            }
          ]
        },
        "status": "AT_STOP",
        "eta_end": "2025-06-15T16:00:00Z"
      },
      "event_time": "2025-06-15T14:30:00Z"
    }
  ]
}


## Stop group updates

A stop group represents multiple stops grouped by activity and location. When updating via
stop_group, the status applies to all stops in that group. The stop group id is always
required — matching by criteria is not supported for stop groups.

json
{
  "updates": [
    {
      "stop_group": {
        "id": "b2c3d4e5-0000-0000-0000-000000000000",
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T16:00:00Z"
    }
  ]
}


## Statuses

- AT_STOP — the vehicle has arrived at the stop location.
- COMPLETED — the stop activity is finished.
- Omit status to update only the ETA or data fields without changing the stop status.

### Intermodal Booking Status Update Webhook

 - [POST /v1/webhook/intermodal-status](https://api-docs.qargo.com/openapi/use-case-intermodal-partner/intermodal-booking-status-webhook.md): Inbound webhook to receive intermodal booking status updates from the external intermodal booking system.

### Location Booking Update Webhook

 - [POST /v1/webhook/location-booking-update](https://api-docs.qargo.com/openapi/use-case-location-booking/location-booking-update-webhook.md): Inbound webhook to receive location booking updates from external systems.

### Partial Order Update

 - [POST /v1/webhook/partial-order-update](https://api-docs.qargo.com/openapi/use-case-order/partial-order-update.md): Webhook for partial order updates. Push to the endpoint to update specific fields of an existing order.

### External Document Update With Payload

 - [POST /v1/webhook/subco-document-upload](https://api-docs.qargo.com/openapi/use-case-subcontractor-dispatch/subcontractor-document-upload-webhook.md): Upload a document to a specific stop on a subcontracted trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Status Update

 - [POST /v1/webhook/subco-status-update](https://api-docs.qargo.com/openapi/use-case-subcontractor-dispatch/subcontractor-status-update-webhook.md): Webhook for updating the status, ETA, and data of stops from an external subcontractor system.

Note that this webhook uses Basic Auth instead of the OAuth credentials used for the api.
Please contact integrations@qargo.com to request credentials.

---

## Identifying a stop

Each update targets a single stop. You can identify it by its Qargo UUID or by matching criteria.

### By stop ID (preferred)

If you know the Qargo stop UUID, pass it directly in stop.id:

json
{
  "updates": [
    {
      "stop": { "id": "a1b2c3d4-0000-0000-0000-000000000000", "status": "AT_STOP" },
      "event_time": "2025-06-15T10:30:00Z"
    }
  ]
}


### By matching criteria

When the stop ID is not known, use stop.match to find the stop by its related entities.
The matcher uses all provided criteria combined (AND logic) and expects exactly one stop
to match. If zero or multiple stops match, the update is discarded.

Available matching fields:

| Object         | Field                        | Description                                          |
|----------------|------------------------------|------------------------------------------------------|
| trip         | name.matches_any           | Trip name(s)                                         |
| order        | name.matches_any           | Order name(s)                                        |
| order        | customer_reference_number.matches_any | Customer reference number(s)              |
| order        | id.matches_any             | Order UUID(s)                                        |
| consignment  | reference_number.matches_any | Consignment reference number(s)                    |
| consignment  | order_sequence_number      | Consignment sequence number within the order (integer) |
| stop         | reference_number.matches_any | Stop reference number(s)                           |
| stop         | stop_type                  | PICKUP or DELIVERY                               |

Each matches_any field accepts a list of values — the stop matches if its value equals any of them.
When multiple fields are provided, they are all required to match (AND).

Example — match by order reference + stop type:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "order": { "customer_reference_number": { "matches_any": ["REF-12345"] } },
              "stop": { "stop_type": "DELIVERY" }
            }
          ]
        },
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T14:00:00Z"
    }
  ]
}


Example — match by trip name + consignment reference:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "trip": { "name": { "matches_any": ["T-20250615-001"] } },
              "consignment": { "reference_number": { "matches_any": ["CONS-98765"] } }
            }
          ]
        },
        "status": "AT_STOP",
        "eta_end": "2025-06-15T16:00:00Z"
      },
      "event_time": "2025-06-15T14:30:00Z"
    }
  ]
}


## Statuses

- AT_STOP — the vehicle has arrived at the stop location.
- COMPLETED — the stop activity is finished.
- Omit status to update only the ETA or data fields without changing the stop status.

### Tracking Update

 - [POST /v1/webhook/tracking-update](https://api-docs.qargo.com/openapi/use-case-tracking/tracking-update.md): Webhook for tracking updates.

Push to the endpoint to update tracking information for a resource.

### External Billing Document (Invoice/Credit-Note) Update

 - [POST /v1/webhook/billing-document-update](https://api-docs.qargo.com/openapi/webhooks-inbound/billing-document-update-webhook.md): Update billing document metadata (invoices, credit notes) from an external accounting system.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

Use this endpoint to push document status changes or related metadata updates back to Qargo.
This is typically triggered when your external accounting system processes billing documents.

### Generic Document Import

 - [POST /v1/webhook/document-import](https://api-docs.qargo.com/openapi/webhooks-inbound/document-import-webhook.md): Webhook for importing documents and attaching them to existing orders in Qargo.

## How it works

1. An external system sends a file to this endpoint with metadata as query parameters.
2. The system matches the document to an order in Qargo using the provided query parameters.
3. The document is created and attached to the matched order.

## Query parameters

The filename parameter is always required. Additional query parameters are configurable
per integration during setup and are used to pass metadata about the file and to match
the document to an order.

Query parameters can carry two types of information:

### File metadata

Information about the document itself, for example:
- filename (required) — Name of the uploaded file including extension
- document_type — The type of document (e.g. PROOF_OF_DELIVERY, WAYBILL, INVOICE, CMR)
- document_name — Display name for the document in Qargo

### Matching to Qargo orders

Information used to resolve which order the document should be attached to.
The following order fields can be matched against:

- customer_reference_number — The customer reference number on the order
- name — The order name (e.g. OR-12345)
- id — The order UUID

The match must resolve to exactly one order. If no order or multiple orders match,
the import will be discarded.

The actual set of query parameters and how they map to the above is configured per integration.

## Content encoding

| Content format | Content-Type header | Behavior |
|---|---|---|
| Binary (e.g. PDF, image) | application/pdf, image/png, etc. | Passed through as-is |
| Text | text/plain, text/xml, etc. | Encoded as UTF-8 bytes |
| Base64-encoded string | Non-text or no header | Base64 decode attempted; raw string used on failure |

Please provide the Content-Type header matching the file format.

## Error handling

| Scenario | Behavior |
|----------|----------|
| No order matches the provided criteria | Import is discarded |
| Multiple orders match the criteria | Import is discarded  |
| Document metadata not provided | Import is discarded |

### External Document Upload From A Fleet Application

 - [POST /v1/webhook/fleet-document-upload](https://api-docs.qargo.com/openapi/webhooks-inbound/fleet-document-upload-webhook.md): Upload a document to a specific stop or stop group on a fleet-dispatched trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | No* | The Qargo UUID of the stop to attach the document to |
| stop_group_id | No* | The Qargo UUID of the stop group to attach the document to |

*Provide either stop_id or stop_group_id to identify where to attach the document.

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/fleet-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Document Update With Payload

 - [POST /v1/webhook/subco-document-upload](https://api-docs.qargo.com/openapi/webhooks-inbound/subcontractor-document-upload-webhook.md): Upload a document to a specific stop on a subcontracted trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### Send E-Invoices

 - [POST /v1/webhook](https://api-docs.qargo.com/openapi/webhooks-inbound/e-invoicing-webhook.md): Webhook to receive e-invoices in structured format or as file uploads.

## Supported Formats
This endpoint accepts e-invoices in multiple formats:

- JSON payloads: Structured data using application/json content type.
- XML payloads: Structured data using application/xml content type. Must be a valid UBL document.
- File uploads: JSON + binary files (PDF, XML, etc.) using multipart/form-data.

## Multipart Upload Support
When using multipart form data, the endpoint expects:
- First part: JSON document (PurchaseEInvoiceInput or PurchaseECreditNoteInput). XML is not supported at the moment.
- Subsequent parts: Supporting documents (invoice PDF, CMR PDF, etc.).

## Examples

JSON payload example (application/json).

json
{
  "name": "INV-2023-001",
  "date": "2023-01-15",
  "due_date": "2023-02-15",
  "invoice_type": "PURCHASE",
  "currency": "EUR",
  "total_excl_tax": 999.99,
  "total_incl_tax": 1209.99,
  "total_tax": 210.00,
  "custom_fields": {},
  "supplier": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Supplier Company Ltd",
    "vat_number": "BE1234.123.123",
    "billing_location": {
      "address": "Gaston Crommenlaan 4",
      "city": "Gent",
      "postal_code": "9050",
      "country": "BE"
    }
  },
  "customer_reference_numbers": ["12345"],
  "line_items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Transport Service",
      "description": "International freight transport",
      "amount": 999.99,
      "currency": "EUR",
      "tax_rate": {
        "rate": 21.0,
        "name": "VAT"
      },
      "account": {
        "code": "6000",
        "name": "Transport Costs"
      },
      "references": {
        "order_name": "OR-1234"
      }
    }
  ],
  "attachments": [
    {
      "document": {
        "base64": "JVBERi0xLjQKJcfs... (truncated for brevity) ...",
        "content_type": "application/pdf",
        "document_type": "INVOICE",
        "filename": "invoice_123.pdf"
      }
    }
  ]
}


XML payload example (application/xml).

xml

    urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0
    urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
    25900027
    2025-10-28
    2025-10-28
    380
    EUR
    25900027
    
        600947
        
            JVBERi0xLjQKJcfs... (truncated for brevity) ...
        
    
    
        
        0564730040
        
            qargo-peppol-dev
        
        
            Gaston Crommenlaan 4
            Gent
            9050
            Oost-Vlaanderen
            
            BE
            
        
        
            BE0772640434
            
            VAT
            
        
        
            qargo-peppol-dev
            0564730040
        
        
            +324854244512
            simon@qargo.com
        
        
    
    
        
        0772640434
        
            Qargo
        
        
            Gaston Crommenlaan 4
            Gent
            9050
            
            BE
            
        
        
            Qargo
            0772640434
        
        
    
    
        162.71
        
        774.83
        162.71
        
            S
            21.00
            
            VAT
            
        
        
    
    
        774.83
        774.83
        937.54
        937.54
    
    
        1
        1.0
        65.00
        
        Administratiekost
        
            S
            21.00
            
            VAT
            
        
        
        
        65.0
        
    
    
        2
        1.0
        709.83
        
        Transport charge
        
            S
            21.00
            
            VAT
            
        
        
        
        709.83
        
    



Multipart Form Data example.


POST /v1/webhook
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryABC123XYZ

----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="document"; filename="invoice_data.json"
Content-Type: application/json

{
  "name": "INV-2023-001",
  "date": "2023-01-15",
  "due_date": "2023-02-15",
  "invoice_type": "PURCHASE",
  "currency": "EUR",
  "total_excl_tax": 999.99,
  "total_incl_tax": 1209.99,
  "total_tax": 210.00,
  "custom_fields": {},
  "supplier": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Supplier Company Ltd",
    "vat_number": "BE1234.123.123",
    "billing_location": {
      "address": "Gaston Crommenlaan 4",
      "city": "Gent",
      "postal_code": "9050",
      "country": "BE"
    }
  },
  "customer_reference_numbers": ["12345"],
  "line_items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Transport Service",
      "description": "International freight transport",
      "amount": 999.99,
      "currency": "EUR",
      "tax_rate": {
        "rate": 21.0,
        "name": "VAT"
      },
      "account": {
        "code": "6000",
        "name": "Transport Costs"
      },
      "references": {
        "order_name": "OR-1234"
      }
    }
  ]
}
----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="invoice"; filename="invoice_123.pdf"
Content-Type: application/pdf

[binary PDF content]
----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="cmr"; filename="cmr_document.pdf"
Content-Type: application/pdf

[binary PDF content]
----WebKitFormBoundaryABC123XYZ--


## Processing Notes on Multipart Uploads
- First part must be the JSON document containing invoice/credit note data.
- Supporting documents follow as additional parts.
- Content-Type headers determine document processing.

### External Status Update From A Fleet Application

 - [POST /v1/webhook/fleet-status-update](https://api-docs.qargo.com/openapi/webhooks-inbound/fleet-status-update-webhook.md): Webhook for updating the status, ETA, and data of stops from an external fleet application.

Note that this webhook uses Basic Auth instead of the OAuth credentials used for the api.
Please contact integrations@qargo.com to request credentials.

---

## Identifying a stop

Each update targets either a single stop or a stop group. Provide one per update entry.

### By stop ID (preferred)

If you know the Qargo stop UUID, pass it directly in stop.id:

json
{
  "updates": [
    {
      "stop": { "id": "a1b2c3d4-0000-0000-0000-000000000000", "status": "AT_STOP" },
      "event_time": "2025-06-15T10:30:00Z"
    }
  ]
}


### By matching criteria

When the stop ID is not known, use stop.match to find the stop by its related entities.
The matcher uses all provided criteria combined (AND logic) and expects exactly one stop
to match. If zero or multiple stops match, the update is discarded.

Available matching fields:

| Object         | Field                        | Description                                          |
|----------------|------------------------------|------------------------------------------------------|
| trip         | name.matches_any           | Trip name(s)                                         |
| order        | name.matches_any           | Order name(s)                                        |
| order        | customer_reference_number.matches_any | Customer reference number(s)              |
| order        | id.matches_any             | Order UUID(s)                                        |
| consignment  | reference_number.matches_any | Consignment reference number(s)                    |
| consignment  | order_sequence_number      | Consignment sequence number within the order (integer) |
| stop         | reference_number.matches_any | Stop reference number(s)                           |
| stop         | stop_type                  | PICKUP or DELIVERY                               |

Each matches_any field accepts a list of values — the stop matches if its value equals any of them.
When multiple fields are provided, they are all required to match (AND).

Example — match by order reference + stop type:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "order": { "customer_reference_number": { "matches_any": ["REF-12345"] } },
              "stop": { "stop_type": "DELIVERY" }
            }
          ]
        },
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T14:00:00Z"
    }
  ]
}


Example — match by trip name + consignment reference:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "trip": { "name": { "matches_any": ["T-20250615-001"] } },
              "consignment": { "reference_number": { "matches_any": ["CONS-98765"] } }
            }
          ]
        },
        "status": "AT_STOP",
        "eta_end": "2025-06-15T16:00:00Z"
      },
      "event_time": "2025-06-15T14:30:00Z"
    }
  ]
}


## Stop group updates

A stop group represents multiple stops grouped by activity and location. When updating via
stop_group, the status applies to all stops in that group. The stop group id is always
required — matching by criteria is not supported for stop groups.

json
{
  "updates": [
    {
      "stop_group": {
        "id": "b2c3d4e5-0000-0000-0000-000000000000",
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T16:00:00Z"
    }
  ]
}


## Statuses

- AT_STOP — the vehicle has arrived at the stop location.
- COMPLETED — the stop activity is finished.
- Omit status to update only the ETA or data fields without changing the stop status.

### Intermodal Booking Status Update Webhook

 - [POST /v1/webhook/intermodal-status](https://api-docs.qargo.com/openapi/webhooks-inbound/intermodal-booking-status-webhook.md): Inbound webhook to receive intermodal booking status updates from the external intermodal booking system.

### Location Booking Update Webhook

 - [POST /v1/webhook/location-booking-update](https://api-docs.qargo.com/openapi/webhooks-inbound/location-booking-update-webhook.md): Inbound webhook to receive location booking updates from external systems.

### Partial Order Update

 - [POST /v1/webhook/partial-order-update](https://api-docs.qargo.com/openapi/webhooks-inbound/partial-order-update.md): Webhook for partial order updates. Push to the endpoint to update specific fields of an existing order.

### External Status Update

 - [POST /v1/webhook/subco-status-update](https://api-docs.qargo.com/openapi/webhooks-inbound/subcontractor-status-update-webhook.md): Webhook for updating the status, ETA, and data of stops from an external subcontractor system.

Note that this webhook uses Basic Auth instead of the OAuth credentials used for the api.
Please contact integrations@qargo.com to request credentials.

---

## Identifying a stop

Each update targets a single stop. You can identify it by its Qargo UUID or by matching criteria.

### By stop ID (preferred)

If you know the Qargo stop UUID, pass it directly in stop.id:

json
{
  "updates": [
    {
      "stop": { "id": "a1b2c3d4-0000-0000-0000-000000000000", "status": "AT_STOP" },
      "event_time": "2025-06-15T10:30:00Z"
    }
  ]
}


### By matching criteria

When the stop ID is not known, use stop.match to find the stop by its related entities.
The matcher uses all provided criteria combined (AND logic) and expects exactly one stop
to match. If zero or multiple stops match, the update is discarded.

Available matching fields:

| Object         | Field                        | Description                                          |
|----------------|------------------------------|------------------------------------------------------|
| trip         | name.matches_any           | Trip name(s)                                         |
| order        | name.matches_any           | Order name(s)                                        |
| order        | customer_reference_number.matches_any | Customer reference number(s)              |
| order        | id.matches_any             | Order UUID(s)                                        |
| consignment  | reference_number.matches_any | Consignment reference number(s)                    |
| consignment  | order_sequence_number      | Consignment sequence number within the order (integer) |
| stop         | reference_number.matches_any | Stop reference number(s)                           |
| stop         | stop_type                  | PICKUP or DELIVERY                               |

Each matches_any field accepts a list of values — the stop matches if its value equals any of them.
When multiple fields are provided, they are all required to match (AND).

Example — match by order reference + stop type:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "order": { "customer_reference_number": { "matches_any": ["REF-12345"] } },
              "stop": { "stop_type": "DELIVERY" }
            }
          ]
        },
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T14:00:00Z"
    }
  ]
}


Example — match by trip name + consignment reference:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "trip": { "name": { "matches_any": ["T-20250615-001"] } },
              "consignment": { "reference_number": { "matches_any": ["CONS-98765"] } }
            }
          ]
        },
        "status": "AT_STOP",
        "eta_end": "2025-06-15T16:00:00Z"
      },
      "event_time": "2025-06-15T14:30:00Z"
    }
  ]
}


## Statuses

- AT_STOP — the vehicle has arrived at the stop location.
- COMPLETED — the stop activity is finished.
- Omit status to update only the ETA or data fields without changing the stop status.

### Tracking Update

 - [POST /v1/webhook/tracking-update](https://api-docs.qargo.com/openapi/webhooks-inbound/tracking-update.md): Webhook for tracking updates.

Push to the endpoint to update tracking information for a resource.

## Use case / Visibility

### Accounting Visibility Event

 - [POST https://<accounting-visibility-event-receiving-payload>](https://api-docs.qargo.com/openapi/use-case-accounting/accounting_visibility_eventhttps____accounting_visibility_event_receiving_payload__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-customer-portal/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-order/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Accounting Visibility Event

 - [POST https://<accounting-visibility-event-receiving-payload>](https://api-docs.qargo.com/openapi/use-case-visibility/accounting_visibility_eventhttps____accounting_visibility_event_receiving_payload__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-visibility/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Accounting Visibility Event

 - [POST https://<accounting-visibility-event-receiving-payload>](https://api-docs.qargo.com/openapi/webhooks-outbound/accounting_visibility_eventhttps____accounting_visibility_event_receiving_payload__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

## Webhooks / Outbound

### Accounting Visibility Event

 - [POST https://<accounting-visibility-event-receiving-payload>](https://api-docs.qargo.com/openapi/use-case-accounting/accounting_visibility_eventhttps____accounting_visibility_event_receiving_payload__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-customer-portal/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Fleet Dispatch Payload

 - [POST https://<external-fleet-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-fleet-dispatch/fleet-dispatch-payload.md): Payload for sending fleet app dispatches.
In this case, we send the payload to an external endpoint for processing.

By default, we send our standard FleetDispatch schema,
but the body can also be a custom mapped format.

### Intermodal Booking Payload

 - [POST https://<intermodal-booking-receiving-payload>](https://api-docs.qargo.com/openapi/use-case-intermodal-partner/intermodal_booking_payloadhttps____intermodal_booking_receiving_payload__post.md): Outbound webhook to send intermodal bookings to the external intermodal booking system.

### Location Booking Dispatch Payload

 - [POST https://<location-booking-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-location-booking/location-dispatch-payload.md): Payload for sending location booking dispatches.

By default, we send our standard LocationDispatchOutput schema,
but the body can also be a custom mapped format.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-order/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Subcontractor Dispatch Payload

 - [POST https://<external_subco_receiving_endpoint>](https://api-docs.qargo.com/openapi/use-case-subcontractor-dispatch/subcontractor-dispatch-payload.md): Payload for sending a trip dispatch.
In this case, we send the payload to an external endpoint for processing.

By default, we send our standard SubcontractorDispatch schema,
but the body can also be a custom mapped format.

### Accounting Visibility Event

 - [POST https://<accounting-visibility-event-receiving-payload>](https://api-docs.qargo.com/openapi/use-case-visibility/accounting_visibility_eventhttps____accounting_visibility_event_receiving_payload__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-visibility/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Accounting Visibility Event

 - [POST https://<accounting-visibility-event-receiving-payload>](https://api-docs.qargo.com/openapi/webhooks-outbound/accounting_visibility_eventhttps____accounting_visibility_event_receiving_payload__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Operational Visibility Event

 - [POST https://<visibility-event-receiving-endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/operational_visibility_eventhttps____visibility_event_receiving_endpoint__post.md): Webhook for updates to orders and trips. Subscribe to this endpoint to receive updates.

Note that both support our canonical VisibilityUpdate schema,
but the body can also be a custom mapped format.

### Fleet Dispatch Payload

 - [POST https://<external-fleet-receiving-endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/fleet-dispatch-payload.md): Payload for sending fleet app dispatches.
In this case, we send the payload to an external endpoint for processing.

By default, we send our standard FleetDispatch schema,
but the body can also be a custom mapped format.

### Intermodal Booking Payload

 - [POST https://<intermodal-booking-receiving-payload>](https://api-docs.qargo.com/openapi/webhooks-outbound/intermodal_booking_payloadhttps____intermodal_booking_receiving_payload__post.md): Outbound webhook to send intermodal bookings to the external intermodal booking system.

### Location Booking Dispatch Payload

 - [POST https://<location-booking-receiving-endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/location-dispatch-payload.md): Payload for sending location booking dispatches.

By default, we send our standard LocationDispatchOutput schema,
but the body can also be a custom mapped format.

### Subcontractor Dispatch Payload

 - [POST https://<external_subco_receiving_endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/subcontractor-dispatch-payload.md): Payload for sending a trip dispatch.
In this case, we send the payload to an external endpoint for processing.

By default, we send our standard SubcontractorDispatch schema,
but the body can also be a custom mapped format.

## API / Order

### Import Order

 - [POST /v1/orders/order/upload](https://api-docs.qargo.com/openapi/use-case-customer-portal/import_order_v1_orders_order_upload_post.md): Create or update orders in Qargo. See the "Transport order creation & status" section for more info.

### Get Order Import Status

 - [GET /v1/orders/order/upload/{upload_id}](https://api-docs.qargo.com/openapi/use-case-customer-portal/get_order_import_status_v1_orders_order_upload__upload_id__get.md): Get the status of an order import

### Get Order Details

 - [GET /v1/orders/order/{order_id}](https://api-docs.qargo.com/openapi/use-case-customer-portal/get_order_details_v1_orders_order__order_id__get.md): Fetch order detail

### List Order Charges

 - [GET /v1/orders/order/{order_id}/charges](https://api-docs.qargo.com/openapi/use-case-customer-portal/list_order_charges_v1_orders_order__order_id__charges_get.md): Charges for a certain order. Note that these charges are not final and may change

### Approve Order Charges

 - [POST /v1/orders/order/{order_id}/charges/approval](https://api-docs.qargo.com/openapi/use-case-customer-portal/approve_order_charges_v1_orders_order__order_id__charges_approval_post.md): Approve or reject certain charges on the order

### List Order Documents

 - [GET /v1/orders/order/{order_id}/documents](https://api-docs.qargo.com/openapi/use-case-customer-portal/list_order_documents_v1_orders_order__order_id__documents_get.md): Fetch documents for an order. This includes consignment documents

### Order Export

 - [GET /v1/orders/order/{order_id}/export](https://api-docs.qargo.com/openapi/use-case-customer-portal/order_export_v1_orders_order__order_id__export_get.md): Provides a minimal set of order data that can be used as a blueprint to create a new order

### Order Status

 - [GET /v1/orders/order/{order_id}/status](https://api-docs.qargo.com/openapi/use-case-customer-portal/order_status_v1_orders_order__order_id__status_get.md): Order status endpoint. Provides information on the status of the order

### Import Order

 - [POST /v1/orders/order/upload](https://api-docs.qargo.com/openapi/use-case-order/import_order_v1_orders_order_upload_post.md): Create or update orders in Qargo. See the "Transport order creation & status" section for more info.

### Get Order Import Status

 - [GET /v1/orders/order/upload/{upload_id}](https://api-docs.qargo.com/openapi/use-case-order/get_order_import_status_v1_orders_order_upload__upload_id__get.md): Get the status of an order import

### Get Order Details

 - [GET /v1/orders/order/{order_id}](https://api-docs.qargo.com/openapi/use-case-order/get_order_details_v1_orders_order__order_id__get.md): Fetch order detail

### List Order Charges

 - [GET /v1/orders/order/{order_id}/charges](https://api-docs.qargo.com/openapi/use-case-order/list_order_charges_v1_orders_order__order_id__charges_get.md): Charges for a certain order. Note that these charges are not final and may change

### Approve Order Charges

 - [POST /v1/orders/order/{order_id}/charges/approval](https://api-docs.qargo.com/openapi/use-case-order/approve_order_charges_v1_orders_order__order_id__charges_approval_post.md): Approve or reject certain charges on the order

### List Order Documents

 - [GET /v1/orders/order/{order_id}/documents](https://api-docs.qargo.com/openapi/use-case-order/list_order_documents_v1_orders_order__order_id__documents_get.md): Fetch documents for an order. This includes consignment documents

### Order Export

 - [GET /v1/orders/order/{order_id}/export](https://api-docs.qargo.com/openapi/use-case-order/order_export_v1_orders_order__order_id__export_get.md): Provides a minimal set of order data that can be used as a blueprint to create a new order

### Order Status

 - [GET /v1/orders/order/{order_id}/status](https://api-docs.qargo.com/openapi/use-case-order/order_status_v1_orders_order__order_id__status_get.md): Order status endpoint. Provides information on the status of the order

### Import Order

 - [POST /v1/orders/order/upload](https://api-docs.qargo.com/openapi/api-order/import_order_v1_orders_order_upload_post.md): Create or update orders in Qargo. See the "Transport order creation & status" section for more info.

### Get Order Import Status

 - [GET /v1/orders/order/upload/{upload_id}](https://api-docs.qargo.com/openapi/api-order/get_order_import_status_v1_orders_order_upload__upload_id__get.md): Get the status of an order import

### Get Order Details

 - [GET /v1/orders/order/{order_id}](https://api-docs.qargo.com/openapi/api-order/get_order_details_v1_orders_order__order_id__get.md): Fetch order detail

### List Order Charges

 - [GET /v1/orders/order/{order_id}/charges](https://api-docs.qargo.com/openapi/api-order/list_order_charges_v1_orders_order__order_id__charges_get.md): Charges for a certain order. Note that these charges are not final and may change

### Approve Order Charges

 - [POST /v1/orders/order/{order_id}/charges/approval](https://api-docs.qargo.com/openapi/api-order/approve_order_charges_v1_orders_order__order_id__charges_approval_post.md): Approve or reject certain charges on the order

### List Order Documents

 - [GET /v1/orders/order/{order_id}/documents](https://api-docs.qargo.com/openapi/api-order/list_order_documents_v1_orders_order__order_id__documents_get.md): Fetch documents for an order. This includes consignment documents

### Order Export

 - [GET /v1/orders/order/{order_id}/export](https://api-docs.qargo.com/openapi/api-order/order_export_v1_orders_order__order_id__export_get.md): Provides a minimal set of order data that can be used as a blueprint to create a new order

### Order Status

 - [GET /v1/orders/order/{order_id}/status](https://api-docs.qargo.com/openapi/api-order/order_status_v1_orders_order__order_id__status_get.md): Order status endpoint. Provides information on the status of the order

## Use case / Document import

<Doc not found>

### Upload Document Content

 - [POST /v1/documents/document/upload_content](https://api-docs.qargo.com/openapi/use-case-document-import/upload_document_content_v1_documents_document_upload_content_post.md): Upload document content.

### Generic Document Import

 - [POST /v1/webhook/document-import](https://api-docs.qargo.com/openapi/use-case-document-import/document-import-webhook.md): Webhook for importing documents and attaching them to existing orders in Qargo.

## How it works

1. An external system sends a file to this endpoint with metadata as query parameters.
2. The system matches the document to an order in Qargo using the provided query parameters.
3. The document is created and attached to the matched order.

## Query parameters

The filename parameter is always required. Additional query parameters are configurable
per integration during setup and are used to pass metadata about the file and to match
the document to an order.

Query parameters can carry two types of information:

### File metadata

Information about the document itself, for example:
- filename (required) — Name of the uploaded file including extension
- document_type — The type of document (e.g. PROOF_OF_DELIVERY, WAYBILL, INVOICE, CMR)
- document_name — Display name for the document in Qargo

### Matching to Qargo orders

Information used to resolve which order the document should be attached to.
The following order fields can be matched against:

- customer_reference_number — The customer reference number on the order
- name — The order name (e.g. OR-12345)
- id — The order UUID

The match must resolve to exactly one order. If no order or multiple orders match,
the import will be discarded.

The actual set of query parameters and how they map to the above is configured per integration.

## Content encoding

| Content format | Content-Type header | Behavior |
|---|---|---|
| Binary (e.g. PDF, image) | application/pdf, image/png, etc. | Passed through as-is |
| Text | text/plain, text/xml, etc. | Encoded as UTF-8 bytes |
| Base64-encoded string | Non-text or no header | Base64 decode attempted; raw string used on failure |

Please provide the Content-Type header matching the file format.

## Error handling

| Scenario | Behavior |
|----------|----------|
| No order matches the provided criteria | Import is discarded |
| Multiple orders match the criteria | Import is discarded  |
| Document metadata not provided | Import is discarded |

### External Document Upload From A Fleet Application

 - [POST /v1/webhook/fleet-document-upload](https://api-docs.qargo.com/openapi/use-case-document-import/fleet-document-upload-webhook.md): Upload a document to a specific stop or stop group on a fleet-dispatched trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | No* | The Qargo UUID of the stop to attach the document to |
| stop_group_id | No* | The Qargo UUID of the stop group to attach the document to |

*Provide either stop_id or stop_group_id to identify where to attach the document.

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/fleet-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Document Update With Payload

 - [POST /v1/webhook/subco-document-upload](https://api-docs.qargo.com/openapi/use-case-document-import/subcontractor-document-upload-webhook.md): Upload a document to a specific stop on a subcontracted trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Document Upload From A Fleet Application

 - [POST /v1/webhook/fleet-document-upload](https://api-docs.qargo.com/openapi/use-case-fleet-dispatch/fleet-document-upload-webhook.md): Upload a document to a specific stop or stop group on a fleet-dispatched trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | No* | The Qargo UUID of the stop to attach the document to |
| stop_group_id | No* | The Qargo UUID of the stop group to attach the document to |

*Provide either stop_id or stop_group_id to identify where to attach the document.

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/fleet-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Document Update With Payload

 - [POST /v1/webhook/subco-document-upload](https://api-docs.qargo.com/openapi/use-case-subcontractor-dispatch/subcontractor-document-upload-webhook.md): Upload a document to a specific stop on a subcontracted trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### Upload Document Content

 - [POST /v1/documents/document/upload_content](https://api-docs.qargo.com/openapi/api-document/upload_document_content_v1_documents_document_upload_content_post.md): Upload document content.

### Generic Document Import

 - [POST /v1/webhook/document-import](https://api-docs.qargo.com/openapi/webhooks-inbound/document-import-webhook.md): Webhook for importing documents and attaching them to existing orders in Qargo.

## How it works

1. An external system sends a file to this endpoint with metadata as query parameters.
2. The system matches the document to an order in Qargo using the provided query parameters.
3. The document is created and attached to the matched order.

## Query parameters

The filename parameter is always required. Additional query parameters are configurable
per integration during setup and are used to pass metadata about the file and to match
the document to an order.

Query parameters can carry two types of information:

### File metadata

Information about the document itself, for example:
- filename (required) — Name of the uploaded file including extension
- document_type — The type of document (e.g. PROOF_OF_DELIVERY, WAYBILL, INVOICE, CMR)
- document_name — Display name for the document in Qargo

### Matching to Qargo orders

Information used to resolve which order the document should be attached to.
The following order fields can be matched against:

- customer_reference_number — The customer reference number on the order
- name — The order name (e.g. OR-12345)
- id — The order UUID

The match must resolve to exactly one order. If no order or multiple orders match,
the import will be discarded.

The actual set of query parameters and how they map to the above is configured per integration.

## Content encoding

| Content format | Content-Type header | Behavior |
|---|---|---|
| Binary (e.g. PDF, image) | application/pdf, image/png, etc. | Passed through as-is |
| Text | text/plain, text/xml, etc. | Encoded as UTF-8 bytes |
| Base64-encoded string | Non-text or no header | Base64 decode attempted; raw string used on failure |

Please provide the Content-Type header matching the file format.

## Error handling

| Scenario | Behavior |
|----------|----------|
| No order matches the provided criteria | Import is discarded |
| Multiple orders match the criteria | Import is discarded  |
| Document metadata not provided | Import is discarded |

### External Document Upload From A Fleet Application

 - [POST /v1/webhook/fleet-document-upload](https://api-docs.qargo.com/openapi/webhooks-inbound/fleet-document-upload-webhook.md): Upload a document to a specific stop or stop group on a fleet-dispatched trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | No* | The Qargo UUID of the stop to attach the document to |
| stop_group_id | No* | The Qargo UUID of the stop group to attach the document to |

*Provide either stop_id or stop_group_id to identify where to attach the document.

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/fleet-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Document Update With Payload

 - [POST /v1/webhook/subco-document-upload](https://api-docs.qargo.com/openapi/webhooks-inbound/subcontractor-document-upload-webhook.md): Upload a document to a specific stop on a subcontracted trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

## Use case / Fleet dispatch

<Doc not found>

### External Document Upload From A Fleet Application

 - [POST /v1/webhook/fleet-document-upload](https://api-docs.qargo.com/openapi/use-case-document-import/fleet-document-upload-webhook.md): Upload a document to a specific stop or stop group on a fleet-dispatched trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | No* | The Qargo UUID of the stop to attach the document to |
| stop_group_id | No* | The Qargo UUID of the stop group to attach the document to |

*Provide either stop_id or stop_group_id to identify where to attach the document.

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/fleet-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Document Upload From A Fleet Application

 - [POST /v1/webhook/fleet-document-upload](https://api-docs.qargo.com/openapi/use-case-fleet-dispatch/fleet-document-upload-webhook.md): Upload a document to a specific stop or stop group on a fleet-dispatched trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | No* | The Qargo UUID of the stop to attach the document to |
| stop_group_id | No* | The Qargo UUID of the stop group to attach the document to |

*Provide either stop_id or stop_group_id to identify where to attach the document.

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/fleet-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Status Update From A Fleet Application

 - [POST /v1/webhook/fleet-status-update](https://api-docs.qargo.com/openapi/use-case-fleet-dispatch/fleet-status-update-webhook.md): Webhook for updating the status, ETA, and data of stops from an external fleet application.

Note that this webhook uses Basic Auth instead of the OAuth credentials used for the api.
Please contact integrations@qargo.com to request credentials.

---

## Identifying a stop

Each update targets either a single stop or a stop group. Provide one per update entry.

### By stop ID (preferred)

If you know the Qargo stop UUID, pass it directly in stop.id:

json
{
  "updates": [
    {
      "stop": { "id": "a1b2c3d4-0000-0000-0000-000000000000", "status": "AT_STOP" },
      "event_time": "2025-06-15T10:30:00Z"
    }
  ]
}


### By matching criteria

When the stop ID is not known, use stop.match to find the stop by its related entities.
The matcher uses all provided criteria combined (AND logic) and expects exactly one stop
to match. If zero or multiple stops match, the update is discarded.

Available matching fields:

| Object         | Field                        | Description                                          |
|----------------|------------------------------|------------------------------------------------------|
| trip         | name.matches_any           | Trip name(s)                                         |
| order        | name.matches_any           | Order name(s)                                        |
| order        | customer_reference_number.matches_any | Customer reference number(s)              |
| order        | id.matches_any             | Order UUID(s)                                        |
| consignment  | reference_number.matches_any | Consignment reference number(s)                    |
| consignment  | order_sequence_number      | Consignment sequence number within the order (integer) |
| stop         | reference_number.matches_any | Stop reference number(s)                           |
| stop         | stop_type                  | PICKUP or DELIVERY                               |

Each matches_any field accepts a list of values — the stop matches if its value equals any of them.
When multiple fields are provided, they are all required to match (AND).

Example — match by order reference + stop type:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "order": { "customer_reference_number": { "matches_any": ["REF-12345"] } },
              "stop": { "stop_type": "DELIVERY" }
            }
          ]
        },
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T14:00:00Z"
    }
  ]
}


Example — match by trip name + consignment reference:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "trip": { "name": { "matches_any": ["T-20250615-001"] } },
              "consignment": { "reference_number": { "matches_any": ["CONS-98765"] } }
            }
          ]
        },
        "status": "AT_STOP",
        "eta_end": "2025-06-15T16:00:00Z"
      },
      "event_time": "2025-06-15T14:30:00Z"
    }
  ]
}


## Stop group updates

A stop group represents multiple stops grouped by activity and location. When updating via
stop_group, the status applies to all stops in that group. The stop group id is always
required — matching by criteria is not supported for stop groups.

json
{
  "updates": [
    {
      "stop_group": {
        "id": "b2c3d4e5-0000-0000-0000-000000000000",
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T16:00:00Z"
    }
  ]
}


## Statuses

- AT_STOP — the vehicle has arrived at the stop location.
- COMPLETED — the stop activity is finished.
- Omit status to update only the ETA or data fields without changing the stop status.

### Fleet Dispatch Payload

 - [POST https://<external-fleet-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-fleet-dispatch/fleet-dispatch-payload.md): Payload for sending fleet app dispatches.
In this case, we send the payload to an external endpoint for processing.

By default, we send our standard FleetDispatch schema,
but the body can also be a custom mapped format.

### External Document Upload From A Fleet Application

 - [POST /v1/webhook/fleet-document-upload](https://api-docs.qargo.com/openapi/webhooks-inbound/fleet-document-upload-webhook.md): Upload a document to a specific stop or stop group on a fleet-dispatched trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | No* | The Qargo UUID of the stop to attach the document to |
| stop_group_id | No* | The Qargo UUID of the stop group to attach the document to |

*Provide either stop_id or stop_group_id to identify where to attach the document.

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/fleet-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Status Update From A Fleet Application

 - [POST /v1/webhook/fleet-status-update](https://api-docs.qargo.com/openapi/webhooks-inbound/fleet-status-update-webhook.md): Webhook for updating the status, ETA, and data of stops from an external fleet application.

Note that this webhook uses Basic Auth instead of the OAuth credentials used for the api.
Please contact integrations@qargo.com to request credentials.

---

## Identifying a stop

Each update targets either a single stop or a stop group. Provide one per update entry.

### By stop ID (preferred)

If you know the Qargo stop UUID, pass it directly in stop.id:

json
{
  "updates": [
    {
      "stop": { "id": "a1b2c3d4-0000-0000-0000-000000000000", "status": "AT_STOP" },
      "event_time": "2025-06-15T10:30:00Z"
    }
  ]
}


### By matching criteria

When the stop ID is not known, use stop.match to find the stop by its related entities.
The matcher uses all provided criteria combined (AND logic) and expects exactly one stop
to match. If zero or multiple stops match, the update is discarded.

Available matching fields:

| Object         | Field                        | Description                                          |
|----------------|------------------------------|------------------------------------------------------|
| trip         | name.matches_any           | Trip name(s)                                         |
| order        | name.matches_any           | Order name(s)                                        |
| order        | customer_reference_number.matches_any | Customer reference number(s)              |
| order        | id.matches_any             | Order UUID(s)                                        |
| consignment  | reference_number.matches_any | Consignment reference number(s)                    |
| consignment  | order_sequence_number      | Consignment sequence number within the order (integer) |
| stop         | reference_number.matches_any | Stop reference number(s)                           |
| stop         | stop_type                  | PICKUP or DELIVERY                               |

Each matches_any field accepts a list of values — the stop matches if its value equals any of them.
When multiple fields are provided, they are all required to match (AND).

Example — match by order reference + stop type:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "order": { "customer_reference_number": { "matches_any": ["REF-12345"] } },
              "stop": { "stop_type": "DELIVERY" }
            }
          ]
        },
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T14:00:00Z"
    }
  ]
}


Example — match by trip name + consignment reference:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "trip": { "name": { "matches_any": ["T-20250615-001"] } },
              "consignment": { "reference_number": { "matches_any": ["CONS-98765"] } }
            }
          ]
        },
        "status": "AT_STOP",
        "eta_end": "2025-06-15T16:00:00Z"
      },
      "event_time": "2025-06-15T14:30:00Z"
    }
  ]
}


## Stop group updates

A stop group represents multiple stops grouped by activity and location. When updating via
stop_group, the status applies to all stops in that group. The stop group id is always
required — matching by criteria is not supported for stop groups.

json
{
  "updates": [
    {
      "stop_group": {
        "id": "b2c3d4e5-0000-0000-0000-000000000000",
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T16:00:00Z"
    }
  ]
}


## Statuses

- AT_STOP — the vehicle has arrived at the stop location.
- COMPLETED — the stop activity is finished.
- Omit status to update only the ETA or data fields without changing the stop status.

### Fleet Dispatch Payload

 - [POST https://<external-fleet-receiving-endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/fleet-dispatch-payload.md): Payload for sending fleet app dispatches.
In this case, we send the payload to an external endpoint for processing.

By default, we send our standard FleetDispatch schema,
but the body can also be a custom mapped format.

## Use case / Subcontractor dispatch

Required api role: not applicable (push/push)

Purpose: This interface allows an external party to integrate with 3rd party transport management systems for subcontracting.

The subcontractor dispatch uses a push/push model: Qargo pushes a dispatch payload to an external endpoint.
The third party then updates Qargo using our webhook endpoint:

![dispatch flow](/docs/static/subco_dispatch_flow.svg)

Subsequent updates or cancellations will also be sent via this webhook, using the same payload format.
The dispatch format has the following structure:

![dispatch payload](/docs/static/dispatch_subco_payload.svg)

The destination of this webhook can be a RESTful interface or file base protocol like SFTP

The [status update endpoint](#tag/Use-case-Subcontractor-dispatch/operation/External_status_updatestatus_update_webhook_post) can be receive information about the stops back to Qargo.


### External Document Update With Payload

 - [POST /v1/webhook/subco-document-upload](https://api-docs.qargo.com/openapi/use-case-document-import/subcontractor-document-upload-webhook.md): Upload a document to a specific stop on a subcontracted trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Document Update With Payload

 - [POST /v1/webhook/subco-document-upload](https://api-docs.qargo.com/openapi/use-case-subcontractor-dispatch/subcontractor-document-upload-webhook.md): Upload a document to a specific stop on a subcontracted trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Status Update

 - [POST /v1/webhook/subco-status-update](https://api-docs.qargo.com/openapi/use-case-subcontractor-dispatch/subcontractor-status-update-webhook.md): Webhook for updating the status, ETA, and data of stops from an external subcontractor system.

Note that this webhook uses Basic Auth instead of the OAuth credentials used for the api.
Please contact integrations@qargo.com to request credentials.

---

## Identifying a stop

Each update targets a single stop. You can identify it by its Qargo UUID or by matching criteria.

### By stop ID (preferred)

If you know the Qargo stop UUID, pass it directly in stop.id:

json
{
  "updates": [
    {
      "stop": { "id": "a1b2c3d4-0000-0000-0000-000000000000", "status": "AT_STOP" },
      "event_time": "2025-06-15T10:30:00Z"
    }
  ]
}


### By matching criteria

When the stop ID is not known, use stop.match to find the stop by its related entities.
The matcher uses all provided criteria combined (AND logic) and expects exactly one stop
to match. If zero or multiple stops match, the update is discarded.

Available matching fields:

| Object         | Field                        | Description                                          |
|----------------|------------------------------|------------------------------------------------------|
| trip         | name.matches_any           | Trip name(s)                                         |
| order        | name.matches_any           | Order name(s)                                        |
| order        | customer_reference_number.matches_any | Customer reference number(s)              |
| order        | id.matches_any             | Order UUID(s)                                        |
| consignment  | reference_number.matches_any | Consignment reference number(s)                    |
| consignment  | order_sequence_number      | Consignment sequence number within the order (integer) |
| stop         | reference_number.matches_any | Stop reference number(s)                           |
| stop         | stop_type                  | PICKUP or DELIVERY                               |

Each matches_any field accepts a list of values — the stop matches if its value equals any of them.
When multiple fields are provided, they are all required to match (AND).

Example — match by order reference + stop type:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "order": { "customer_reference_number": { "matches_any": ["REF-12345"] } },
              "stop": { "stop_type": "DELIVERY" }
            }
          ]
        },
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T14:00:00Z"
    }
  ]
}


Example — match by trip name + consignment reference:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "trip": { "name": { "matches_any": ["T-20250615-001"] } },
              "consignment": { "reference_number": { "matches_any": ["CONS-98765"] } }
            }
          ]
        },
        "status": "AT_STOP",
        "eta_end": "2025-06-15T16:00:00Z"
      },
      "event_time": "2025-06-15T14:30:00Z"
    }
  ]
}


## Statuses

- AT_STOP — the vehicle has arrived at the stop location.
- COMPLETED — the stop activity is finished.
- Omit status to update only the ETA or data fields without changing the stop status.

### Subcontractor Dispatch Payload

 - [POST https://<external_subco_receiving_endpoint>](https://api-docs.qargo.com/openapi/use-case-subcontractor-dispatch/subcontractor-dispatch-payload.md): Payload for sending a trip dispatch.
In this case, we send the payload to an external endpoint for processing.

By default, we send our standard SubcontractorDispatch schema,
but the body can also be a custom mapped format.

### External Document Update With Payload

 - [POST /v1/webhook/subco-document-upload](https://api-docs.qargo.com/openapi/webhooks-inbound/subcontractor-document-upload-webhook.md): Upload a document to a specific stop on a subcontracted trip.

This webhook uses Basic Auth (webhook credentials), not the OAuth credentials used for the API.
Contact integrations@qargo.com to request credentials.

---

## Query parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| question_path_key | Yes | Maps the file to a document type in Qargo (e.g. CMR, POD, WEIGHT_NOTE) |
| stop_id | Yes | The Qargo UUID of the stop to attach the document to |

## Headers

| Header | Required | Description |
|--------|----------|-------------|
| Content-Type | Yes | MIME type of the file (e.g. application/pdf, image/jpeg) |
| Content-Disposition | No | Provides the filename: attachment; filename="POD.pdf" |

## Filename handling

The uploaded file's name in Qargo is determined by:

1. If Content-Disposition includes a filename — that value is used, combined with the question path key default.
   For example: filename="pod1234.pdf" with question path key default POD.pdf → stored as pod1234_POD.pdf.
2. If no Content-Disposition is provided — the default filename from the question path key configuration is used.

## Example


curl -X POST \
  "https://api.qargo.com/v1/webhook/subco-document-upload\
  ?question_path_key=POD&stop_id=" \
  -u ":" \
  -H "Content-Type: application/pdf" \
  -H "Content-Disposition: attachment; filename=POD.pdf" \
  --data-binary @/path/to/document.pdf

### External Status Update

 - [POST /v1/webhook/subco-status-update](https://api-docs.qargo.com/openapi/webhooks-inbound/subcontractor-status-update-webhook.md): Webhook for updating the status, ETA, and data of stops from an external subcontractor system.

Note that this webhook uses Basic Auth instead of the OAuth credentials used for the api.
Please contact integrations@qargo.com to request credentials.

---

## Identifying a stop

Each update targets a single stop. You can identify it by its Qargo UUID or by matching criteria.

### By stop ID (preferred)

If you know the Qargo stop UUID, pass it directly in stop.id:

json
{
  "updates": [
    {
      "stop": { "id": "a1b2c3d4-0000-0000-0000-000000000000", "status": "AT_STOP" },
      "event_time": "2025-06-15T10:30:00Z"
    }
  ]
}


### By matching criteria

When the stop ID is not known, use stop.match to find the stop by its related entities.
The matcher uses all provided criteria combined (AND logic) and expects exactly one stop
to match. If zero or multiple stops match, the update is discarded.

Available matching fields:

| Object         | Field                        | Description                                          |
|----------------|------------------------------|------------------------------------------------------|
| trip         | name.matches_any           | Trip name(s)                                         |
| order        | name.matches_any           | Order name(s)                                        |
| order        | customer_reference_number.matches_any | Customer reference number(s)              |
| order        | id.matches_any             | Order UUID(s)                                        |
| consignment  | reference_number.matches_any | Consignment reference number(s)                    |
| consignment  | order_sequence_number      | Consignment sequence number within the order (integer) |
| stop         | reference_number.matches_any | Stop reference number(s)                           |
| stop         | stop_type                  | PICKUP or DELIVERY                               |

Each matches_any field accepts a list of values — the stop matches if its value equals any of them.
When multiple fields are provided, they are all required to match (AND).

Example — match by order reference + stop type:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "order": { "customer_reference_number": { "matches_any": ["REF-12345"] } },
              "stop": { "stop_type": "DELIVERY" }
            }
          ]
        },
        "status": "COMPLETED"
      },
      "event_time": "2025-06-15T14:00:00Z"
    }
  ]
}


Example — match by trip name + consignment reference:

json
{
  "updates": [
    {
      "stop": {
        "match": {
          "matches_all": [
            {
              "trip": { "name": { "matches_any": ["T-20250615-001"] } },
              "consignment": { "reference_number": { "matches_any": ["CONS-98765"] } }
            }
          ]
        },
        "status": "AT_STOP",
        "eta_end": "2025-06-15T16:00:00Z"
      },
      "event_time": "2025-06-15T14:30:00Z"
    }
  ]
}


## Statuses

- AT_STOP — the vehicle has arrived at the stop location.
- COMPLETED — the stop activity is finished.
- Omit status to update only the ETA or data fields without changing the stop status.

### Subcontractor Dispatch Payload

 - [POST https://<external_subco_receiving_endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/subcontractor-dispatch-payload.md): Payload for sending a trip dispatch.
In this case, we send the payload to an external endpoint for processing.

By default, we send our standard SubcontractorDispatch schema,
but the body can also be a custom mapped format.

## Use case / E-invoicing

Required api role: not applicable

Purpose: This interface allows an external party to send e-invoices in a structured format.

A [webhook](#tag/Use-case-E-invoicing/operation/e-invoicing-webhook) can be used to send e-invoices to Qargo. The e-invoice can either be a **purchase invoice** or a **purchase credit note**.

### Supported formats

| Format | Content-Type | Notes |
|--------|-------------|-------|
| JSON | `application/json` | Qargo's own purchase invoice/credit note schema |
| XML (UBL) | `application/xml` | Peppol-compliant UBL documents |
| Multipart | `multipart/form-data` | JSON invoice data + supporting document files (PDF, XML, etc.) |

### Attachments

Attachments (e.g. invoice PDF, CMR, proof of delivery) can be included in two ways:

- **In JSON payloads**: Use the `attachments` array, where each item contains a `document` object with `base64`, `content_type`, `document_type`, and `filename` fields.
- **In multipart uploads**: Send the JSON invoice data as the first part, followed by file attachments as additional parts.

See the [e-invoicing webhook endpoint](#tag/Use-case-E-invoicing/operation/e-invoicing-webhook) for detailed examples of all formats and attachment handling.


### Send E-Invoices

 - [POST /v1/webhook](https://api-docs.qargo.com/openapi/use-case-e-invoicing/e-invoicing-webhook.md): Webhook to receive e-invoices in structured format or as file uploads.

## Supported Formats
This endpoint accepts e-invoices in multiple formats:

- JSON payloads: Structured data using application/json content type.
- XML payloads: Structured data using application/xml content type. Must be a valid UBL document.
- File uploads: JSON + binary files (PDF, XML, etc.) using multipart/form-data.

## Multipart Upload Support
When using multipart form data, the endpoint expects:
- First part: JSON document (PurchaseEInvoiceInput or PurchaseECreditNoteInput). XML is not supported at the moment.
- Subsequent parts: Supporting documents (invoice PDF, CMR PDF, etc.).

## Examples

JSON payload example (application/json).

json
{
  "name": "INV-2023-001",
  "date": "2023-01-15",
  "due_date": "2023-02-15",
  "invoice_type": "PURCHASE",
  "currency": "EUR",
  "total_excl_tax": 999.99,
  "total_incl_tax": 1209.99,
  "total_tax": 210.00,
  "custom_fields": {},
  "supplier": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Supplier Company Ltd",
    "vat_number": "BE1234.123.123",
    "billing_location": {
      "address": "Gaston Crommenlaan 4",
      "city": "Gent",
      "postal_code": "9050",
      "country": "BE"
    }
  },
  "customer_reference_numbers": ["12345"],
  "line_items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Transport Service",
      "description": "International freight transport",
      "amount": 999.99,
      "currency": "EUR",
      "tax_rate": {
        "rate": 21.0,
        "name": "VAT"
      },
      "account": {
        "code": "6000",
        "name": "Transport Costs"
      },
      "references": {
        "order_name": "OR-1234"
      }
    }
  ],
  "attachments": [
    {
      "document": {
        "base64": "JVBERi0xLjQKJcfs... (truncated for brevity) ...",
        "content_type": "application/pdf",
        "document_type": "INVOICE",
        "filename": "invoice_123.pdf"
      }
    }
  ]
}


XML payload example (application/xml).

xml

    urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0
    urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
    25900027
    2025-10-28
    2025-10-28
    380
    EUR
    25900027
    
        600947
        
            JVBERi0xLjQKJcfs... (truncated for brevity) ...
        
    
    
        
        0564730040
        
            qargo-peppol-dev
        
        
            Gaston Crommenlaan 4
            Gent
            9050
            Oost-Vlaanderen
            
            BE
            
        
        
            BE0772640434
            
            VAT
            
        
        
            qargo-peppol-dev
            0564730040
        
        
            +324854244512
            simon@qargo.com
        
        
    
    
        
        0772640434
        
            Qargo
        
        
            Gaston Crommenlaan 4
            Gent
            9050
            
            BE
            
        
        
            Qargo
            0772640434
        
        
    
    
        162.71
        
        774.83
        162.71
        
            S
            21.00
            
            VAT
            
        
        
    
    
        774.83
        774.83
        937.54
        937.54
    
    
        1
        1.0
        65.00
        
        Administratiekost
        
            S
            21.00
            
            VAT
            
        
        
        
        65.0
        
    
    
        2
        1.0
        709.83
        
        Transport charge
        
            S
            21.00
            
            VAT
            
        
        
        
        709.83
        
    



Multipart Form Data example.


POST /v1/webhook
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryABC123XYZ

----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="document"; filename="invoice_data.json"
Content-Type: application/json

{
  "name": "INV-2023-001",
  "date": "2023-01-15",
  "due_date": "2023-02-15",
  "invoice_type": "PURCHASE",
  "currency": "EUR",
  "total_excl_tax": 999.99,
  "total_incl_tax": 1209.99,
  "total_tax": 210.00,
  "custom_fields": {},
  "supplier": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Supplier Company Ltd",
    "vat_number": "BE1234.123.123",
    "billing_location": {
      "address": "Gaston Crommenlaan 4",
      "city": "Gent",
      "postal_code": "9050",
      "country": "BE"
    }
  },
  "customer_reference_numbers": ["12345"],
  "line_items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Transport Service",
      "description": "International freight transport",
      "amount": 999.99,
      "currency": "EUR",
      "tax_rate": {
        "rate": 21.0,
        "name": "VAT"
      },
      "account": {
        "code": "6000",
        "name": "Transport Costs"
      },
      "references": {
        "order_name": "OR-1234"
      }
    }
  ]
}
----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="invoice"; filename="invoice_123.pdf"
Content-Type: application/pdf

[binary PDF content]
----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="cmr"; filename="cmr_document.pdf"
Content-Type: application/pdf

[binary PDF content]
----WebKitFormBoundaryABC123XYZ--


## Processing Notes on Multipart Uploads
- First part must be the JSON document containing invoice/credit note data.
- Supporting documents follow as additional parts.
- Content-Type headers determine document processing.

### Send E-Invoices

 - [POST /v1/webhook](https://api-docs.qargo.com/openapi/webhooks-inbound/e-invoicing-webhook.md): Webhook to receive e-invoices in structured format or as file uploads.

## Supported Formats
This endpoint accepts e-invoices in multiple formats:

- JSON payloads: Structured data using application/json content type.
- XML payloads: Structured data using application/xml content type. Must be a valid UBL document.
- File uploads: JSON + binary files (PDF, XML, etc.) using multipart/form-data.

## Multipart Upload Support
When using multipart form data, the endpoint expects:
- First part: JSON document (PurchaseEInvoiceInput or PurchaseECreditNoteInput). XML is not supported at the moment.
- Subsequent parts: Supporting documents (invoice PDF, CMR PDF, etc.).

## Examples

JSON payload example (application/json).

json
{
  "name": "INV-2023-001",
  "date": "2023-01-15",
  "due_date": "2023-02-15",
  "invoice_type": "PURCHASE",
  "currency": "EUR",
  "total_excl_tax": 999.99,
  "total_incl_tax": 1209.99,
  "total_tax": 210.00,
  "custom_fields": {},
  "supplier": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Supplier Company Ltd",
    "vat_number": "BE1234.123.123",
    "billing_location": {
      "address": "Gaston Crommenlaan 4",
      "city": "Gent",
      "postal_code": "9050",
      "country": "BE"
    }
  },
  "customer_reference_numbers": ["12345"],
  "line_items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Transport Service",
      "description": "International freight transport",
      "amount": 999.99,
      "currency": "EUR",
      "tax_rate": {
        "rate": 21.0,
        "name": "VAT"
      },
      "account": {
        "code": "6000",
        "name": "Transport Costs"
      },
      "references": {
        "order_name": "OR-1234"
      }
    }
  ],
  "attachments": [
    {
      "document": {
        "base64": "JVBERi0xLjQKJcfs... (truncated for brevity) ...",
        "content_type": "application/pdf",
        "document_type": "INVOICE",
        "filename": "invoice_123.pdf"
      }
    }
  ]
}


XML payload example (application/xml).

xml

    urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0
    urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
    25900027
    2025-10-28
    2025-10-28
    380
    EUR
    25900027
    
        600947
        
            JVBERi0xLjQKJcfs... (truncated for brevity) ...
        
    
    
        
        0564730040
        
            qargo-peppol-dev
        
        
            Gaston Crommenlaan 4
            Gent
            9050
            Oost-Vlaanderen
            
            BE
            
        
        
            BE0772640434
            
            VAT
            
        
        
            qargo-peppol-dev
            0564730040
        
        
            +324854244512
            simon@qargo.com
        
        
    
    
        
        0772640434
        
            Qargo
        
        
            Gaston Crommenlaan 4
            Gent
            9050
            
            BE
            
        
        
            Qargo
            0772640434
        
        
    
    
        162.71
        
        774.83
        162.71
        
            S
            21.00
            
            VAT
            
        
        
    
    
        774.83
        774.83
        937.54
        937.54
    
    
        1
        1.0
        65.00
        
        Administratiekost
        
            S
            21.00
            
            VAT
            
        
        
        
        65.0
        
    
    
        2
        1.0
        709.83
        
        Transport charge
        
            S
            21.00
            
            VAT
            
        
        
        
        709.83
        
    



Multipart Form Data example.


POST /v1/webhook
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryABC123XYZ

----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="document"; filename="invoice_data.json"
Content-Type: application/json

{
  "name": "INV-2023-001",
  "date": "2023-01-15",
  "due_date": "2023-02-15",
  "invoice_type": "PURCHASE",
  "currency": "EUR",
  "total_excl_tax": 999.99,
  "total_incl_tax": 1209.99,
  "total_tax": 210.00,
  "custom_fields": {},
  "supplier": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Supplier Company Ltd",
    "vat_number": "BE1234.123.123",
    "billing_location": {
      "address": "Gaston Crommenlaan 4",
      "city": "Gent",
      "postal_code": "9050",
      "country": "BE"
    }
  },
  "customer_reference_numbers": ["12345"],
  "line_items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Transport Service",
      "description": "International freight transport",
      "amount": 999.99,
      "currency": "EUR",
      "tax_rate": {
        "rate": 21.0,
        "name": "VAT"
      },
      "account": {
        "code": "6000",
        "name": "Transport Costs"
      },
      "references": {
        "order_name": "OR-1234"
      }
    }
  ]
}
----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="invoice"; filename="invoice_123.pdf"
Content-Type: application/pdf

[binary PDF content]
----WebKitFormBoundaryABC123XYZ
Content-Disposition: form-data; name="cmr"; filename="cmr_document.pdf"
Content-Type: application/pdf

[binary PDF content]
----WebKitFormBoundaryABC123XYZ--


## Processing Notes on Multipart Uploads
- First part must be the JSON document containing invoice/credit note data.
- Supporting documents follow as additional parts.
- Content-Type headers determine document processing.

## Use case / Intermodal [partner]

Note: this is currently only a specification meant as a preview.
Implementation is still pending.


### Intermodal Booking Status Update Webhook

 - [POST /v1/webhook/intermodal-status](https://api-docs.qargo.com/openapi/use-case-intermodal-partner/intermodal-booking-status-webhook.md): Inbound webhook to receive intermodal booking status updates from the external intermodal booking system.

### Intermodal Booking Payload

 - [POST https://<intermodal-booking-receiving-payload>](https://api-docs.qargo.com/openapi/use-case-intermodal-partner/intermodal_booking_payloadhttps____intermodal_booking_receiving_payload__post.md): Outbound webhook to send intermodal bookings to the external intermodal booking system.

### Intermodal Booking Status Update Webhook

 - [POST /v1/webhook/intermodal-status](https://api-docs.qargo.com/openapi/webhooks-inbound/intermodal-booking-status-webhook.md): Inbound webhook to receive intermodal booking status updates from the external intermodal booking system.

### Intermodal Booking Payload

 - [POST https://<intermodal-booking-receiving-payload>](https://api-docs.qargo.com/openapi/webhooks-outbound/intermodal_booking_payloadhttps____intermodal_booking_receiving_payload__post.md): Outbound webhook to send intermodal bookings to the external intermodal booking system.

## Use case / Location booking

### Location Booking Update Webhook

 - [POST /v1/webhook/location-booking-update](https://api-docs.qargo.com/openapi/use-case-location-booking/location-booking-update-webhook.md): Inbound webhook to receive location booking updates from external systems.

### Location Booking Dispatch Payload

 - [POST https://<location-booking-receiving-endpoint>](https://api-docs.qargo.com/openapi/use-case-location-booking/location-dispatch-payload.md): Payload for sending location booking dispatches.

By default, we send our standard LocationDispatchOutput schema,
but the body can also be a custom mapped format.

### Location Booking Update Webhook

 - [POST /v1/webhook/location-booking-update](https://api-docs.qargo.com/openapi/webhooks-inbound/location-booking-update-webhook.md): Inbound webhook to receive location booking updates from external systems.

### Location Booking Dispatch Payload

 - [POST https://<location-booking-receiving-endpoint>](https://api-docs.qargo.com/openapi/webhooks-outbound/location-dispatch-payload.md): Payload for sending location booking dispatches.

By default, we send our standard LocationDispatchOutput schema,
but the body can also be a custom mapped format.

## API / Company

### List Companies

 - [GET /v1/companies/company](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_companies_v1_companies_company_get.md)

### Create Company

 - [POST /v1/companies/company](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_company_v1_companies_company_post.md)

### Get Company Documents

 - [GET /v1/companies/company/{company_id}/documents](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_company_documents_v1_companies_company__company_id__documents_get.md): Fetch all documents for a specific company.

### Create Company Document

 - [POST /v1/companies/company/{company_id}/documents](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_company_document_v1_companies_company__company_id__documents_post.md): Upload a document for a specific company.

### List Company Validities

 - [GET /v1/companies/company/{company_id}/validity](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_company_validities_v1_companies_company__company_id__validity_get.md): List all validities for a company.

### Create Company Validity Request

 - [POST /v1/companies/company/{company_id}/validity](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_company_validity_request_v1_companies_company__company_id__validity_post.md): Create a new validity request for a company.

### Get Company Validity

 - [GET /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_company_validity_v1_companies_company__company_id__validity__id__get.md): Fetches a specific validity for a company.

### Update Company Validity

 - [PUT /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_company_validity_v1_companies_company__company_id__validity__id__put.md): Update an existing validity for a company.

### Delete Company Validity

 - [DELETE /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/delete_company_validity_v1_companies_company__company_id__validity__id__delete.md): Delete a company validity.

### Get Company Validity Documents

 - [GET /v1/companies/company/{company_id}/validity/{id}/documents](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_company_validity_documents_v1_companies_company__company_id__validity__id__documents_get.md): Fetch all documents associated with a specific company validity.

### Get Company

 - [GET /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_company_v1_companies_company__id__get.md)

### Update Company

 - [PUT /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_company_v1_companies_company__id__put.md)

### Update Company

 - [PATCH /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_company_v1_companies_company__id__patch.md)

### Delete Company

 - [DELETE /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/delete_company_v1_companies_company__id__delete.md)

### List Companies

 - [GET /v1/companies/company](https://api-docs.qargo.com/openapi/api-company/list_companies_v1_companies_company_get.md)

### Create Company

 - [POST /v1/companies/company](https://api-docs.qargo.com/openapi/api-company/create_company_v1_companies_company_post.md)

### Get Company Documents

 - [GET /v1/companies/company/{company_id}/documents](https://api-docs.qargo.com/openapi/api-company/get_company_documents_v1_companies_company__company_id__documents_get.md): Fetch all documents for a specific company.

### Create Company Document

 - [POST /v1/companies/company/{company_id}/documents](https://api-docs.qargo.com/openapi/api-company/create_company_document_v1_companies_company__company_id__documents_post.md): Upload a document for a specific company.

### List Company Validities

 - [GET /v1/companies/company/{company_id}/validity](https://api-docs.qargo.com/openapi/api-company/list_company_validities_v1_companies_company__company_id__validity_get.md): List all validities for a company.

### Create Company Validity Request

 - [POST /v1/companies/company/{company_id}/validity](https://api-docs.qargo.com/openapi/api-company/create_company_validity_request_v1_companies_company__company_id__validity_post.md): Create a new validity request for a company.

### Get Company Validity

 - [GET /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-company/get_company_validity_v1_companies_company__company_id__validity__id__get.md): Fetches a specific validity for a company.

### Update Company Validity

 - [PUT /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-company/update_company_validity_v1_companies_company__company_id__validity__id__put.md): Update an existing validity for a company.

### Delete Company Validity

 - [DELETE /v1/companies/company/{company_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-company/delete_company_validity_v1_companies_company__company_id__validity__id__delete.md): Delete a company validity.

### Get Company Validity Documents

 - [GET /v1/companies/company/{company_id}/validity/{id}/documents](https://api-docs.qargo.com/openapi/api-company/get_company_validity_documents_v1_companies_company__company_id__validity__id__documents_get.md): Fetch all documents associated with a specific company validity.

### Get Company

 - [GET /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/api-company/get_company_v1_companies_company__id__get.md)

### Update Company

 - [PUT /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/api-company/update_company_v1_companies_company__id__put.md)

### Update Company

 - [PATCH /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/api-company/update_company_v1_companies_company__id__patch.md)

### Delete Company

 - [DELETE /v1/companies/company/{id}](https://api-docs.qargo.com/openapi/api-company/delete_company_v1_companies_company__id__delete.md)

## API / Resource

### Create Resource

 - [POST /v1/resources/resource](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_resource_v1_resources_resource_post.md): Create a new resource.

### List Resources

 - [GET /v1/resources/resource](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_resources_v1_resources_resource_get.md): List all resources

### Update Resource

 - [PUT /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_resource_v1_resources_resource__resource_id__put.md): Update an existing resource.

### Patch Resource

 - [PATCH /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/patch_resource_v1_resources_resource__resource_id__patch.md): Partially update an existing resource.

### Archive Resource

 - [DELETE /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/archive_resource_v1_resources_resource__resource_id__delete.md): Archive a resource

### Get Resource

 - [GET /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_resource_v1_resources_resource__resource_id__get.md): Fetches a resource

### List Resource Unavailabilities

 - [GET /v1/resources/resource/{resource_id}/unavailability](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_resource_unavailabilities_v1_resources_resource__resource_id__unavailability_get.md): List all unavailabilities for a resource

### Create Resource Unavailabilities

 - [POST /v1/resources/resource/{resource_id}/unavailability](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_resource_unavailabilities_v1_resources_resource__resource_id__unavailability_post.md): Create a new unavailability for a resource.

### Get Resource Unavailability

 - [GET /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_resource_unavailability_v1_resources_resource__resource_id__unavailability__id__get.md): Fetch a resource unavailability

### Update Resource Unavailabilities

 - [PUT /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_resource_unavailabilities_v1_resources_resource__resource_id__unavailability__id__put.md): Update an existing unavailability for a resource.

### Delete Resource Unavailabilities

 - [DELETE /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/delete_resource_unavailabilities_v1_resources_resource__resource_id__unavailability__id__delete.md): Delete a resource unavailability

### List Resource Validities

 - [GET /v1/resources/resource/{resource_id}/validity](https://api-docs.qargo.com/openapi/use-case-master-data-sync/list_resource_validities_v1_resources_resource__resource_id__validity_get.md): List all validities for a resource

### Create Resource Validity Request

 - [POST /v1/resources/resource/{resource_id}/validity](https://api-docs.qargo.com/openapi/use-case-master-data-sync/create_resource_validity_request_v1_resources_resource__resource_id__validity_post.md): Create a new validity request for a resource.

### Get Resource Validity

 - [GET /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_resource_validity_v1_resources_resource__resource_id__validity__id__get.md): Fetches a specific validity for a resource

### Update Resource Validity

 - [PUT /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/update_resource_validity_v1_resources_resource__resource_id__validity__id__put.md): Update an existing validity for a resource.

### Delete Resource Validity

 - [DELETE /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/use-case-master-data-sync/delete_resource_validity_v1_resources_resource__resource_id__validity__id__delete.md): Delete a resource validity

### Get Resource Validity Documents

 - [GET /v1/resources/resource/{resource_id}/validity/{id}/documents](https://api-docs.qargo.com/openapi/use-case-master-data-sync/get_resource_validity_documents_v1_resources_resource__resource_id__validity__id__documents_get.md): Fetch all documents associated with a specific resource validity.

### Create Resource

 - [POST /v1/resources/resource](https://api-docs.qargo.com/openapi/api-resource/create_resource_v1_resources_resource_post.md): Create a new resource.

### List Resources

 - [GET /v1/resources/resource](https://api-docs.qargo.com/openapi/api-resource/list_resources_v1_resources_resource_get.md): List all resources

### Update Resource

 - [PUT /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/api-resource/update_resource_v1_resources_resource__resource_id__put.md): Update an existing resource.

### Patch Resource

 - [PATCH /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/api-resource/patch_resource_v1_resources_resource__resource_id__patch.md): Partially update an existing resource.

### Archive Resource

 - [DELETE /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/api-resource/archive_resource_v1_resources_resource__resource_id__delete.md): Archive a resource

### Get Resource

 - [GET /v1/resources/resource/{resource_id}](https://api-docs.qargo.com/openapi/api-resource/get_resource_v1_resources_resource__resource_id__get.md): Fetches a resource

### List Resource Unavailabilities

 - [GET /v1/resources/resource/{resource_id}/unavailability](https://api-docs.qargo.com/openapi/api-resource/list_resource_unavailabilities_v1_resources_resource__resource_id__unavailability_get.md): List all unavailabilities for a resource

### Create Resource Unavailabilities

 - [POST /v1/resources/resource/{resource_id}/unavailability](https://api-docs.qargo.com/openapi/api-resource/create_resource_unavailabilities_v1_resources_resource__resource_id__unavailability_post.md): Create a new unavailability for a resource.

### Get Resource Unavailability

 - [GET /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/api-resource/get_resource_unavailability_v1_resources_resource__resource_id__unavailability__id__get.md): Fetch a resource unavailability

### Update Resource Unavailabilities

 - [PUT /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/api-resource/update_resource_unavailabilities_v1_resources_resource__resource_id__unavailability__id__put.md): Update an existing unavailability for a resource.

### Delete Resource Unavailabilities

 - [DELETE /v1/resources/resource/{resource_id}/unavailability/{id}](https://api-docs.qargo.com/openapi/api-resource/delete_resource_unavailabilities_v1_resources_resource__resource_id__unavailability__id__delete.md): Delete a resource unavailability

### List Resource Validities

 - [GET /v1/resources/resource/{resource_id}/validity](https://api-docs.qargo.com/openapi/api-resource/list_resource_validities_v1_resources_resource__resource_id__validity_get.md): List all validities for a resource

### Create Resource Validity Request

 - [POST /v1/resources/resource/{resource_id}/validity](https://api-docs.qargo.com/openapi/api-resource/create_resource_validity_request_v1_resources_resource__resource_id__validity_post.md): Create a new validity request for a resource.

### Get Resource Validity

 - [GET /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-resource/get_resource_validity_v1_resources_resource__resource_id__validity__id__get.md): Fetches a specific validity for a resource

### Update Resource Validity

 - [PUT /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-resource/update_resource_validity_v1_resources_resource__resource_id__validity__id__put.md): Update an existing validity for a resource.

### Delete Resource Validity

 - [DELETE /v1/resources/resource/{resource_id}/validity/{id}](https://api-docs.qargo.com/openapi/api-resource/delete_resource_validity_v1_resources_resource__resource_id__validity__id__delete.md): Delete a resource validity

### Get Resource Validity Documents

 - [GET /v1/resources/resource/{resource_id}/validity/{id}/documents](https://api-docs.qargo.com/openapi/api-resource/get_resource_validity_documents_v1_resources_resource__resource_id__validity__id__documents_get.md): Fetch all documents associated with a specific resource validity.

## Use case / Tracking

### Tracking Update

 - [POST /v1/webhook/tracking-update](https://api-docs.qargo.com/openapi/use-case-tracking/tracking-update.md): Webhook for tracking updates.

Push to the endpoint to update tracking information for a resource.

### Tracking Update

 - [POST /v1/webhook/tracking-update](https://api-docs.qargo.com/openapi/webhooks-inbound/tracking-update.md): Webhook for tracking updates.

Push to the endpoint to update tracking information for a resource.

## API / Authentication

### Generate Token

 - [POST /v1/auth/token](https://api-docs.qargo.com/openapi/api-authentication/generate_token_v1_auth_token_post.md)

## API / Task

### List Available Tasks

 - [GET /v1/tasks/available-tasks](https://api-docs.qargo.com/openapi/api-task/list_available_tasks_v1_tasks_available_tasks_get.md)

### Get Task Detail

 - [GET /v1/tasks/task/{id}](https://api-docs.qargo.com/openapi/api-task/get_task_detail_v1_tasks_task__id__get.md)

### Update Task Status

 - [POST /v1/tasks/task/{id}/update-status](https://api-docs.qargo.com/openapi/api-task/update_task_status_v1_tasks_task__id__update_status_post.md)

## API / Trip

### Get Trip By Id

 - [GET /v1/trips/trip/{trip_id}](https://api-docs.qargo.com/openapi/api-trip/get_trip_by_id_v1_trips_trip__trip_id__get.md): Get trip

### Get Trip Costs

 - [GET /v1/trips/trip/{trip_id}/costs](https://api-docs.qargo.com/openapi/api-trip/get_trip_costs_v1_trips_trip__trip_id__costs_get.md): Get the cost charges associated with this trip

### Get Trip Documents

 - [GET /v1/trips/trip/{trip_id}/documents](https://api-docs.qargo.com/openapi/api-trip/get_trip_documents_v1_trips_trip__trip_id__documents_get.md): Fetch trip documents. This includes order and consignment documents

## System

### Who Am I

 - [GET /me](https://api-docs.qargo.com/openapi/system/who_am_i_me_get.md): Returns the active tenant ID, email, and allowed roles for the authenticated user.

