APIs REST

API documentation

View endpoint documentation for quotation, shipping services, and shipment CRUD. Production APIs use a personal token from Profile Settings. A separate UAT host is available for integration testing. Tracking API access requires a short registration form and has no UAT environment.

URL base da API

Production base URL: https://app.thainexus.co.th/functions

Acrescente o nome da função a esta URL. Exemplos:

  • POSThttps://app.thainexus.co.th/functions/apiQuote
  • POSThttps://app.thainexus.co.th/functions/shipmentCrud
  • POSThttps://app.thainexus.co.th/functions/apiShippingServices

Interactive live tests live in the client app. Get your production token from Profile Settings.

Ambiente de UAT (teste)

Use the UAT host to build and verify integrations before switching to production. Request and response shapes match production for quotation, shipping services, and shipment CRUD. Tracking events and the Tracking API are production-only; there is no UAT for tracking.

UAT base URL: https://uat-dev.thainexus.co.th/functions

Same function paths as production (apiQuote, apiShippingServices, shipmentCrud). Example:

  • POSThttps://uat-dev.thainexus.co.th/functions/apiQuote
  • POSThttps://uat-dev.thainexus.co.th/functions/shipmentCrud
  • POSThttps://uat-dev.thainexus.co.th/functions/apiShippingServices

Como obter uma chave de API do UAT

  1. 01

    Request a UAT API key

    UAT keys are not self-serve. Email contact@thainexus.co.th (or contact your Thai Nexus account manager) and ask for a UAT API key. Keys use the format uat_tnx_... and only work on the UAT host.

  2. 02

    Call the UAT base URL

    Send the same paths as production, but against https://uat-dev.thainexus.co.th/functions. Do not use a production tnx_... token on UAT, and do not use a uat_tnx_... token on production.

  3. 03

    Authenticate UAT requests

    Send Authorization: Bearer uat_tnx_... or include api_token in the JSON body. shipmentCrud always expects api_token in the body.

Exemplo de solicitação de orçamento para UAT

curl -X POST https://uat-dev.thainexus.co.th/functions/apiQuote \
  -H "Content-Type: application/json" \
  -d '{
    "api_token": "uat_tnx_XXXXXXXX_XXXXXXXX_XXXXXXXX",
    "country": "US",
    "actual_weight_kg": 2.5,
    "length_cm": 30,
    "width_cm": 20,
    "height_cm": 15,
    "is_document": false
  }'
  • Supported on UAT: apiQuote, apiShippingServices, and shipmentCrud.
  • shipmentCrud on UAT is a sandbox. Creates, updates, and deletes stay on UAT and do not write to production shipments.
  • There is no UAT for tracking events or the Tracking API. Use public tracking or request production Tracking API access below.
  • When your integration is ready, switch the base URL to production and use your Profile Settings tnx_... token.

Need a key? Email contact@thainexus.co.th with subject "UAT API key request".

Autenticação

Steps below are for production (tnx_...). For UAT keys, see UAT (test) environment.

  1. 01

    Create a free client account

    Register at https://app.thainexus.co.th/register, verify your email, and sign in.

  2. 02

    Generate an API token

    Open Profile Settings in the client app and generate a token (format tnx_...). Keep it secret. Store integrations (WooCommerce, Shopify, BigCommerce) use the same token.

  3. 03

    Authenticate requests

    Send Authorization: Bearer tnx_... or include api_token in the JSON body. All shipmentCrud endpoints pass api_token in the request body.

Desfechos

Quotation API

POST /apiQuote

Full endpoint: https://app.thainexus.co.th/functions/apiQuote

Returns shipping quotes from all active couriers for a given package. Rates come from our live pricing engine. Destination TH and THAILAND are accepted. Unlike the public shipping calculator, this API does not suppress domestic Thailand quotes.

Auth: Pass api_token in the request body (from Profile Settings)

Campos da solicitação

