Requires
read_product
access scope. More access scope
The List Procurements API retrieves a list of procurement records with optional filters such as state, creation date, or update date. This API supports pagination to manage large datasets efficiently.This API is especially useful for:
- Fetching procurement records based on specific criteria for management or reporting.
- Filtering procurement records by state or date range.
- Managing large procurement datasets with pagination.
Note: The operation is scoped to a specific shop, identified by its unique domain prefix (shopdomain
), ensuring all queries are applied to the correct store.
Public Request Parameters
Parameter Name | Type | Required | Parameter Location | Parameter Value | Description |
---|---|---|---|---|---|
Access-Token | String | Yes | Header | Bx-_5aV eXNwl-4AB98s5xLV yg0fNzGf MuTpqtlBA | Used to authenticate API requests. Obtain an access token from the Access Token Guide. Pass it in the Authorization header for every request. |
Content-Type | String | Yes | Header | application /json | Indicates the media type of the request body. It tells the server how to parse the request and the client how to interpret the response. For more details, visit Content-Type. |
Public Response Parameters
Parameter Name | Type | Mandatory | Parameter Location | Example Value | Description |
---|---|---|---|---|---|
error | String | No | Response Body | { "error": "store is not active" } | Indicates an error encountered during the process. This field typically appears when the Access Token is missing or invalid. Example: { "error": "store is not active" } . |
errors | Array | No | Response Body | { "errors"["invalid id"] } | A list of errors that occurred during the request processing. Example: { "errors": [ "No Context" ] } . |
Request-Id | String | Yes | Header | Bx-_5aV eXNwl-4AB98s5xLV yg0fNzGf MuTpqtlBA | A unique identifier for each request. It helps in identifying and debugging specific requests. |
Error and Errors Clarification:
Added explanation that the error and errors fields are currently dependent on the API implementation, with plans for future unification.
Request Parameters
Query Parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
page | int32 | Yes | 1 | Page number for pagination. Must be greater than 0 . Default: 1 . |
limit | int32 | Yes | 10 | Number of records per page. Must be greater than 0 and less than 100 . Default: 10 . |
ids | array | No | ["928374928374982734"] | Array of procurement IDs to filter by. Each ID must be a valid UUID. |
state | int32 | No | 1 | Procurement state filter. Accepted values: 1 (waiting for stock), 2 (partial receipt), 3 (complete receipt), 4 (cancelled). |
created_at_min | string | No | 2023-01-01T00:00:00Z | Filter procurements created at or after this date (ISO-8601 format). |
created_at_max | string | No | 2023-01-31T23:59:59Z | Filter procurements created at or before this date (ISO-8601 format). |
updated_at_min | string | No | 2023-01-01T00:00:00Z | Filter procurements updated at or after this date (ISO-8601 format). |
updated_at_max | string | No | 2023-01-31T23:59:59Z | Filter procurements updated at or before this date (ISO-8601 format). |
Response Explanation
Successful Response
Field | Type | Example | Description |
---|---|---|---|
count | int32 | 15 | Total number of procurements matching the criteria. |
procurements | array | List of procurement objects. | |
procurements.id | string | "928374928374982734" | Unique ID of the procurement. |
procurements.state | int32 | 1 | Current state of the procurement. |
procurements.supplier_id | string | "382453603865993516" | ID of the supplier associated with the procurement. |
procurements.note | string | "Procurement of electronics" | Optional note added to the procurement. |
procurements.created_at | string | "2024-05-20T10:00:00Z" | Timestamp when the procurement was created. |
procurements.updated_at | string | "2024-05-21T12:00:00Z" | Timestamp when the procurement was last updated. |
Error Response
Error responses in the API can be represented using two different fields: errors
and error
. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.
Field | Type | Example | Description |
---|---|---|---|
error | Array | "error": "store is not active" | Indicates an error encountered during the process. |
Request Examples
curl --request GET \
--url https://{shopdomain}.myshoplazza.com/openapi/2022-01/procurements \
--header 'accept: application/json' \
--header 'access-token: <YOUR_ACCESS_TOKEN>' \
--data-urlencode 'page=1' \
--data-urlencode 'limit=10' \
--data-urlencode 'state=1' \
--data-urlencode 'created_at_min=2023-01-01T00:00:00Z' \
--data-urlencode 'created_at_max=2023-01-31T23:59:59Z'
Success Response Example
{
"procurements": [
{
"id": "454492069793111015",
"procurement_sn": "00000002",
"supplier_id": "454466651757222887",
"location_id": "447078705085299687",
"note": "1123131231321231231231231231232123123123123131231231231322123",
"state": 4,
"pending_quantity": 0,
"received_quantity": 0,
"rejected_quantity": 0,
"transfer_quantity": 0,
"created_by": "",
"created_at": "2024-12-06T03:49:13Z",
"updated_at": "2024-12-06T16:14:07Z"
},
{
"id": "454492025190882279",
"procurement_sn": "00000001",
"supplier_id": "454466651757222887",
"location_id": "447078705085299687",
"note": "1",
"state": 1,
"pending_quantity": 0,
"received_quantity": 0,
"rejected_quantity": 0,
"transfer_quantity": 0,
"created_by": "",
"created_at": "2024-12-06T03:49:03Z",
"updated_at": "2024-12-06T17:54:05Z"
}
],
"count": 2
}
Error Response Example
{
"error": "Supplier not found"}
}
Error Details
Status Code | Message | Possible Reason | Example Response |
---|---|---|---|
400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request |
Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized |