> For the complete documentation index, see [llms.txt](https://developers.zortout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.zortout.com/api-reference/shipment.md).

# Shipment

## Get Shipment Transactions

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Shipment/GetShipmentTransactions`

Get list of shipment transactions.

#### Query Parameters

| Name          | Type   | Description                                      |
| ------------- | ------ | ------------------------------------------------ |
| updatedafter  | String | <p>Updated Date After .....<br>(yyyy-MM-dd)</p>  |
| updatedbefore | String | <p>Updated Date Before .....<br>(yyyy-MM-dd)</p> |
| createdafter  | String | <p>Created Date After .....<br>(yyyy-MM-dd)</p>  |
| createdbefore | String | <p>Created Date Before .....<br>(yyyy-MM-dd)</p> |
| limit         | Int    | Limit per page (Max = 500)                       |
| page          | Int    | Page (Default = 1)                               |

#### Headers

| Name                                        | Type   | Description                                        |
| ------------------------------------------- | ------ | -------------------------------------------------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name                                         |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                            |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                                         |
| trackingNoList                              | String | <p>List Of Tracking No <br>Ex. “SP0001,SP0002”</p> |

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

| Parameter | Type                        | Description/Example                         |
| --------- | --------------------------- | ------------------------------------------- |
| res       | Response                    | <p>Response Code <br>200- Success</p>       |
| list      | ShipmentTransaction (Array) | Shipment Transaction List (Array)           |
| count     | Int                         | Total shipment transaction number by filter |

| ShipmentTransaction  (Array) | Type     | Description/Example                                                                |
| ---------------------------- | -------- | ---------------------------------------------------------------------------------- |
| id                           | Int      | Shipment ID                                                                        |
| carrierName                  | String   | Shipment Provider Name                                                             |
| shipmentNumber               | String   | Shipment Number                                                                    |
| trackingNumber               | String   | Tracking No                                                                        |
| trackingLink                 | String   | Tracking No Url                                                                    |
| reference                    | String   | Reference                                                                          |
| reference2                   | String   | Reference 2                                                                        |
| customerName                 | String   | Contact Name                                                                       |
| customerPhone                | String   | Contact Phone                                                                      |
| customerAddress              | String   | Contact Address                                                                    |
| customerPostcode             | String   | Contact Postcode                                                                   |
| customerProvince             | String   | Contact Province                                                                   |
| customerDistrict             | String   | Contact District                                                                   |
| customerSubDistrict          | String   | Contact Subdistrict                                                                |
| customerStreetAddress        | String   | Contact Street Address                                                             |
| status                       | String   | <p>Status (Pending, Waiting,</p><p>Shipping, Success, Voided, Failed Shipment)</p> |
| isCOD                        | Boolean  | COD Status                                                                         |
| codAmount                    | Double   | COD Amount                                                                         |
| shippingCost                 | Double   | Shipping Fee                                                                       |
| createdatetime               | Datetime | Created Datetime                                                                   |
| createdatetimeString         | String   | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                |
| updatedatetime               | Datetime | Updated Datetime                                                                   |
| updatedatetimeString         | String   | <p>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                |
| createUserid                 | Int      | Created User ID                                                                    |
| createUsername               | String   | Created User (Username)                                                            |
| createdBy                    | String   | Created User (Display name)                                                        |
| {% endtab %}                 |          |                                                                                    |
| {% endtabs %}                |          |                                                                                    |

## Get Shipment Transaction Detail

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Shipment/GetShipmentTransactionDetail`

Get shipment transaction detail.

#### Query Parameters

| Name                                        | Type   | Description    |
| ------------------------------------------- | ------ | -------------- |
| id                                          | Int    | <p>Shipment ID |
| <br>\*Must have either id or trackingNo</p> |        |                |
| trackingNo                                  | String | Tracking no    |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

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

| ShipmentTransaction   | Type     | Description/Example                                                                |
| --------------------- | -------- | ---------------------------------------------------------------------------------- |
| id                    | Int      | Shipment ID                                                                        |
| carrierName           | String   | Shipment Provider Name                                                             |
| shipmentNumber        | String   | Shipment Number                                                                    |
| trackingNumber        | String   | Tracking No                                                                        |
| trackingLink          | String   | Tracking No Url                                                                    |
| reference             | String   | Reference                                                                          |
| reference2            | String   | Reference 2                                                                        |
| customerName          | String   | Contact Email                                                                      |
| customerPhone         | String   | Contact Phone                                                                      |
| customerAddress       | String   | Contact Address                                                                    |
| customerPostcode      | String   | Contact Postal Code                                                                |
| customerProvince      | String   | Contact Province                                                                   |
| customerDistrict      | String   | Contact District                                                                   |
| customerSubDistrict   | String   | Contact Subdistrict                                                                |
| customerStreetAddress | String   | Contact Street Address                                                             |
| status                | String   | <p>Status (Pending, Waiting,</p><p>Shipping, Success, Voided, Failed Shipment)</p> |
| isCOD                 | Boolean  | COD Status                                                                         |
| codAmount             | Double   | COD Amount                                                                         |
| shippingCost          | Double   | Shipping Fee                                                                       |
| createdatetime        | Datetime | Created Datetime                                                                   |
| createdatetimeString  | String   | <p>Created Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                |
| updatedatetime        | Datetime | Updated Datetime                                                                   |
| updatedatetimeString  | String   | <p>Updated Datetime Text <br>(yyyy-MM-dd HH:mm)</p>                                |
| createUserid          | Int      | Created User ID                                                                    |
| createUsername        | String   | Created User (Username)                                                            |
| createdBy             | String   | Created User (Display name)                                                        |
| {% endtab %}          |          |                                                                                    |
| {% endtabs %}         |          |                                                                                    |

## Get Shipment Labels

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Shipment/GetShipmentLabels`

Get shipment label list of shipment transactions.

#### Headers

| Name                                        | Type   | Description                                      |
| ------------------------------------------- | ------ | ------------------------------------------------ |
| storename<mark style="color:red;">\*</mark> | String | Store Name                                       |
| apikey<mark style="color:red;">\*</mark>    | String | API Key                                          |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret                                       |
| idList                                      | String | <p>List Of Shipment ID <br>Ex. “123,124,125”</p> |

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

| ShipmentLabel (Array) | Type        | Description/Example                                                        |
| --------------------- | ----------- | -------------------------------------------------------------------------- |
| linkurl               | String      | Url of Shipment Label                                                      |
| type                  | String      | <p>Type of Shipment Label.<br>Ex. "flashexpress, kerry, shopeeexpress"</p> |
| Format                | String      | Pdf, Html, Url                                                             |
| Data                  | String      | Shipment Label Data (Follow on Format)                                     |
| list                  | Int (Array) | List Of Shipment ID                                                        |
| {% endtab %}          |             |                                                                            |
| {% endtabs %}         |             |                                                                            |

## Add Shipment

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Shipment/AddShipment`

Call shipment provider. The available shipment is "thailandpost" (Thailand Post), “flashexpress” (Flash Express), “shopeeexpress” (Shopee Express), "dhl" (DHL) and “kex” (KEX).

#### Query Parameters

| Name                                       | Type    | Description                                                                                                                                                                                                                                                      |
| ------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| shipment<mark style="color:red;">\*</mark> | String  | <p>Shipment provider.                                                                                                                                                                                                                                            |
| <br>thailandpost - Thailand Post           |         |                                                                                                                                                                                                                                                                  |
| <br>flashexpress – Flash Express           |         |                                                                                                                                                                                                                                                                  |
| <br>kex – KEX                              |         |                                                                                                                                                                                                                                                                  |
| <br>shopeeexpress – Shopee Express         |         |                                                                                                                                                                                                                                                                  |
| <br>dhl - DHL</p>                          |         |                                                                                                                                                                                                                                                                  |
| useShippingPoint                           | Boolean | <p>Define this shipment uses shipping point.<br>True : Shipping Point<br>False : Direct Payment (Default when shipment is valid.)</p><p><br><strong>Remark:</strong> Shipping Point is supported only Thailand Post, Flash Express, Shopee Exporess and DHL.</p> |
| isPickup                                   | Boolean | <p>Define this shipment is pickup.<br>True : Pickup (Default when Shipping Point of shipment is valid.)<br>False : Drop off</p>                                                                                                                                  |
| reference                                  | String  | Reference                                                                                                                                                                                                                                                        |
| reference2                                 | String  | Reference 2                                                                                                                                                                                                                                                      |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name              | Type                    | Description                                                              |
| ----------------- | ----------------------- | ------------------------------------------------------------------------ |
| senderName        | String                  | Sender Name                                                              |
| senderPhone       | String                  | Sender Phone                                                             |
| senderEmail       | String                  | Sender Email                                                             |
| senderAddress     | String                  | Sender Address                                                           |
| senderDistrict    | String                  | Sender District                                                          |
| senderCity        | String                  | Sender City                                                              |
| senderProvince    | String                  | Sender Province                                                          |
| senderPostcode    | String                  | Sender Postcode                                                          |
| recipientName     | String                  | Recipient Name                                                           |
| recipientPhone    | String                  | Recipient Phone                                                          |
| recipientEmail    | String                  | Recipient Email                                                          |
| recipientAddress  | String                  | Recipient Address                                                        |
| recipientDistrict | String                  | Recipient District                                                       |
| recipientCity     | String                  | Recipient City                                                           |
| recipientProvince | String                  | Recipient Province                                                       |
| recipientPostcode | String                  | Recipient Postcode                                                       |
| codAmount         | Double                  | <p>COD Amount <br>(Assign this value = 0, if this order is not COD.)</p> |
| parcelWeight      | Decimal (Not Required)  | Parcel Weight (Gram)                                                     |
| parcelWidth       | Decimall (Not Required) | Parcel Width (cm)                                                        |
| parcelLength      | Decimall (Not Required) | Parcel Length (cm)                                                       |
| parcelHeight      | Decimall (Not Required) | Parcel Height (cm)                                                       |

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

| Parameter | Type   | Description/Example                   |
| --------- | ------ | ------------------------------------- |
| resCode   | String | <p>Response Code <br>200- Success</p> |
| resDesc   | String | Response Description                  |
| detail    | Detail | Response detail                       |

| Parameter (Detail) | Type   | Description/Example |
| ------------------ | ------ | ------------------- |
| id                 | Int    | Shipment ID         |
| trackingno         | String | Tracking No         |
| link               | String | Shipping Label Link |
| {% endtab %}       |        |                     |
| {% endtabs %}      |        |                     |

## Check Shipment Price

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Shipment/CheckShipmentPrice`

Check shipment price. The available shipment is "thailandpost" (Thailand Post), “flashexpress” (Flash Express), “shopeeexpress” (Shopee Express), "dhl" (DHL) and “kex” (KEX). Support with shipping-point using.

#### Query Parameters

| Name                                       | Type   | Description           |
| ------------------------------------------ | ------ | --------------------- |
| shipment<mark style="color:red;">\*</mark> | String | <p>Shipment provider. |
| <br>thailandpost - Thailand Post           |        |                       |
| <br>flashexpress – Flash Express           |        |                       |
| <br>kex – KEX                              |        |                       |
| <br>shopeeexpress – Shopee Express         |        |                       |
| <br>dhl - DHL</p>                          |        |                       |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name              | Type                    | Description                                                              |
| ----------------- | ----------------------- | ------------------------------------------------------------------------ |
| senderName        | String                  | Sender Name                                                              |
| senderPhone       | String                  | Sender Phone                                                             |
| senderEmail       | String                  | Sender Email                                                             |
| senderAddress     | String                  | Sender Address                                                           |
| senderDistrict    | String                  | Sender District                                                          |
| senderCity        | String                  | Sender City                                                              |
| senderProvince    | String                  | Sender Province                                                          |
| senderPostcode    | String                  | Sender Postcode                                                          |
| recipientName     | String                  | Recipient Name                                                           |
| recipientPhone    | String                  | Recipient Phone                                                          |
| recipientEmail    | String                  | Recipient Email                                                          |
| recipientAddress  | String                  | Recipient Address                                                        |
| recipientDistrict | String                  | Recipient District                                                       |
| recipientCity     | String                  | Recipient City                                                           |
| recipientProvince | String                  | Recipient Province                                                       |
| recipientPostcode | String                  | Recipient Postcode                                                       |
| codAmount         | Double                  | <p>COD Amount <br>(Assign this value = 0, if this order is not COD.)</p> |
| parcelWeight      | Decimal (Not Required)  | Parcel Weight (Gram)                                                     |
| parcelWidth       | Decimall (Not Required) | Parcel Width (cm)                                                        |
| parcelLength      | Decimall (Not Required) | Parcel Length (cm)                                                       |
| parcelHeight      | Decimall (Not Required) | Parcel Height (cm)                                                       |

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

| ShipmentPrice (Array) | Type   | Description/Example |
| --------------------- | ------ | ------------------- |
| shipment              | String | Shipment Provider   |
| totalPrice            | Double | Shipment Price      |
| {% endtab %}          |        |                     |
| {% endtabs %}         |        |                     |
