Skip to content
On this page

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

PropertyRequiredTypeDescription
integration_codeNStringYour system ID
from_person_typeYIntegerSender person type, 1 for Personal, 2 for Company
from_nameYStringSender complete name
from_document_typeYIntegerSender document type 1 for TAX_ID, 2 for PASSPORT
from_documentYStringSender Tax ID or Passport
from_company_nameYStringSender company name, required if from_person_type equals 2
from_trading_nameYStringSender company trading name, required if from_person_type equals 2
from_br_ieYStringSender company “Inscrição estadual”, required only if company has one
from_address_1YStringSender address line 1
from_address_2YStringSender address line 2
from_address_numberYStringSender address number
from_address_complementNStringSender address number complement
from_cityYStringSender city name
from_country_idYIntegerSender country ID, use BR = 32, CH = 46, PT = 179, US = 236
from_country_codeYStringSender country Code (US or USA), (BR or BRA), (PT or PRT) ISO3166
from_state_idYIntegerSender State ID, See States API
from_state_codeYStringSender State Code, UF Code
from_postcodeYStringSender postcode, only numbers when possible
from_emailYStringSender contact email
from_phoneYStringSender contact phone
to_person_typeYIntegerDestination person type, 1 for Personal, 2 for Company
to_nameYStringDestination complete name
to_document_typeYIntegerDestination document type 1 for TAX_ID, 2 for PASSPORT
to_documentYStringDestination Tax ID or Passport
to_company_nameYStringDestination company name, required if from_person_type equals 2
to_trading_nameYStringDestination company trading name, required if from_person_type equals 2
to_br_ieYStringDestination company “Inscrição estadual”, required only if company has one
to_address_1YStringDestination address line 1
to_address_2YIntegerDestination address line 2
to_address_numberYStringDestination address number
to_address_complementNStringDestination address number complement
to_cityYStringDestination city name
to_country_idYIntegerDestination country ID, use BR = 32, CH = 46, PT = 179, US = 236
to_country_codeYIntegerDestination country Code (US or USA), (BR or BRA), (PT or PRT) ISO3166
to_state_idYIntegerDestination State ID, See States API
to_state_codeYStringDestination State Code, UF Code
to_postcodeYStringDestination postcode, only numbers when possible
to_emailYStringDestination contact email
to_phoneYStringDestination contact phone
supervisory_organNIntegerSee Supervisory Organ List
currency_idNIntegerCurrency ID, default is USD (1)
widthYIntegerPackage width in centimeters
heightYIntegerPackage height in centimeters
lengthYIntegerPackage lenght in centimeters
weightYDecimal (6.3)Package weight in Kilograms (use dot . as decimal separator)
freightYDecimal(12.2)Total freight paid, (use dot . as decimal separator)
total_insuranceYDecimal (6.3)Total Insurance paid, (use dot . as decimal separator)
prc_iiNDecimal (6.3)PRC Total II paid, (use dot . as decimal separator)
prc_icmsNDecimal (6.3)PRC Total ICMS paid, (use dot . as decimal separator)
payment_ccNStringCredit Card Last 4 digits
payment_cc_brandNStringCredit Card Brand (Visa, Master, ...)
payment_cc_typeNStringC for Credit, D for Debit
anvisa_import_authorization_numberNStringNúmedo da autorização de importação Anvisa (MEDICINE, CBD)
anvisa_product_commercial_nameNStringNome comerial do produto autorizado pela Anvisa (MEDICINE, CBD)
totalYDecimal(12.2)Total total declared value, (use dot . as decimal separator)
itemsYComplexSee ShipmentItem Type

Shipment Item

PropertyRequiredTypeDescription
shipment_item_typeYInteger10 for Products, 20 for Books, 30 for Medicine, 40 for CBD, 90 for other immune
skuNStringProduct SKU
hscodeNStringRequired for Medicine, CDB, THC
descriptionYStringProduct description
quantityYStringQuantity
unit_priceYStringProduct unit price
expiration_dateNStringExpiration date
lotNStringLot number (for fullfillment)
immune_codeNStringRequired for shipment_item_type 90 (Other immune) get the code list with tristar staff (Same BR SISCOMEX)
currency_idNStringCurrency ID, default is USD (1)

Supervisory Organ

IdDescription
3Receita Federal do Brasil
1Anvisa
6Anvisa e Receita Federal do Brasil
2Vigiagro / MAPA
4Vigiagro / MAPA e Anvisa
5Vigiagro / MAPA e Receita Federal do Brasil
7Vigiagro / MAPA, Anvisa e Receita Federal do Brasil
8Ibama
9Ibama e Anvisa
10Ibama e Vigiagro / MAPA
11Ibama e Receita Federal do Brasil
12Ibama, Vigiagro / MAPA e Anvisa
13Ibama, Vigiagro / MAPA e Receita Federal do Brasil
14Ibama, Anvisa e Receita Federal do Brasil
15Ibama, Vigiagro / MAPA, Anvisa e Receita Federal do Brasil

TIP


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

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--