Skip to content

Integrations

POS, shipping and payment connections: call adapter actions. · 9 endpoints

Configured integrations

GET/api/v1/integrationsScope: integrations:read

Example request

bash
curl "http://127.0.0.1:9900/api/v1/integrations" \
  -H "Authorization: Bearer dpk_xxx"

Add an integration (credentials are encrypted and never returned)

POST/api/v1/integrationsScope: integrations:manage

Request body (JSON)

type
required
"kiotviet" | "haravan" | "sapo" | "nhanh" | "pancake" | "casso" | "sepay" | "ghn" | "ghtk" | "telegram_bot"Xem GET /integrations/types
name
optional
string
max 100
Empty = the integration type's name
enabled
optional
boolean
default true
credentials
required
objectKeys as listed by GET /integrations/types
settings
optional
object

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/integrations" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"type":"ghn","credentials":{"token":"ghn_xxx","shopId":"123456"},"settings":{"environment":"production"}}'

Get an integration (without credentials)

GET/api/v1/integrations/{integrationId}Scope: integrations:read

Parameters

integrationId
path · required
string
max 200

Example request

bash
curl "http://127.0.0.1:9900/api/v1/integrations/{integrationId}" \
  -H "Authorization: Bearer dpk_xxx"

Update an integration: name, settings, credentials (empty = keep the current ones), on/off

PATCH/api/v1/integrations/{integrationId}Scope: integrations:manage

Parameters

integrationId
path · required
string
max 200

Request body (JSON)

name
optional
string
max 100
enabled
optional
boolean
credentials
optional
object
settings
optional
object

Example request

bash
curl -X PATCH "http://127.0.0.1:9900/api/v1/integrations/{integrationId}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","enabled":false,"credentials":{}}'

Delete an integration (workflows that use it will fail when they run)

DELETE/api/v1/integrations/{integrationId}Scope: integrations:manage

Parameters

integrationId
path · required
string
max 200

Example request

bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/integrations/{integrationId}" \
  -H "Authorization: Bearer dpk_xxx"

Call an adapter action (e.g. lookupOrder, createOrder, getTracking)

POST/api/v1/integrations/{integrationId}/actions/{action}Scope: integrations:execute

Action names and parameters are the same as the corresponding workflow node (e.g. node nhanh.lookupOrder ↔ action lookupOrder).

Parameters

integrationId
path · required
string
max 200
action
path · required
string
max 100

Request body (JSON)

params
optional
object
default {}

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/integrations/{integrationId}/actions/{action}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"params":{"orderId":"DH2291"}}'

Supported integration types and the credential / settings keys they require

GET/api/v1/integrations/typesScope: integrations:read

Example request

bash
curl "http://127.0.0.1:9900/api/v1/integrations/types" \
  -H "Authorization: Bearer dpk_xxx"

Call an action by integration type (uses the enabled integration of that type)

POST/api/v1/integrations/by-type/{type}/actions/{action}Scope: integrations:execute

Handy when you have only one integration of each type, like workflow nodes (e.g. ghn + getTracking).

Parameters

type
path · required
"kiotviet" | "haravan" | "sapo" | "nhanh" | "pancake" | "casso" | "sepay" | "ghn" | "ghtk" | "telegram_bot"
action
path · required
string
max 100

Request body (JSON)

params
optional
object
default {}

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/integrations/by-type/{type}/actions/{action}" \
  -H "Authorization: Bearer dpk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"params":{}}'

Test the integration's connection

POST/api/v1/integrations/{integrationId}/testScope: integrations:execute

Parameters

integrationId
path · required
string
max 200

Example request

bash
curl -X POST "http://127.0.0.1:9900/api/v1/integrations/{integrationId}/test" \
  -H "Authorization: Bearer dpk_xxx"