Update Cart Transform Function

🔒

Requires write_cart_transform access 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

ParameterTypeRequiredDescriptionExample
idstringYesThe unique ID of the cart transform function.

Body Parameters

Parameter

Type

Required

Description

block_on_failure

bool

No

Determines whether to block the cart/checkout process if the Function execution fails.
Default false

input_query

raw json string

No

A JSON string specifying metafield queries for cart line items.

input query structure

ParameterTypeRequiredDescription
product_metafields_queryarrayNoDefines 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.
namespacestringYesThe namespace of the Metafield.
keystringYesThe key of the Metafield.

Example input_query JSON:

"{\"product_metafields_query\": [{\"namespace\": \"custom-option\", \"key\": \"adjust-10-price\"}]}"

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeRequiredDescription
codestringYesResponse status code, "SUCCESS" if successful
messagestringYesResponse message, "SUCCESS" if successful
dataobjectYesData returned upon success

Error Response

FieldTypeDescriptionExample
codestringThe error code indicating the type of issue.InvalidParameter
messagestringA detailed message describing the error.wrong cursor
dataobjectData returned upon error

Error Details

Error CodeDescription
INVALID_FUNCTION_IDThe function ID does not exist or is invalid.
Language
Credentials
URL
Click Try It! to start a request and see the response here!