CampoDescrição
api_tokenstring - Your API token
countrystring - ISO code (US, GB, TH, JP) or full name (UNITED STATES, THAILAND). TH is not suppressed.
actual_weight_kgnumber - Actual weight in kg
length_cmnumber - Package length in cm
width_cmnumber - Package width in cm
height_cmnumber - Package height in cm
is_documentboolean - Optional (default false). If true, returns only document-type quotes. If false, excludes document quotes.

Exemplo de solicitação

{
  "api_token": "tnx_XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX",
  "country": "US",
  "actual_weight_kg": 2.5,
  "length_cm": 30,
  "width_cm": 20,
  "height_cm": 15,
  "is_document": false
}

cURL example

curl -X POST https://app.thainexus.co.th/functions/apiQuote \
  -H "Content-Type: application/json" \
  -d '{
    "api_token": "tnx_XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX",
    "country": "US",
    "actual_weight_kg": 2.5,
    "length_cm": 30,
    "width_cm": 20,
    "height_cm": 15,
    "is_document": false
  }'

Exemplo de resposta

{
  "success": true,
  "country": "US",
  "package": {
    "actual_weight_kg": 2.5,
    "length_cm": 30,
    "width_cm": 20,
    "height_cm": 15
  },
  "quotes_count": 3,
  "quotes": [
    {
      "courier_name": "flex_dap",
      "display_name": "Flex DAP",
      "delivery_type": "pickup",
      "estimated_days": "5-10",
      "final_price_thb": 1250,
      "currency": "THB",
      "chargeable_weight_kg": 2.5,
      "weight_used": "actual",
      "volumetric_weight_kg": 1.8,
      "is_oversize": false
    }
  ]
}

Response fields

CampoDescrição
courier_nameInternal courier ID
display_nameHuman-readable name
final_price_thbTotal price in THB
estimated_daysDelivery estimate (e.g. "5-10")
chargeable_weight_kgWeight used for pricing
weight_used"actual" or "volumetric"
  • Unlike the public calculator, domestic Thailand quotes are not suppressed.
  • Live testing is available in the client app under Integrations / API documentation.
  • For pre-production testing, call the same path on https://uat-dev.thainexus.co.th/functions with a uat_tnx_... key (contact us for a UAT key).

Service List API

POST /apiShippingServices

Full endpoint: https://app.thainexus.co.th/functions/apiShippingServices

Returns all active shipping services with their name, logo, and ID. Uses the same personal API token from Profile Settings (the tnx_... token) as apiQuote and other client APIs.

Auth: Bearer token recommended, or api_token in the request body

Campos da solicitação

CampoDescrição
api_tokenOptional if Authorization: Bearer tnx_... is set. No other body fields required.

Exemplo de solicitação

{
  "api_token": "tnx_xxxxxxxxxxxxxxxxxxxx"
}

cURL example

curl --location 'https://app.thainexus.co.th/functions/apiShippingServices' \
  --header 'Authorization: Bearer tnx_xxxxxxxxxxxxxxxxxxxx'

fetch example

const response = await fetch(
  "https://app.thainexus.co.th/functions/apiShippingServices",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer tnx_xxxxxxxxxxxxxxxxxxxx"
    }
  }
);
const data = await response.json();

Exemplo de resposta

{
  "success": true,
  "cached": false,
  "cache_expires_at": "2026-06-12T10:00:00.000Z",
  "total": 10,
  "data": [
    {
      "id": "swift_dap",
      "service_name": "Thai Nexus Express Swift DAP",
      "logo": "https://..."
    }
  ]
}

Response fields

CampoDescrição
idstring - Unique service identifier (e.g. swift_dap)
service_namestring - Full display name
logostring | null - URL to the service logo image
cachedboolean - Whether this response was reused
cache_expires_atISO datetime - When this response expires
  • Use service IDs when creating shipments from your store integration.
  • UAT: same path on https://uat-dev.thainexus.co.th/functions with a uat_tnx_... key.

Shipment CRUD API

POST /shipmentCrud

Full endpoint: https://app.thainexus.co.th/functions/shipmentCrud

