> For the complete documentation index, see [llms.txt](https://transiteo.gitbook.io/transiteo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://transiteo.gitbook.io/transiteo/duties-and-taxes-services/documents-import-services/landed-cost.md).

# Landed Cost

## Get duty and taxes calculation from an invoice pdf

#### STEP 1

<mark style="color:green;">`POST`</mark> `https://api.transiteo.io/v1/importFileService/invoicePdf/landedCost`

Get a timestamp to request the step 2

**Headers**

| Name          | Value                 |
| ------------- | --------------------- |
| Content-Type  | `application/json`    |
| Authorization | id token from cognito |

### JSON REQUEST FORMAT

```
{
  "content": "data:application/pdf;base64,JVBERi0xLjQKJfbk/N8KMSAwIG9iago8PA..."
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "timestamp": 1671483327236
}
```

{% endtab %}

{% tab title="400" %}

```json
Incorrect Json (json body request incorrect)
```

{% endtab %}

{% tab title="403" %}

```
1. Max requests exceed
{
    "code": "MAX_REQUESTS_EXCEED",
    "httpCode": 403,
    "name": "ClientError",
    "message": "You've reached the max requests authorized for your account. Please contact our service to upgrade your account",
    "details": [
        {
            "parameter": {
                "name": "UserRequests",
                "value": "${leftCredits}"
            },
            "causes": [
                "Max requests authorized for your account is ${capacity}. Left credits is ${leftCredits}"
            ]
        }
    ]
}

2. TRIAL_LIMIT_EXCEED

{
    "code": "TRIAL_LIMIT_EXCEED",
    "httpCode": 403,
    "name": "ClientError",
    "message": "You have exceeded the trial limit. Please contact our service to upgrade your account",
    "details": [
        {
            "parameter": {
                "name": "UserTrialLimit",
                "value": "${validity} days"
            },
            "causes": [
                "User trial is limited to ${validity} days of usage"
            ]
        }
    ]
}
```

{% endtab %}

{% tab title="500" %}

```
{
    "code": "UNEXPECTED_ERROR",
    "httpCode": 500,
    "reason": "Please try again or contact our service",
}
```

{% endtab %}
{% endtabs %}

#### STEP 2

<mark style="color:green;">`GET`</mark> `https://api.transiteo.io/v1/importFileService/invoicePdf/landedCost/{timestamp}`

Get Duty and Taxes caclulation result&#x20;

**Headers**

| Name          | Value                 |
| ------------- | --------------------- |
| Content-Type  | `application/json`    |
| Authorization | id token from cognito |

**Path parameters**

| Name      | Type   | Description         |
| --------- | ------ | ------------------- |
| timestamp | string | timestamp in millis |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "dutyCalculationResponse": {
        "products": [
            {
                "identification": {
                    "type": "HSCODE",
                    "value": "6109100010"
                },
                "product_statut": "Authorized for importation into this country",
                "amount_exclusive": 998,
                "amount_inclusive_vat": 998,
                "amount_duty_and_tax": 0,
                "amount_total": 998,
                "percentage_duty_and_tax": 0,
                "duty": null,
                "special_taxes": [],
                "vat": []
            },
            {
                "identification": {
                    "type": "HSCODE",
                    "value": "9507900000"
                },
                "product_statut": "Restricted for importation into this country",
                "amount_exclusive": 998,
                "amount_inclusive_vat": 998,
                "amount_duty_and_tax": 0,
                "amount_total": 998,
                "percentage_duty_and_tax": 0,
                "duty": null,
                "special_taxes": [],
                "vat": []
            },
            {
                "identification": {
                    "type": "HSCODE",
                    "value": "9506999000"
                },
                "product_statut": "Restricted for importation into this country",
                "amount_exclusive": 998,
                "amount_inclusive_vat": 998,
                "amount_duty_and_tax": 0,
                "amount_total": 998,
                "percentage_duty_and_tax": 0,
                "duty": null,
                "special_taxes": [],
                "vat": []
            },
            {
                "identification": {
                    "type": "HSCODE",
                    "value": "6302910090"
                },
                "product_statut": "Authorized for importation into this country",
                "amount_exclusive": 937.5,
                "amount_inclusive_vat": 937.5,
                "amount_duty_and_tax": 0,
                "amount_total": 937.5,
                "percentage_duty_and_tax": 0,
                "duty": null,
                "special_taxes": [],
                "vat": []
            }
        ],
        "shipping_global": {
            "vat": null,
            "duty": null,
            "special_taxes": null,
            "amount_exclusive": 0,
            "amount_inclusive_vat": 0,
            "amount_total": 0,
            "amount_duty_and_tax": 0,
            "percentage_duty_and_tax": null
        },
        "packaging_global": {
            "vat": null,
            "duty": null,
            "special_taxes": null,
            "amount_exclusive": 0,
            "amount_inclusive_vat": 0,
            "amount_total": 0,
            "amount_duty_and_tax": 0,
            "percentage_duty_and_tax": null
        },
        "insurance_global": {
            "vat": null,
            "duty": null,
            "special_taxes": null,
            "amount_exclusive": 0,
            "amount_inclusive_vat": 0,
            "amount_total": 0,
            "amount_duty_and_tax": 0,
            "percentage_duty_and_tax": null
        },
        "transit_fees_global": null,
        "global": {
            "amount": 0,
            "amount_exclusive": 3931.5,
            "amount_inclusive_vat": 3931.5,
            "amount_total": 3931.5,
            "amount_duty_and_tax": 0,
            "percentage_duty_and_tax": 0
        }
    },
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "message": "The incoming token has expired"
}
```

{% endtab %}

{% tab title="500" %}

```
{
    "code": "UNEXPECTED_ERROR",
    "httpCode": 500,
    "reason": "Please try again or contact our service",
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://transiteo.gitbook.io/transiteo/duties-and-taxes-services/documents-import-services/landed-cost.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
