Updated on 2023-01-18 GMT+08:00

Listing Orders

Function

This API is used to query orders by pages and specific conditions.

URI

POST /v1/datashare/dataset/query-orders

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

orgID

Yes

String

Organization ID.

channelID

Yes

String

Channel ID.

cryptoMethod

Yes

String

Encryption method, which is fixed at SW.

cert

Yes

String

Certificate.

sk

Yes

String

Private key.

timestamp

Yes

String

Timestamp.

currentPage

No

String

Pagination parameter: page number (default value: 1).

pageSizeNum

No

String

Pagination parameter: number of records on each page (default value: 100).

provider

No

String

Filtering condition: data set publisher identifier.

searchText

No

String

Filtering condition: keywords (names of products in the data set).

status

No

String

Filtering condition: order status (ready, finished, failed, or canceled.)

consumer

No

String

Filtering condition: order applicant identifier.

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

items

Array of DataOrderResponse objects

List.

pagination

PaginationResp object

Pagination information.

Table 3 DataOrderResponse

Parameter

Type

Description

consumer

String

Order applicant identifier.

consumerName

String

Order applicant name.

orderSeq

String

Order number.

provider

String

Order provider identifier.

providerName

String

Order provider name.

productID

String

Data set product ID.

productName

String

Data set product name.

price

String

Order amount.

applyTime

String

Application time.

encryptedAesKey

String

Private key.

status

String

Order status.

reason

String

Order application reason.

lockProof

String

Order lock-up proof.

creatorDID

String

DID of the process creator. If there is no process, the value is "".

processID

String

ID of the process of the current order. If there is no process, the value is "".

Table 4 PaginationResp

Parameter

Type

Description

currentPage

Integer

Current page.

pageSizeNum

Integer

Number of records on each page.

totalItems

Integer

Total number of records.

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMsg

String

Error description.

Example Requests

{
  "orgID" : "ce0ac69b0c8648cd25b44a551780409767c8890b",
  "channelID" : "mychannel",
  "cryptoMethod" : "SW",
  "cert" : "-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----",
  "sk" : "-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----",
  "timestamp" : "2020-10-27T17:28:16+08:00",
  "currentPage" : "string",
  "pageSizeNum" : "string",
  "provider" : "string",
  "searchText" : "string",
  "status" : "string",
  "consumer" : "did:example:3TMWx8owKHARgNwbj4ywmG"
}

Example Responses

Status code: 200

Order pagination information.

{
  "items" : [ {
    "consumer" : "did:example:3TMWx8owKHARgNwbj4ywmG",
    "consumerName" : "Tyler",
    "orderSeq" : "1",
    "provider" : "did:example:DHkJjyD5wZwya6sd6BNBnG",
    "providerName" : "hw",
    "productID" : "product1",
    "productName" : "prodname1",
    "price" : "0",
    "applyTime" : "1607332359",
    "encryptedAesKey" : "BNGhPwjaTgpM+V7czzw1i4mH21KKN+XLKXHLqVsRIfybUCncqZNfomkRfzX4WEHj+oty1X9oCd4h6xMnRvs8BWE5Tvg6BJ6QTW/km9EO/FSYqzJf2GqQzAleAcLJrTBZ3LRbPaF87CgJ114ae7R+VK9VvfXQ8exuH2KMRD305dXieGpM4VPVv9u1BbL15Jpd/g==",
    "status" : "ready",
    "reason" : "I want product1",
    "lockProof" : ""
  } ],
  "pagination" : {
    "currentPage" : 1,
    "pageSizeNum" : 100,
    "totalItems" : 10
  }
}

Status code: 500

Error response.

{
  "errorCode" : "BCS.5002046",
  "errorMsg" : "Incorrect number of arguments"
}

Status Codes

Status Code

Description

200

Order pagination information.

500

Error response.

Error Codes

See Error Codes.