<- Merchant Custom Attributes API

Merchant Custom Attributes API

All versions ->

Upsert merchant custom attributeBeta

POST

 /v2/merchants/{merchant_id}/custom-attributes/{key}

Use this endpoint to set the value of a custom attribute for a specified merchant. A custom attribute is based on a custom attribute definition in a Square seller account, which is created using the CreateMerchantCustomAttributeDefinition endpoint. To create or update a custom attribute owned by another application, the visibility setting must be VISIBILITY_READ_WRITE_VALUES.

Permissions:MERCHANT_PROFILE_WRITE
Try in API Explorer
Link to section

Path parameters

Example code

Link to section

merchant_id

string

Required

Link to section

key

string

Required

The key of the custom attribute to create or update. This key must match the key of a custom attribute definition in the Square seller account. If the requesting application is not the definition owner, you must use the qualified key.

Link to section

Request body

Link to section

custom_attribute

Required

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 Supported data types.
  • The version field must match the current version of the custom attribute definition to enable optimistic concurrency If this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error.
Link to section

idempotency_key

string

A unique identifier for this request, used to ensure idempotency. For more information, see Idempotency.

Link to section

Response fields

Link to section

custom_attribute

The new or updated custom attribute.

Link to section

errors

Any errors that occurred during the request.