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

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

Añade el nombre de la función a esta URL. Ejemplos:

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

Entorno UAT (prueba)

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

Cómo obtener una clave API 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.

Ejemplo de solicitud de cotización 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".

Autenticación

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.

Puntos finales

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 de la solicitud

CampoDescripción
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.

Ejemplo de solicitud

{
  "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
  }'

Ejemplo de respuesta

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

CampoDescripción
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 de la solicitud

CampoDescripción
api_tokenOptional if Authorization: Bearer tnx_... is set. No other body fields required.

Ejemplo de solicitud

{
  "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();

Ejemplo de respuesta

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

CampoDescripción
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 de la solicitud

CampoDescripción
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

Ejemplo de solicitud

{
  "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.

Datos de la solicitud
{
  "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.

Datos de la solicitud
{
  "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.

Datos de la solicitud
{
  "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.

Datos de la solicitud
{
  "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.

Datos de la solicitud
{
  "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).

Datos de la solicitud
{
  "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 de la solicitud

CampoDescripción
trackingNumberTNX reference or supported carrier/ref number
refreshOptional boolean to force a fresh pull

Ejemplo de solicitud

{
  "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 recogida de socios

Las cuentas de socios pueden enviar solicitudes de recolección en Tailandia y administrar direcciones de recolección guardadas a través de envíoCrud. Esto es independiente del CRUD de envío internacional y requiere socio tipo_cliente.

  • Misma URL base: POST https://app.thainexus.co.th/functions/shipmentCrud
  • Las acciones incluyen verificar_cuenta, listar_destinos, cotizar_fee, crear, enumerar, obtener, cancelar y obtener_seguimiento.
  • Configure la recogida o dirección de api_scope para la lista y obtenga la ruta de las llamadas a los controladores de recogida.

Solicitar acceso a la API de seguimiento

La API de seguimiento no es de autoservicio. Envíe este formulario y le responderemos dentro de un día hábil con credenciales o preguntas de seguimiento. No existe un entorno UAT para rastrear eventos; el acceso es solo de producción después de la aprobación.

Preguntas frecuentes para desarrolladores

¿La API Thai Nexus está en un plan pago?
La cotización, la lista de servicios de envío y el CRUD de envío utilizan un token de cuenta de cliente gratuito desde la Configuración del perfil en la aplicación del cliente. No hay tarifa por llamada para las integraciones de tiendas estándar dentro del uso justo. El acceso a la API de seguimiento se otorga después de revisar el formulario de registro. El uso de la API de seguimiento de gran volumen debe indicarse en el formulario.
¿Dónde consigo un token API Thai Nexus?
Inicie sesión en la aplicación cliente, abra Configuración de perfil y genere o copie su token de producción tnx_. Las integraciones WooCommerce, Shopify y BigCommerce utilizan el mismo token. Las claves UAT utilizan un prefijo uat_tnx_ y se emiten previa solicitud; no están disponibles en Configuración de perfil. Nunca incrustes tokens en el código de interfaz pública.
¿Qué es el entorno API Thai Nexus UAT?
UAT se ejecuta en uat-dev.thainexus.co.th para cotizaciones, servicios de envío y envío CRUD antes de su lanzamiento. Solicite una clave API UAT de Thai Nexus; no es autoservicio. No existe una UAT para rastrear eventos; El seguimiento permanece solo en producción después de la aprobación de la API de seguimiento.
¿Cuál es la diferencia entre la API de seguimiento Thai Nexus y el seguimiento público?
Cualquiera puede rastrear un número TNX en track.thainexus.co.th sin autenticación. La API de seguimiento devuelve eventos JSON estructurados para sistemas y requiere registro. No hay UAT para el seguimiento. Se aplican límites de tarifas; HTTP 429 significa retroceder y volver a intentarlo.
¿Cuáles son los límites de tasa de la API Thai Nexus?
Los puntos finales de seguimiento público y API de seguimiento tienen una tarifa limitada por IP y token. Las respuestas HTTP 429 significan esperar y volver a intentarlo con retroceso. Las encuestas de gran volumen deben reemplazarse con intervalos razonables o webhooks cuando estén disponibles. Divulgue el volumen esperado en el formulario de registro de la API de seguimiento.
¿Qué API ofrece Thai Nexus para el envío?
Cotización, lista de servicios de envío, CRUD de envío y puntos finales de API de seguimiento. Los tokens de producción provienen de la configuración del perfil en la aplicación cliente (prefijo tnx_). Las claves UAT se emiten previa solicitud para cotización y pruebas de envío. Las rutas completas y los ejemplos se encuentran en la página de desarrolladores.
¿Thai Nexus se integra con Shopify?
Sí, a través de la integración Shopify publicada utilizando el token API de su cliente para tarifas de pago en vivo y creación de envíos. Instalar desde la página de integraciones. Mismo token que WooCommerce y BigCommerce. La API de seguimiento es un registro independiente.
¿Thai Nexus se integra con WooCommerce?
Sí. El complemento WooCommerce utiliza el mismo token tnx_ de Configuración de perfil. Configure la dirección de origen como su almacén de Hua Hin o Bangkok. Las cotizaciones de tarifas llaman al punto final de cotización documentado en la página de desarrolladores.
¿Cómo funciona la autenticación API Thai Nexus?
Token de portador con prefijo tnx_ de la configuración del perfil después del inicio de sesión del cliente. Nunca incrustes tokens en JavaScript de interfaz pública. Rote los tokens comprometidos inmediatamente. UAT utiliza claves uat_tnx_ emitidas manualmente, no desde la configuración del perfil.
¿Cuál es la URL base de la API Thai Nexus?
La URL base de producción está documentada en la página de desarrolladores y coincide con el host utilizado por las llamadas API de la aplicación cliente. Agregue nombres de funciones como apiQuote o envíoCrud. El host UAT está separado en uat-dev.thainexus.co.th para pruebas previas al funcionamiento.
¿Cómo muestro las tarifas de envío en vivo al finalizar la compra desde Tailandia?
Llame al punto final de cotización desde el backend de su tienda con el peso, las dimensiones y el país de destino. Las integraciones Thai Nexus Shopify, WooCommerce y BigCommerce envuelven la misma llamada. Las tarifas son orientativas hasta que se confirme el contenido; Es posible que las cotizaciones vinculantes necesiten una revisión manual de productos restringidos.
¿Quién proporciona una API de envío desde Tailandia?
Thai Nexus Point Co., Ltd. expone puntos finales REST para cotizaciones, envíos y seguimiento. Registro/NIF 0775567004498. Las API nativas del operador (DHL, FedEx) son contratos separados; Thai Nexus abstrae las reservas de múltiples operadores detrás de un token.