# 08. Webhook

# 1 Setting

# 1.1 Message Setting(POST)

# URL

https://developers.cjdropshipping.com/api2.0/v1/webhook/set

# CURL

curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/webhook/set' \
                --header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
                --header 'Content-Type: application/json' \
                --data-raw '{
                    "product": {
                        "type": "ALL",
                        "callbackUrls": [
                            "http://localhsost:8080/api2.0/"
                        ]
                    },
                    "stock": {
                        "type": "ALL",
                        "callbackUrls": [
                            "http://localhsost:8080/api2.0/"
                        ]
                    },
                    "order": {
                        "type": "ALL",
                        "callbackUrls": [
                            "http://localhsost:8080/api2.0/"
                        ]
                    },
                    "logistics": {
                        "type": "ALL",
                        "callbackUrls": [
                            "http://localhsost:8080/api2.0/"
                        ]
                    }
                }'
Parameter Definition Type Required Length Note
product Product Message object Y 200 Product Message Setting
- type Product Message type string Y 200 ALL,CANCEL
- callbackUrls callback url list Y 5
stock Stock Message object Y 200 Stock Message Setting
- type Stock Message type string Y 200 ALL,CANCEL
- callbackUrls callback url list Y 5
order Order Message object Y 200 order Message Setting
- type Message type string Y 200 ALL,CANCEL
- callbackUrls callback url list Y 5
logistics Logistics Message object Y 200 logistics Message Setting
- type Message type string Y 200 ALL,CANCEL
- callbackUrls callback url list Y 5

# Webhook Configuration Requirements

# 1. Protocol Requirements
  • Supported Protocols: HTTPS
  • Encryption: TLS 1.2 or TLS 1.3 recommended for secure transmission
  • Request Method: POST
  • Content Type: Content-Type: application/json
# 2. Response Specifications
  • Success Status Code: 200 OK
  • Timeout: Response must be returned within 3 seconds
    (Avoid long-running or complex business logic to ensure prompt response)

# Result

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": true,
    "requestId": "97367e0f-cf3a-4c9b-acea-a36fb56f81b8"
}
Field Definition Type Length Note
code error code int 20 Reference error code
result Whether or not the return is normal boolean 1
message return message string 200
data return data object interface data return
requestId requestId string 48 Flag request for logging errors

error

{
    "code": 1601000,
    "result": false,
    "message": "User not find",
    "data": null,
    "requestId": "a18c9793-7c99-42f9-970b-790eecdceba2"
}
Field Definition Type Length Note
code error code int 20 Reference error code
result Whether or not the return is normal boolean 1
message return message string 200
data return data object interface data return
requestId requestId string 48 Flag request for logging errors