# 04-Shopping

# 1 Order

# 1.1 Create Order(POST)

# URL

https://developers.cjdropshipping.com/api2.0/v1/shopping/order/createOrder

# CURL

curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/shopping/order/createOrder' \
                --header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
                --header 'Content-Type: application/json' \
                --data-raw '{
                    "shippingZip": "123",
                    "shippingCountryCode": "US",
                    "shippingCountry": "123",
                    "shippingProvince": "123",
                    "shippingCity": "132",
                    "shippingAddress": "123213",
                    "shippingCustomerName": "123213",
                    "shippingPhone": "111",
                    "remark": "note",
                    "fromCountryCode": "CN",
                    "logisticName": "PostNL",
                    "products": [
                        {
                            "vid": "92511400-C758-4474-93CA-66D442F5F787",
                            "quantity": 1,
                            "shippingName": "123"
                        }
                    ]
                }'
Parameter Definition Type Required Length Note
shippingCountryCode country code string Y 200
shippingCountry country string Y 200
shippingProvince province string Y 200
shippingCity city string Y 200
shippingAddress shipping address string Y 200
shippingCustomerName shipping name string Y 200
shippingZip zip string Y 200
shippingPhone phone number string Y 200
remark order remark string 500
logisticName logistic name string Y 200
fromCountryCode from string Y 200 warehouse
products list Y 200
vid variant id string Y 200
quantity quantity string Y 200
shippingName shipping name string Y 200

# Return

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": "210711100018655344",
    "requestId": "9eddf3f5-bd3d-4fae-a4f2-028cbb90db97"
}
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": 1600100,
   "result": false,
   "message": "Param error",
   "data": null,
   "requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
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

# 1.2 List Order(GET)

# URL

https://developers.cjdropshipping.com/api2.0/v1/shopping/order/list?pageNum=1&pageSize=10

# CURL

curl --location --request GET 'https://developers.cjdropshipping.com/api2.0/v1/shopping/order/list?pageNum=1&pageSize=10' \
                --header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Parameter Definition Type Required Length Note
pageNum Page number int No 20 Default 1
pageSize Quantity of results on each page int No 20 Default 20
orderId order id string No 200
status order status string No 200 eg: CREATED

# Return

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": {
        "pageNum": 1,
        "pageSize": 10,
        "total": 6859,
        "list": [
            {
                "orderId": "1377085655003308032",
                "orderNum": "50166125936666",
                "cjOrderId": null,
                "shippingCountryCode": "SG",
                "shippingProvince": "Singapore",
                "shippingCity": "Singapore",
                "shippingPhone": "6587997352",
                "shippingAddress": "Singapore,07  Anson  Tanjong  Pagar,79 ANSON ROAD,79 Anson Road #01-01, Phoenix Tower",
                "shippingCustomerName": "KUDO KANJI ",
                "remark": "",
                "orderWeight": 0,
                "orderStatus": "CREATED",
                "orderAmount": null,
                "productAmount": 0,
                "postageAmount": null,
                "logisticName": null,
                "trackNumber": null,
                "createDate": "2021-03-31 00:46:39",
                "paymentDate": null,
                "productList": null
            }...
        ]
    }
}        
Field Definition Type Length Note
orderId order id string 200
orderNum order name string 200
cjOrderId cj order id string 200
shippingCountryCode country code string 200
shippingProvince province string 200
shippingCity city string 200
shippingAddress shipping address string 200
shippingCustomerName shipping name string Y 200
shippingPhone phone number string 200
remark order remark string 500
logisticName logistic name string 200
trackNumber track number string 200
orderWeight order weight int 20
orderAmount order amount BigDecimal (18,2) Unit: $ (USD)
orderStatus order status string 200
createDate create time string 200
paymentDate pay time string 200

Order Status

Order Status Status remark
CREATED order create create order, wait confirm
IN_CART in cart wait confirm, api merge this state
UNPAID unpaid confirm order, cj order number create
UNSHIPPED unshipped paid, wait for sending
SHIPPED shipped in transit, get tracking number
DELIVERED delivered clients receving
CANCELLED cancelled

error

