Application Introduction


Before using OpenApi,you need to register a developer account in Demo environment.

1.Register a developer account

Demo developer environment:http://developers.ck1info.com

Production developer environment:http://developers.chukou1.cn

2.Create your application

Login the developer platform, and create an application.
You can view some key information: ClientId、Secret etc...

3.Authorize your application

After created your application, you can authorize your application to ck1 customers.
Please look for Authorization

4.Application Approve

You can do the same in production environment, when you finished the test


Ck1 customer account for testing:

Ck1 Login Name Ck1 Login Password Ck1 CustomerId
guest 111111 TST

API Introduction


API endpoint:

1.Demo environment: http://openapi.ck1info.com/

2.Production environment: https://openapi.chukou1.cn

3.Header:

All API call must include this header in order to auth the usage of Ck1 OpenApi.

Authorization: Bearer {AccessToken}
Content-Type: application/json; charset=utf-8。

4.HTTP Status Codes:

200(OK),201(Created),404(Not found)、400(Bad Request)、500(Internal Server Error)、401(Unauthorized)、412(Precondition failed)

5.When the interface is called, the URLs in the interface document should be spliced according to the actual usage,
For example:Create Drop-ship Order Url:{domain}/v1/directExpressOrders,
In the test environment, URL is:http://openapi.ck1info.com//v1/directExpressOrders
In a formal environment, URL is:http://openapi.ck1info.com/v1/directExpressOrders

Example 1:Create Drop-ship Order

URL:

Post  http://openapi.ck1info.com/v1/directExpressOrders

Header:

Authorization: Bearer {AccessToken}
Content-Type: application/json; charset=utf-8

Body:

{
  "Location": "GZ",
  "Package": {
    "PackageId": "SMT23015236489",
    "ServiceCode": "CUE",
    "ShipToAddress": {
      "Country": "US",
      "Province": "Florida",
      "City": "Coral Springs",
      "Street1": "9110 NW 21st street ",
      "Postcode": "45429",
      "Contact": "David Mcaffee",
      "Phone": "937-689-8216",
      "Email": "23541566@gmail.com"
    },
    "Weight": 600,
    "Length": 25,
    "Width": 10,
    "Height": 20,
    "Skus": [
      {
        "Sku": "bag-y001",
        "Quantity": 1,
        "Weight": 600,
        "DeclareValue": 5,
        "DeclareNameEn": "bag",
        "DeclareNameCn": "小梦书包",
        "ProductName": "bag-red",
        "Price": 5
      },
      {
        "Sku": "bag-y002",
        "Quantity": 2,
        "Weight": 600,
        "DeclareValue": 5,
        "DeclareNameEn": "bag",
        "DeclareNameCn": "小梦书包",
        "ProductName": "bag-red",
        "Price": 5
      }
    ],
    "SellPrice": 20,
    "SellPriceCurrency": "CNY",
    "SalesPlatform": "Ebay",
    "Custom": "bag-red*1",
    "Remark": "bag-red*1"
  },
  "Remark": "remark"
}
                

Result:

httpcode: 201
Example 2:Get Drop-ship Services

URL:

Get  http://openapi.ck1info.com/v1/directExpressServices

Header:

Authorization: Bearer {AccessToken}
Content-Type: application/json; charset=utf-8

Result:

httpcode: 200
[
  {
    "ServiceCode": "UPS",
    "ServiceName": "CK1无限电",
    "IsTracking": true,
    "InService": true,
    "CanImportTracking": true
  },
  {
    "ServiceCode": "NLR",
    "ServiceName": "Easy邮",
    "IsTracking": true,
    "InService": true,
    "CanImportTracking": false
  },
  {
    "ServiceCode": "DGR",
    "ServiceName": "DHL小包挂号",
    "IsTracking": true,
    "InService": true,
    "CanImportTracking": false
  }
]
Example 3:Get Drop-ship Order Status

URL:

Get  http://openapi.ck1info.com/v1/directExpressOrders/Sh0983125305/status

Header:

Authorization: Bearer {AccessToken}
Content-Type: application/json; charset=utf-8

Result:

httpcode: 404
{
 "Errors":
    [
     {
       "Code":"800F1533",
       "Message":"直发订单Sh0983125305不存在"
     }
    ],
 "TicketId":"b8ccb8c1-1b03-4380-a820-b34f153730d1",
 "UtcDateTime":"2016-03-20T07:19:25Z",
 "RequestUri":"http://openapi.ck1info.com/v1/directExpressOrders/Sh0983125305/status"
}