Criar remessa
Para criar remessas você deve utilizar o método POST no endpoint /v1/shipments.
Exemplo:
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 |
|---|---|---|---|
| shipments | Y | Array | Lista de remessas |
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": "SP",
"to_country_id": 32,
"to_state_id": 20,
"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
}
]
}
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--