All endpoints use the shipmentCrud backend function. Pass the action field to select the operation. Soft-delete is used - records remain in the database for audit but are excluded from standard queries.

Auth: Pass your api_token in the request body (get it from Profile Settings)

Campos da solicitação

CampoDescrição
api_tokenYour personal API token
actioncreate | update | get | list | delete | restore
request_numberRequired for get / update / delete / restore
dataObject with shipment fields (create / update)
page / limit / statusOptional list filters
reasonOptional delete reason

Exemplo de solicitação

{
  "api_token": "tnx_YOUR_TOKEN",
  "action": "create",
  "data": {
    "shipper_address": {
      "name": "John Doe",
      "phone": "+66812345678",
      "address_line1": "123 Sukhumvit",
      "city": "Bangkok",
      "country": "TH"
    },
    "consignee_address": {
      "name": "Jane Smith",
      "phone": "+12025551234",
      "address_line1": "456 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    },
    "actual_weight_kg": 2.5,
    "length_cm": 30,
    "width_cm": 20,
    "height_cm": 15,
    "shipment_type": "parcel",
    "shipment_description": "Electronics"
  }
}

Actions

Create shipment
action: create

Create a new shipment request with origin/destination/dimensions. Volumetric weight is auto-calculated from dimensions. Status defaults to pending.

Carga útil da solicitação
{
  "api_token": "tnx_YOUR_TOKEN",
  "action": "create",
  "data": {
    "shipper_address": {
      "name": "John Doe",
      "phone": "+66812345678",
      "address_line1": "123 Sukhumvit",
      "city": "Bangkok",
      "country": "TH"
    },
    "consignee_address": {
      "name": "Jane Smith",
      "phone": "+12025551234",
      "address_line1": "456 Main St",
      "city": "New York",
      "state": "NY",
      "postal_code": "10001",
      "country": "US"
    },
    "actual_weight_kg": 2.5,
    "length_cm": 30,
    "width_cm": 20,
    "height_cm": 15,
    "shipment_type": "parcel",
    "shipment_description": "Electronics"
  }
}
Response
{
  "success": true,
  "action": "create",
  "data": {
    "id": "abc123",
    "request_number": "SR-X9K2F7",
    "status": "pending",
    "volumetric_weight_kg": 1.8,
    "submitted_date": "2026-04-24T10:00:00Z"
  }
}
Update shipment
action: update

Update a shipment's details. Blocked for shipped/completed shipments. Updates are blocked when status is: in_transit, delivered, confiscated, returned, lost. Staff can bypass this restriction.

Carga útil da solicitação
{
  "api_token": "tnx_YOUR_TOKEN",
  "action": "update",
  "request_number": "SR-X9K2F7",
  "data": {
    "actual_weight_kg": 3.0,
    "shipment_description": "Updated description"
  }
}
Response
{
  "success": true,
  "action": "update",
  "data": {
    "id": "abc123",
    "request_number": "SR-X9K2F7",
    "updated_fields": ["actual_weight_kg", "shipment_description", "volumetric_weight_kg"]
  }
}
Get shipment
action: get

Get a single shipment by ID or request number.

Carga útil da solicitação
{
  "api_token": "tnx_YOUR_TOKEN",
  "action": "get",
  "request_number": "SR-X9K2F7"
}
Response
{
  "success": true,
  "action": "get",
  "data": { /* full ShipmentRequest entity */ }
}
List shipments
action: list

Paginated list of shipments for the authenticated user. Staff can list all shipments or filter by client_email. Soft-deleted records are excluded.

Carga útil da solicitação
{
  "api_token": "tnx_YOUR_TOKEN",
  "action": "list",
  "page": 1,
  "limit": 20,
  "status": "pending"
}
Response
{
  "success": true,
  "action": "list",
  "data": [ /* summary shipment objects */ ],
  "pagination": { "page": 1, "limit": 20, "total": 45, "total_pages": 3 }
}
Delete shipment
action: delete

Soft-delete a shipment. Record remains for audit. Sets is_deleted=true with timestamp. Active/shipped shipments cannot be deleted by clients.

Carga útil da solicitação
{
  "api_token": "tnx_YOUR_TOKEN",
  "action": "delete",
  "request_number": "SR-X9K2F7",
  "reason": "Created by mistake"
}
Response
{
  "success": true,
  "action": "delete",
  "data": {
    "id": "abc123",
    "request_number": "SR-X9K2F7",
    "deleted_at": "2026-04-24T10:30:00Z"
  }
}
Restore shipment
action: restore

Restore a soft-deleted shipment (staff only).

Carga útil da solicitação
{
  "api_token": "tnx_YOUR_TOKEN",
  "action": "restore",
  "request_number": "SR-X9K2F7"
}
Response
{
  "success": true,
  "action": "restore",
  "data": { "id": "abc123", "request_number": "SR-X9K2F7" }
}
  • Volumetric weight is auto-calculated from dimensions. Status defaults to pending on create.
  • Updates are blocked when status is in_transit, delivered, confiscated, returned, or lost (staff can bypass).
  • Soft-delete sets is_deleted=true with timestamp. Active/shipped shipments cannot be deleted by clients.
  • Restore is staff only.
  • Staff can list all shipments or filter by client_email. Soft-deleted records are excluded from list.
  • UAT: same actions on https://uat-dev.thainexus.co.th/functions/shipmentCrud with a uat_tnx_... key. UAT shipment data is sandbox-only and does not affect production.

Tracking API

POST /Tracking API (registration required)

Programmatic access to Thai Nexus Express tracking events for TNX references and linked carrier updates. Access is provisioned after you submit the registration form on this page. There is no UAT environment for tracking events.

Auth: Issued after registration approval

Campos da solicitação

CampoDescrição
trackingNumberTNX reference or supported carrier/ref number
refreshOptional boolean to force a fresh pull

Exemplo de solicitação

{
  "trackingNumber": "TNX1783820599067POM",
  "refresh": true
}
  • Public browser tracking stays on tracking.thainexus.co.th without an API key.
  • API access is for platforms, marketplaces, and internal tools that need structured event data.
  • Rate limits apply; 429 responses mean you should back off and retry.
  • No UAT for tracking events. Test against production tracking only after access is approved.

API de Retirada de Parceiros

As contas de parceiros podem enviar solicitações de retirada na Tailândia e gerenciar endereços de retirada salvos por meio do shipmentCrud. Isso é independente do CRUD de remessas internacionais e requer o `client_type` “partner”.

  • Mesma URL de base: POST https://app.thainexus.co.th/functions/shipmentCrud
  • As ações incluem verify_account, list_destinations, quote_fee, create, list, get, cancel e get_tracking.
  • Defina o `api_scope` como “pickup” ou “address” para as chamadas `list` e `get`, de modo que elas sejam direcionadas aos manipuladores de retirada.

Solicitar acesso à API de rastreamento de solicitações

A API de rastreamento não é de autoatendimento. Envie este formulário e responderemos em até um dia útil com as credenciais ou eventuais perguntas adicionais. Não há ambiente de UAT para eventos de rastreamento; após a aprovação, o acesso será restrito ao ambiente de produção.

Perguntas frequentes para desenvolvedores

A API Thai Nexus está disponível em um plano pago?
A cotação, a lista de serviços de remessa e as operações CRUD de remessas utilizam um token gratuito da conta do cliente, disponível nas Configurações de Perfil no aplicativo do cliente. Não há taxa por chamada para integrações padrão com lojas, desde que dentro dos limites de uso razoável. O acesso à API de rastreamento é concedido após a análise do formulário de cadastro. O uso em grande volume da API de rastreamento deve ser informado no formulário.
Onde posso obter um token da API Thai Nexus?
Faça login no aplicativo cliente, abra as Configurações do Perfil e gere ou copie seu token de produção tnx_. As integrações WooCommerce, Shopify e BigCommerce utilizam o mesmo token. As chaves UAT utilizam o prefixo uat_tnx_ e são emitidas mediante solicitação; elas não estão disponíveis nas Configurações do Perfil. Nunca incorpore tokens no código público do front-end.
O que é o ambiente da API Thai Nexus UAT?
O UAT é executado em uat-dev.thainexus.co.th para cotações, serviços de remessa e operações CRUD relacionadas a remessas antes da entrada em produção. Solicite uma chave de API do UAT ao Thai Nexus; não é um serviço de autoatendimento. Não há UAT para eventos de rastreamento; o rastreamento permanece restrito à produção após a aprovação da API de rastreamento.
Qual é a diferença entre a API de rastreamento Thai Nexus e o rastreamento público?
Qualquer pessoa pode rastrear um número TNX no site tracking.thainexus.co.th sem precisar se autenticar. A API de rastreamento retorna eventos JSON estruturados para sistemas e exige registro. Não há UAT para o rastreamento. Aplicam-se limites de taxa; o código HTTP 429 significa “aguardar e tentar novamente”.
O que são os limites de taxa da API Thai Nexus?
Os pontos de extremidade do rastreamento público e da API de rastreamento têm limitação de taxa por IP e por token. Respostas HTTP do tipo “429” indicam que é necessário aguardar e tentar novamente com intervalo de espera. Consultas em alto volume devem ser substituídas por intervalos razoáveis ou webhooks, quando disponíveis. Informe o volume esperado no formulário de registro da API de rastreamento.
Quais APIs a Thai Nexus oferece para remessas?
Cotação, lista de serviços de remessa, operações CRUD de remessas e pontos de conexão da API de rastreamento. Os tokens de produção são obtidos nas Configurações de Perfil do aplicativo cliente (prefixo “tnx_”). As chaves UAT são emitidas mediante solicitação para testes de cotação e remessa. Os caminhos completos e exemplos estão disponíveis na página de desenvolvedores.
O Thai Nexus é compatível com o Shopify?
Sim, por meio da integração Shopify publicada, utilizando seu token de API de cliente para obter taxas de checkout em tempo real e criar remessas. Faça a instalação na página de integrações. É o mesmo token usado para WooCommerce e BigCommerce. O registro para a API de rastreamento é feito separadamente.
O Thai Nexus é compatível com o WooCommerce?
Sim. O plug-in WooCommerce usa o mesmo token “tnx_” das Configurações de Perfil. Configure o endereço de origem como seu depósito em Hua Hin ou Bangkok. As consultas de tarifas são feitas por meio do endpoint de cotação documentado na página de desenvolvedores.
Como funciona a autenticação via API Thai Nexus?
Token de portador com o prefixo “tnx_” das Configurações do Perfil após o login do cliente. Nunca incorpore tokens no JavaScript público do front-end. Substitua imediatamente os tokens comprometidos. O UAT utiliza chaves “uat_tnx_” emitidas manualmente, e não a partir das Configurações do Perfil.
Qual é a URL base da API Thai Nexus?
A URL da base de produção está documentada na página dos desenvolvedores e corresponde ao host utilizado pelas chamadas de API do aplicativo cliente. Acrescente nomes de funções, como apiQuote ou shipmentCrud. O host do UAT é separado, em uat-dev.thainexus.co.th, para testes antes da entrada em operação.
Como faço para exibir as taxas de frete em tempo real na página de finalização da compra a partir da Tailândia?
Chame o endpoint de cotação a partir do backend da sua loja, fornecendo o peso, as dimensões e o país de destino. As integrações Thai Nexus, Shopify, WooCommerce e BigCommerce realizam a mesma chamada. As tarifas são meramente indicativas até que o conteúdo seja confirmado; cotações vinculativas podem exigir revisão manual no caso de mercadorias restritas.
Quem oferece uma API de remessa na Tailândia?
A Thai Nexus Point Co., Ltd. disponibiliza pontos de extremidade REST para cotações, remessas e rastreamento. Registro/CNPJ: 0775567004498. As APIs próprias das transportadoras (DHL, FedEx) são objeto de contratos separados; o Thai Nexus agrupa as reservas com várias transportadoras em um único token.