patch
https://{shopdomain}.myshoplaza.com/openapi/2024-07/function/cart-transform/
Requireswrite_cart_transformaccess scope.
The Update Cart Transform Function updates an existing cart transform function, allowing merchants to switch the pricing strategy or adjust failure handling behavior. Once updated, the new function logic will be applied automatically during the cart and checkout process.
Request Parameters
Public Request Parameters
Path Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
id | string | Yes | The unique ID of the cart transform function. |
Body Parameters
Parameter | Type | Required | Description |
|---|---|---|---|
|
| No | Determines whether to block the cart/checkout process if the Function execution fails. |
|
| No | A JSON string specifying metafield queries for cart line items. |
input query structure
| Parameter | Type | Required | Description |
|---|---|---|---|
| product_metafields_query | array | No | Defines rules to query Metafield data. If empty, the function input will not contain Metafield data. The array length is limited to 1, currently supporting only one key. |
| namespace | string | Yes | The namespace of the Metafield. |
| key | string | Yes | The key of the Metafield. |
Example input_query JSON:
input_query JSON:"{\"product_metafields_query\": [{\"namespace\": \"custom-option\", \"key\": \"adjust-10-price\"}]}"Response Explanation
Public Response Parameters
Successful Response
| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Response status code, "SUCCESS" if successful |
message | string | Yes | Response message, "SUCCESS" if successful |
data | object | Yes | Data returned upon success |
Error Response
| Field | Type | Description | Example |
|---|---|---|---|
code | string | The error code indicating the type of issue. | InvalidParameter |
message | string | A detailed message describing the error. | wrong cursor |
data | object | Data returned upon error |
Error Details
| Error Code | Description |
|---|---|
INVALID_FUNCTION_ID | The function ID does not exist or is invalid. |
