파트너 REST API

파트너 픽업 API

파트너 계정(클라이언트_유형: 파트너)에 대한 픽업 요청 및 저장된 픽업 주소를 통합합니다. 픽업 요청과 국제 배송 모두 동일한shipmentCrud 엔드포인트를 사용합니다. 픽업 관련 필드를 사용하거나 api_scope를 설정하면 픽업 통화가 자동으로 라우팅됩니다.

엔드포인트

프로덕션 URL(POST에만 해당):

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

Request envelope

필드설명
api_tokenRequired. Partner token from Profile > API tab (tnx_...). Bearer header also works.
actionRequired. e.g. verify_account, create, list, get
api_scopeRequired for pickup list/get ("pickup") and address CRUD ("address")
dataRequired for create/update. Pickup fields go inside data, not at top level

Identifiers

필드설명
pickup_numberPU-XXXXXX format. From create response or list. Use for get, cancel, get_tracking.
id (pickup)24-char hex. Alternative to pickup_number for get.
destination_selectiontnx:{branchId} or partner:{warehouseId}. Copy exactly from list_destinations.
id (address)24-char hex from address list or create. Use for address get, update, delete.
waybill_numberYour reference string. You provide it on create.

권장 워크플로

  1. verify_account - confirm token works and account is partner
  2. allowed_cities - (optional) confirm pickup city is served
  3. list_destinations - get a real destination_selection value
  4. quote_fee - (optional) estimate fee before create
  5. create - submit pickup using values from list_destinations
  6. list / get - read back pickup_number for tracking or cancel
  7. get_tracking - only after staff approval assigns tracking code
  • Set api_scope: pickup for list and get pickup requests.
  • Set api_scope: address for all saved address CRUD calls.
  • Pickup routing also triggers when action is verify_account, allowed_cities, list_destinations, quote_fee, get_tracking, or cancel.
  • If you see shipper_address required on create, pickup was not routed. Include data.pickup_location, data.destination_selection, and data.waybill_number.

입증

  1. 01

    Partner account required

    Pickup API is available only to partner accounts (client_type: partner). Standard client tokens return HTTP 403.

  2. 02

    Generate an API token

    In the client app, open Profile > API tab and copy your tnx_... token. Keep it secret. Do not embed tokens in public frontend code.

  3. 03

    Authenticate requests

    Include api_token in every JSON body, or send Authorization: Bearer tnx_... . All calls use POST with Content-Type: application/json.

API 놀이터

이 사이트 프록시를 통해 프로덕션 ShippingCrud에 대해 실시간 호출을 실행하세요. 아래에 파트너 tnx_ 토큰을 붙여넣으세요. 토큰은 브라우저 세션에만 유지됩니다.

픽업 요청 작업

verify_account

POST /shipmentCrud

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

Confirms token and partner account type.

Auth: api_token in body or Bearer header

요청 예시

{
  "api_token": "tnx_...",
  "action": "verify_account"
}

응답 예시

{
  "success": true,
  "account": {
    "user_email": "partner@example.com",
    "partner_id": "abc123",
    "partner_name": "Example Partner",
    "client_type": "partner"
  }
}

list_destinations

POST /shipmentCrud

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

Returns read-only destination options. Copy destination_selection exactly from tnx_branches[] or partner_branches[].

Auth: api_token

요청 예시

{
  "api_token": "tnx_...",
  "action": "list_destinations"
}

quote_fee

POST /shipmentCrud

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

Estimate pickup fee before creating a request.

Auth: api_token

요청 필드

필드설명
cityPickup city (must be in allowed cities)
items[]Parcel lines with description, quantity, weight_kg, length_cm, width_cm, height_cm

요청 예시

{
  "api_token": "tnx_...",
  "action": "quote_fee",
  "city": "Bangkok",
  "items": [{
    "description": "Box",
    "quantity": 1,
    "weight_kg": 2.5,
    "length_cm": 30,
    "width_cm": 20,
    "height_cm": 15
  }]
}

create

POST /shipmentCrud

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

Creates a pickup request. Run list_destinations first and copy a real destination_selection.

Auth: api_token

요청 필드

필드설명
data.pickup_location or data.pickup_address_idInline contact + address, or saved address id
data.destination_selectionFrom list_destinations (tnx:... or partner:...)
data.waybill_numberYour reference / waybill number
data.items[] or data.parcels[]At least one parcel with weight and all dimensions

요청 예시

{
  "api_token": "tnx_...",
  "action": "create",
  "data": {
    "pickup_location": {
      "contact_name": "John Doe",
      "contact_phone": "+66812345678",
      "address_line1": "123 Sukhumvit Road",
      "city": "Bangkok",
      "postal_code": "10110"
    },
    "destination_selection": "tnx:69a5bdade602b67c968f2ef6",
    "waybill_number": "WB123456789",
    "items": [{
      "description": "Electronics box",
      "quantity": 1,
      "weight_kg": 2.5,
      "length_cm": 30,
      "width_cm": 20,
      "height_cm": 15
    }]
  }
}

list

POST /shipmentCrud

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

Paginated list of your partner account pickup requests. Always set api_scope: pickup.

Auth: api_token + api_scope: pickup

요청 예시

{
  "api_token": "tnx_...",
  "api_scope": "pickup",
  "action": "list",
  "page": 1,
  "limit": 20
}

get

POST /shipmentCrud

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

Fetch one pickup by pickup_number (preferred) or internal id.

Auth: api_token + api_scope: pickup

요청 예시

{
  "api_token": "tnx_...",
  "api_scope": "pickup",
  "action": "get",
  "pickup_number": "PU-NWU19Y"
}

cancel

POST /shipmentCrud

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

Cancel an open pickup (pending, requested, or confirmed). reason is required.

Auth: api_token

요청 예시

{
  "api_token": "tnx_...",
  "action": "cancel",
  "pickup_number": "PU-ABC123",
  "reason": "Customer rescheduled"
}

get_tracking

POST /shipmentCrud

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

Live tracking after staff approval assigns a tracking code.

Auth: api_token

요청 예시

{
  "api_token": "tnx_...",
  "action": "get_tracking",
  "pickup_number": "PU-ABC123"
}

저장된 픽업 주소

모든 주소 CRUD 호출에는 api_scope 주소를 사용하세요. 저장된 위치를 재사용하려면 생성 시 Pickup_address_id를 참조하세요.

list

POST /shipmentCrud

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

List saved pickup addresses for your partner account.

요청 예시

{
  "api_token": "tnx_...",
  "api_scope": "address",
  "action": "list",
  "page": 1,
  "limit": 20
}

create

POST /shipmentCrud

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

Create a saved pickup address. City must be in the allowed service area.

요청 예시

{
  "api_token": "tnx_...",
  "api_scope": "address",
  "action": "create",
  "data": {
    "address_name": "Bangkok Warehouse",
    "contact_name": "John Doe",
    "contact_phone": "+66812345678",
    "address_line1": "456 Warehouse Lane",
    "city": "Bangkok",
    "postal_code": "10110"
  }
}

서비스 지역

픽업은 태국에만 해당됩니다. 픽업 도시는 허용된 서비스 지역 내에 있어야 합니다.

  • Bangkok
  • Hua Hin
  • Pran Buri
  • Cha-am
  • Tha Yang
  • Ban Lat
  • Phetchaburi
  • Khao Yoi
  • Pak Tho
  • Samut Songkhram
  • Samut Sakhon

오류

HTTP status codes

필드설명
400Validation error (missing field, invalid city, bad destination_selection)
401Missing or invalid api_token
403Token valid but account is not a partner
404Pickup request or address not found
502Tracking app temporarily unavailable (get_tracking)

파트너 픽업 FAQ

Partner Pickup API는 누가 사용할 수 있나요?
파트너 계정만(client_type:partner). 표준 클라이언트 토큰은 HTTP를 수신합니다. 403 픽업 API는 파트너 계정에서만 사용할 수 있습니다.
Partner Pickup API 엔드포인트란 무엇입니까?
모든 픽업 및 저장된 주소 통화는 Content-Type application/json과 함께 POST https://app.thainexus.co.th/functions/shipmentCrud 사용합니다. 픽업 라우팅이 트리거되지 않은 경우 동일한 끝점에서 국제 배송 CRUD를 처리합니다.
생성을 위해 Destination_selection을 어떻게 얻나요?
list_destinations를 호출하고 tnx_branches 또는 Partner_branches에서 정확하게 Destination_selection을 복사하세요. tnx:test-branch와 같은 값을 만들어내지 마세요.
api_scope는 언제 필요합니까?
픽업 목록에 대해 api_scope 픽업을 설정하고 가져옵니다. 저장된 주소 CRUD에 대해 api_scope 주소를 설정합니다. 다른 픽업 작업은 자동으로 전달됩니다.