Creates or updates a custom attribute for an order.
POST
/v2/orders/{order_id}/custom-attributes/{custom_attribute_key}
Creates or updates a custom attribute for an order.
Use this endpoint to set the value of a custom attribute for a specific order. A custom attribute is based on a custom attribute definition in a Square seller account. (To create a custom attribute definition, use the CreateOrderCustomAttributeDefinition endpoint.)
To create or update a custom attribute owned by another application, the visibility
setting must be VISIBILITY_READ_WRITE_VALUES
. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_READ_WRITE_VALUES
.
The ID of the target order.
The custom attribute to create or update, with the following fields:
value
. This value must conform to the schema
specified by the definition. For more information, see Value data types.
version
. To enable optimistic concurrency control, include this optional field and specify the current version of the custom attribute.
A unique identifier for this request, used to ensure idempotency. For more information, see Idempotency.