# Sale Commission APIs

# Create Order

Method: POST
Path: /salecommission/api/projects/{projectId}/orders Description: Calculate order commission and save result to CMS sale summary

Client Scope:
- sale.sum.w

Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
batchId order batch id in webhook name of sale person String N
items order items list Y
item.amount order items amount Number N
item.price order items product price Number N
item.productId order items product id String N
item.sku order items product sku String Y
item.tags order items tags String N
orderChannel order channel String N
orderId order id String N
paymentMethod order payment method String N
saleId weomni sale id String N
tags order tags String N
total order total String Y

Request Body Example:

  {
    "batchId": "batch001",
    "items": [
      {
        "amount": 2,
        "price": 1000.0,
        "productId": "",
        "sku": "iPhone",
        "tags": [
          "com-true",
          "cat-gadget",
          "merchant0001"
        ]
      }
    ],
    "orderChannel": [
      "wemall"
    ],
    "orderId": "wemall0001",
    "paymentMethod": "creditcard",
    "saleId": "191203900048",
    "tags": [
      ""
    ],
    "total": 2000.0
  }

Example Request:

curl --location --request POST 'https://platform.weomni-test.com/salecommission/api/projects/5ed5fa524972aa0001153b4a/orders' \
--header 'Authorization: Bearer {token}'

Example Response:

HTTP/1.1 202 ACCEPTED

# Update Order Status

Method: PATCH
Path: /salecommission/api/projects/{projectId}/orders/{cmsId} Description: Update CMS sale summary record status

Client Scope:
- sale.sum.w

Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
status sale summary record status Enum {WAITING, IN PROGRESS, COMPLETE} Y

Request Body Example:

  {
    "status": "WAITING"
  }

Example Request:

curl --location --request PATCH 'https://platform.weomni-test.com/salecommission/api/projects/5ed5fa524972aa0001153b4a/orders/5eec2aa67beb260001bb4a9e' \
--header 'Authorization: Bearer {token}'

Example Response:

HTTP/1.1 202 ACCEPTED
Last Updated: 7/17/2020, 11:09:13 AM