Create shipment
Endpoint: /v1/shipments
Method: POST
To create shipments you must use the POST method on the endpoint /v1/shipments.
Example:
http
POST /v1/shipments HTTP/1.1
Host: sandbox.tristarexpress.com
Content-Type: application/json
Accept: application/json
Authorization: {{ token }}
{ json }
Parameters
| Property | Required | Type | Description |
|---|---|---|---|
| bag_code | N | String | MAWB bag identification |
| order_number | N | String | Invoice Number |
| integration_code | N | String | Your system ID |
| from_person_type | Y | Integer | Sender person type, 1 for Individual, 2 for Legal |
| from_name | Y | String | Sender complete name |
| from_document_type | Y | Integer | Sender document type 1 for TAX_ID, 2 for PASSPORT |
| from_document | Y | String | Sender Tax ID or Passport |
| from_company_name | Y | String | Sender company name, required if from_person_type equals 2 |
| from_trading_name | Y | String | Sender company trading name, required if from_person_type equals 2 |
| from_br_ie | Y | String | Sender company “Inscrição estadual”, required only if company has one |
| from_address_1 | Y | String | Sender address line 1 |
| from_address_2 | N | String | Sender address line 2 |
| from_address_number | Y | String | Sender address number |
| from_address_complement | N | String | Sender address number complement |
| from_city | Y | String | Sender city name |
| from_country_id | Y | Integer | Sender country ID, use BR = 32, CH = 46, PT = 179, US = 236 |
| from_country_code | Y | Integer | Sender country Code (US or USA), (BR or BRA), (PT or PRT) ISO3166 |
| from_state_id | Y | Integer | Sender State ID, See States API |
| from_state_code | Y | String | Sender State Code |
| from_postcode | Y | String | Sender postcode, only numbers when possible |
| from_email | Y | String | Sender contact email |
| from_phone | Y | String | Sender contact phone |
| to_person_type | Y | Integer | Destination person type, 1 for Individual, 2 for Legal |
| to_name | Y | String | Destination complete name |
| to_document_type | Y | Integer | Destination document type 1 for TAX_ID, 2 for PASSPORT |
| to_document | Y | String | Destination Tax ID or Passport |
| to_company_name | Y | String | Destination company name, required if from_person_type equals 2 |
| to_trading_name | Y | String | Destination company trading name, required if from_person_type equals 2 |
| to_br_ie | Y | String | Destination company “Inscrição estadual”, required only if company has one |
| to_address_1 | Y | String | Destination address line 1 |
| to_address_2 | N | Integer | Destination address line 2 |
| to_address_number | Y | String | Destination address number |
| to_address_complement | N | String | Destination address complement |
| to_city | Y | String | Destination city name |
| to_country_id | N | Integer | Destination country ID, use BR = 32, CH = 46, PT = 179, US = 236 (Required if to_country_code not present) |
| to_country_code | N | String (2) | Destination country Code, alpha 2 or 3, ISO3166 |
| to_state_id | Y | Integer | Destination State ID, See States API |
| to_state_code | N | String (2) | Destination State Code, Required if to_state_id is not present |
| to_postcode | Y | String | Destination postcode, only numbers when possible |
| to_email | Y | String | Destination contact email |
| to_phone | Y | String | Destination contact phone |
| supervisory_organ | N | Integer | See Supervisory Organ List |
| currency_id | N | Integer | Currency ID, default is USD (1) |
| package_width | Y | Integer | Package width in centimeters |
| package_height | Y | Integer | Package height in centimeters |
| package_length | Y | Integer | Package lenght in centimeters |
| package_weight | Y | Decimal (6.3) | Package weight in Kilograms (use dot . as decimal separator) |
| anvisa_import_authorization_number | N | String | Anvisa Import Authorization Number |
| anvisa_product_commercial_name | N | String | Anvisa Product Commercial Name Authorizated |
| total_insurance | N | Decimal (6.3) | Total Insurance paid, (use dot . as decimal separator) |
| prc_ii | N | Decimal (6.3) | PRC Total II paid, (use dot . as decimal separator) |
| prc_icms | N | Decimal (6.3) | PRC Total ICMS paid, (use dot . as decimal separator) |
| payment_cc | N | String | Credit Card Last 4 digits |
| payment_cc_brand | N | String | Credit Card Brand (Visa, Master, ...) |
| payment_cc_type | N | String | C for Credit, D for Debit |
| total | Y | Decimal (12.2) | Total declared value, (use dot . as decimal separator) |
| total_freight | Y | Decimal (12.2) | Total charged and declared value, (use dot . as decimal separator) |
| total_tax | Y | Decimal (12.2) | Total declared value, (use dot . as decimal separator) |
| with_insurance | Y | Boolean | If you want to add insurance |
| items | Y | Array | See ShipmentItem Type |
Shipment Item
| Property | Required | Type | Description |
|---|---|---|---|
| shipment_item_type | Y | Integer | 10 for Products, 20 for Books, 30 for Medicine, 40 for CBD, 90 for other immune |
| sku | N | String | Product SKU |
| hscode | N | String | Required for Medicine, CDB, THC |
| description | Y | String | Product description |
| quantity | Y | String | Quantity |
| unit_price | Y | String | Product unit price |
| expiration_date | N | String | Expiration date |
| lot | N | String | Lot number (for fullfillment) |
| immune_code | N | String | Required for shipment_item_type 90 (Other immune) get the code list with tristar staff (Same BR SISCOMEX) |
| currency_id | N | String | Currency ID, default is USD (1) |
Supervisory Organ
| Id | Description |
|---|---|
| 3 | Receita Federal do Brasil |
| 1 | Anvisa |
| 6 | Anvisa e Receita Federal do Brasil |
| 2 | Vigiagro / MAPA |
| 4 | Vigiagro / MAPA e Anvisa |
| 5 | Vigiagro / MAPA e Receita Federal do Brasil |
| 7 | Vigiagro / MAPA, Anvisa e Receita Federal do Brasil |
| 8 | Ibama |
| 9 | Ibama e Anvisa |
| 10 | Ibama e Vigiagro / MAPA |
| 11 | Ibama e Receita Federal do Brasil |
| 12 | Ibama, Vigiagro / MAPA e Anvisa |
| 13 | Ibama, Vigiagro / MAPA e Receita Federal do Brasil |
| 14 | Ibama, Anvisa e Receita Federal do Brasil |
| 15 | Ibama, Vigiagro / MAPA, Anvisa e Receita Federal do Brasil |
TIP
Country code follow ISO 3166-1 alpha-2 and alpha-3 Wiki.
NCM - Mercosul Common Nomenclature.
Documents types can be found at Documents types
See references for codes, CURRENCY_ID, PERSON_TYPE, SHIPMENT_ITEM_TYPE in Types page
Complete example:
http
POST /v1/shipments/1/attachments HTTP/1.1
Host: sandbox.tristarexpress.com
Content-Type: application/json
Accept: application/json
Authorization: {{ token }}
{
"integration_code": "1",
"order_number": "1",
"from_person_type" : 1,
"from_name": "Sender name",
"from_document_type": 1,
"from_country_code" : "US",
"from_postcode" : "33013",
"from_state_code" : "FL",
"from_address_1" : "Av. Test",
"from_address_2" : "",
"from_city" : "Miami",
"to_person_type": 1,
"to_name": "Jane Doe",
"to_document_type": 1,
"to_document": "07173967970",
"to_company_name": null,
"to_trading_name": null,
"to_br_ie": null,
"to_address_1": "Avenida Presidente Kennedy",
"to_address_2": "",
"to_address_number": "759",
"to_city": "São Paulo",
"to_country_id": "BR",
"to_state_code": "SP",
"to_postcode": "13334170",
"to_email": "janedoe@tristarexpress.com",
"to_phone": "+5511999999999",
"package_width": 12,
"package_height": 14,
"package_length": 13,
"package_weight": 1.100,
"freight": 0.01,
"insurance": 10,
"total": 100,
"anvisa_import_authorization_number":null,
"anvisa_product_commercial_name":null,
"prc_darf": 1,
"prc_gnre": 1,
"other_services": 1,
"with_insurance":false,
"items": [
{
"shipment_item_type": 10,
"hscode": "85177099",
"description": "PROTECTION FILM",
"quantity": 1,
"unit_price": 10,
"expiration_date":"2021-01-01",
"lot":"123456",
"immune_code": null,
"total": 10,
"is_book": false,
"currency_id": 1
}
]
}