{
   "code": 1600100,
   "result": false,
   "message": "Param error",
   "data": null,
   "requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
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

# 1.3 Query Order(GET)

# URL

https://developers.cjdropshipping.com/api2.0/v1/shopping/order/getOrderDetail?orderId=210711100018043276

# CURL

curl --location --request GET 'https://developers.cjdropshipping.com/api2.0/v1/shopping/order/getOrderDetail?orderId=210711100018043276' \
                --header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Parameter Definition Type Required Length Note
orderId order id string Y 200 Query

# Return

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": {
        "orderId": "210823100016290555",
        "orderNum": "api_52f268d40b8d460e82c0683955e63cc9",
        "cjOrderId": null,
        "shippingCountryCode": "US",
        "shippingProvince": "Connecticut",
        "shippingCity": "ftdsr",
        "shippingPhone": "43514123",
        "shippingAddress": "rfdxf rfdesr",
        "shippingCustomerName": "Xu Old",
        "remark": null,
        "orderWeight": 20,
        "orderStatus": "CREATED",
        "orderAmount": 4.25,
        "productAmount": 0.57,
        "postageAmount": 3.68,
        "logisticName": "CJPacket Ordinary",
        "trackNumber": null,
        "createDate": "2021-08-23 11:31:45",
        "paymentDate": null,
        "productList": [
            {
                "vid": "1392053744945991680",
                "quantity": 1,
                "sellPrice": 0.57
            }
        ]
    },
    "requestId": "3adccdcb-d41b-4808-996b-c7c5c833d77d"
}
Field Definition Type Length Note
orderId order id string 200
orderNum order name string 200
cjOrderId cj order id string 200
shippingCountryCode country code string 200
shippingProvince province string 200
shippingCity city string 200
shippingAddress shipping address string 200
shippingCustomerName shipping name string Y 200
shippingPhone phone number string 200
remark order remark string 500
logisticName logistic name string 200
trackNumber track number string 200
orderWeight order weight int 20
orderAmount order amount BigDecimal (18,2) Unit: $ (USD)
orderStatus order status string 200
createDate create time string 200
paymentDate pay time string 200

Order Status

Order Status Status remark
CREATED order create create order, wait confirm
IN_CART in cart wait confirm, api merge this state
UNPAID unpaid confirm order, cj order number create
UNSHIPPED unshipped paid, wait for sending
SHIPPED shipped in transit, get tracking number
DELIVERED delivered clients receving
CANCELLED cancelled

error

{
   "code": 1600100,
   "result": false,
   "message": "Param error",
   "data": null,
   "requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
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

# 1.4 Order Delete(DEL)

# URL

https://developers.cjdropshipping.com/api2.0/v1/shopping/order/deleteOrder?orderId=210711100018655344

# CURL

curl --location --request DELETE 'https://developers.cjdropshipping.com/api2.0/v1/shopping/order/deleteOrder?orderId=210711100018655344' \
                --header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Parameter Definition Type Required Length Note
orderId order id string Y 200 Query

# Return

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": "210711100018655344",
    "requestId": "721341bf-abf8-4d8c-b400-1fbdaef79039"
}
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": 1600100,
   "result": false,
   "message": "Param error",
   "data": null,
   "requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
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

# 1.5 Confirm Order(PATCH)

# URL

https://developers.cjdropshipping.com/api2.0/v1/shopping/order/confirmOrder

# CURL

curl --location --request PATCH 'https://developers.cjdropshipping.com/api2.0/v1/shopping/order/confirmOrder' \
                --header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
                --header 'Content-Type: application/json' \
                --data-raw '{
                    "orderId": "210711100018655344"
                }'
Parameter Definition Type Required Length Note
orderId order id string Y 200 Query

# Return

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": "210711100018655344",
    "requestId": "721341bf-abf8-4d8c-b400-1fbdaef79039"
}
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": 1603001,
    "result": false,
    "message": "order confirm fail",
    "data": null,
    "requestId": "7dc61955-c0e8-4731-bb9b-393b4fffeaaf"
}
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

# 2 Payment

# 2.1 Get Balance(GET)

# URL

https://developers.cjdropshipping.com/api2.0/v1/shopping/pay/getBalance

# CURL

curl --location --request GET 'https://developers.cjdropshipping.com/api2.0/v1/shopping/pay/getBalance' \
                --header 'CJ-Access-Token: 0580277abfe24bcc9fccdc3ede57d334'

# Return

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": {
        "amount": 87247.32,
        "noWithdrawalAmount": null,
        "freezeAmount": null
    },
    "requestId": "36fc030a-a110-4318-bc83-f39f9d3e5484"
}
Field Definition Type Length Note
noWithdrawalAmount Bonus amount BigDecimal (18,2) Unit: $ (USD)
freezeAmount Frozen amount BigDecimal (18,2) Unit: $ (USD)
amount Amount BigDecimal (18,2) Unit: $ (USD)

error

{
   "code": 1600100,
   "result": false,
   "message": "Param error",
   "data": null,
   "requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
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

# 2.2 Pay Balance(POST)

# URL

https://developers.cjdropshipping.com/api2.0/v1/shopping/pay/payBalance

# CURL

curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/shopping/pay/payBalance' \
                --header 'CJ-Access-Token: 0580277abfe24bcc9fccdc3ede57d334' \
                --header 'Content-Type: application/json' \
                --data-raw '{
                    "orderId": "12"
                }'
Parameter Definition Type Required Length Note
orderId Order id string Yes 200

# Return

success

{
    "code": 200,
    "result": true,
    "message": "Success",
    "data": null,
    "requestId": "7dbe69b9-dd82-4ee3-907c-a6fca833e3ce"
}
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": 1600100,
  "result": false,
  "message": "Param error",
  "data": null,
  "requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
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