RenderPurchaseOrder

Updated at:

Renders a purchase order and returns both sellable and unsellable products. Customers can then select the sellable products to place their orders.

Operation description

Warning This API will be offline soon. For purchase order rendering, use the SplitPurchaseOrder API, which supports both purchase order rendering and splitting.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

linkedmall:RenderPurchaseOrder

none

*All Resource

*

None None

Request syntax

POST /opensaas-s2b/opensaas-s2b-biz-trade/v2/purchaseOrders/commands/render HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body PurchaseOrderRenderQuery

Yes

Render purchase order

{
  "deliveryAddress": {
    "divisionCode": "610102",
    "addressDetail": "Shaanxi Province, Xi'an City, *** Building",
    "receiverPhone": "187****1553",
    "receiver": "Mr. Yan",
    "townDivisionCode": "61010212"
  },
  "buyerId": "test1234****679",
  "productList": [
    {
      "quantity": 1,
      "productId": "6600622091****6736",
      "purchaserId": "22000009",
      "skuId": "6600622091****6737"
    }
  ]
}

Response elements

Element

Type

Description

Example

PurchaseOrderRenderResult

Purchase order rendering result

{
  "requestId": "0928251D-713B-17A1-A2B0-1A57****90B4",
  "orderList": [
    {
      "productList": [
        {
          "productId": "6600622091****6736",
          "productTitle": "Children's study desk",
          "skuTitle": "Light gray",
          "skuId": "6600622091****6737",
          "purchaserId": "22***09",
          "promotionFee": null,
          "quantity": 1,
          "productUrl": null,
          "productPicUrl": "//img.alicdn.com/imgextra/i4/2216003305543/O1CN01bip3Un1qokG0DYLWA_!!2216003305543.jpg",
          "price": 1,
          "canSell": true,
          "message": null,
          "features": null
        }
      ],
      "deliveryInfoList": [
        {
          "id": "20",
          "displayName": "Express delivery, free shipping",
          "postFee": 0,
          "serviceType": -4
        }
      ],
      "invoiceInfo": null,
      "extInfo": null,
      "canSell": true,
      "message": null
    }
  ],
  "unsellableOrderList": [
    {
      "productList": [],
      "deliveryInfoList": null,
      "invoiceInfo": null,
      "extInfo": null,
      "canSell": false,
      "message": null
    }
  ],
  "addressList": [
    {
      "addressId": 0,
      "receiver": "Mr. Yan",
      "receiverPhone": "187****1553",
      "addressDetail": "Shaanxi Province, Xi'an City, *** Building",
      "divisionCode": "610102",
      "townDivisionCode": "610102002"
    }
  ],
  "extInfo": null,
  "canSell": true,
  "message": null
}

Examples

Success response

JSON format

{
  "addressList": [
    {
      "divisionCode": "330106",
      "addressDetail": "陕西省西安市新城区xx街道xxx大厦xx室",
      "receiverPhone": "182***5674",
      "townDivisionCode": "330106109",
      "receiver": "任先生",
      "addressId": 0
    }
  ],
  "canSell": true,
  "requestId": "841471F6-5D61-1331-8C38-2****B55",
  "orderList": [
    {
      "message": "库存为0",
      "deliveryInfoList": [
        {
          "postFee": 0,
          "serviceType": -4,
          "id": "20",
          "displayName": "快递 免邮"
        }
      ],
      "canSell": true,
      "productList": [
        {
          "productTitle": "儿童学习桌",
          "features": {
            "test": "test",
            "test2": 1
          },
          "skuTitle": "浅绿色",
          "quantity": 1,
          "productId": "6600****6736",
          "canSell": true,
          "price": 100,
          "productPicUrl": "//img.alicdn.com/imgextra/i4/2216003305543/O1CN01bip3Un1qokG0",
          "purchaserId": "PID56****2304",
          "message": "库存为0",
          "skuId": "6600****6737"
        }
      ],
      "extInfo": {
        "test": "test",
        "test2": 1
      }
    }
  ],
  "unsellableOrderList": [
    {
      "message": "库存为0",
      "deliveryInfoList": [
        {
          "postFee": 0,
          "serviceType": -4,
          "id": "20",
          "displayName": "快递 免邮"
        }
      ],
      "canSell": true,
      "productList": [
        {
          "productTitle": "儿童学习桌",
          "features": {
            "test": "test",
            "test2": 1
          },
          "skuTitle": "浅绿色",
          "quantity": 1,
          "productId": "6600****6736",
          "canSell": true,
          "price": 100,
          "productPicUrl": "//img.alicdn.com/imgextra/i4/2216003305543/O1CN01bip3Un1qokG0",
          "purchaserId": "PID56****2304",
          "message": "库存为0",
          "skuId": "6600****6737"
        }
      ],
      "extInfo": {
        "test": "test",
        "test2": 1
      }
    }
  ],
  "message": "库存为0",
  "extInfo": {
    "test": "test",
    "test2": 1
  }
}

Error codes

See Error CodesError Codes for a complete list.

Release notes

See Release NotesRelease Notes for a complete list.