Criar remessa
Para criar remessas você deve utilizar o método POST na rota /v1/shipments e enviar os paramêtros documentos a baixo no corpo da requisição.
Endpoint: /v1/shipments
Metodo: POST
http
POST /v1/shipments HTTP/1.1
Host: sandbox.tristarexpress.com
Content-Type: application/json
Accept: application/json
Authorization: {{ token }}
{ json }
Paramêtros do JSON
| Property | Required | Type | Description |
|---|---|---|---|
| integration_code | N | String | Your system ID |
| from_person_type | Y | Integer | Sender person type, 1 for Personal, 2 for Company |
| 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 | Y | 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 | String | 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, UF 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 Personal, 2 for Company |
| 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 | Y | Integer | Destination address line 2 |
| to_address_number | Y | String | Destination address number |
| to_address_complement | N | String | Destination address number complement |
| to_city | Y | String | Destination city name |
| to_country_id | Y | Integer | Destination country ID, use BR = 32, CH = 46, PT = 179, US = 236 |
| to_country_code | Y | Integer | Destination country Code (US or USA), (BR or BRA), (PT or PRT) ISO3166 |
| to_state_id | Y | Integer | Destination State ID, See States API |
| to_state_code | Y | String | Destination State Code, UF Code |
| 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) |
| width | Y | Integer | Package width in centimeters |
| height | Y | Integer | Package height in centimeters |
| length | Y | Integer | Package lenght in centimeters |
| weight | Y | Decimal (6.3) | Package weight in Kilograms (use dot . as decimal separator) |
| freight | Y | Decimal(12.2) | Total freight paid, (use dot . as decimal separator) |
| total_insurance | Y | 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 |
| anvisa_import_authorization_number | N | String | Númedo da autorização de importação Anvisa (MEDICINE, CBD) |
| anvisa_product_commercial_name | N | String | Nome comerial do produto autorizado pela Anvisa (MEDICINE, CBD) |
| total | Y | Decimal(12.2) | Total total declared value, (use dot . as decimal separator) |
| items | Y | Complex | 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
Códigos de países seguem o padrão ISO 3166-1 alpha-2 and alpha-3 Wiki.
NCM - Mercosur Common Nomenclature.
Tipos de documentos podem ser encontrados em Documents types
Veja as referências para os códigos, CURRENCY_ID, PERSON_TYPE, SHIPMENT_ITEM_TYPE nesta página
Exemplo completo:
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": "Nome do Remetente",
"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_code": "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,
"with_insurance":false,
"items": [
{
"shipment_item_type": 40,
"hscode": "85177099",
"description": "PELICULA DE PROTECAO",
"quantity": 1,
"unit_price": 10,
"expiration_date":"2021-01-01",
"lot":"123456",
"immune_code": null,
"total": 10,
"is_book": false,
"currency_id": 1
}
]
}
TIP
- Tipos de documentos aceitos podem ser encotrados em Tipos de Documentos
Anexar documentos a uma remessa
http
POST /v1/shipments/{identitication}/attachments HTTP/1.1
Host: sandbox.tristarexpress.com
Content-Type: application/json
Accept: application/json
{ json }
Exemplo completo enviando json com Urls:
http
POST /v1/shipments/1/attachments HTTP/1.1
Host: sandbox.tristarexpress.com
Content-Type: application/json
Accept: application/json
{
"attachments" : [
{
"url" : "https://tristarexpress.com/wp-content/uploads/2022/07/AF_logotipo_tristar_EXPRESS_NEGATIVO.png",
"document_code" : "DOCUMENT"
},
{
"url" : "https://tristarexpress.com/wp-content/uploads/2022/07/AF_logotipo_tristar_EXPRESS_NEGATIVO.png",
"file_name" : "CPF.png",
"document_code" : "DOCUMENT"
}
]
}
Exemplo completo enviando arquivos binarios:
http
POST /v1/shipments/1/attachments HTTP/1.1
Host: sandbox.tristarexpress.com
Content-Type: multipart/form-data
Accept: application/json
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="attachments[0][file]"; filename="Arquivo.png"
Content-Type: <Content-Type header here>
(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="attachments[0][document_code]"
DOCUMENT
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="attachments[1][document_code]"
DOCUMENT
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="attachments[1][file]"; filename="Arquvio2.png"
Content-Type: <Content-Type header here>
(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW--

