v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
CustomerCustomAttributes

UpsertCustomerCustomAttribute

Creates or updates a custom attribute for a customer profile.

Use this endpoint to set the value of a custom attribute for a specified customer profile. A custom attribute is based on a custom attribute definition in a Square seller account, which is created using the CreateCustomerCustomAttributeDefinition 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.

post/v2/customers/{customer_id}/custom-attributes/{key}

Path parameters

customer_idstring required

The ID of the target customer profile.

keystring 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.

Request body

idempotency_keystring nullable

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

Example request

{
  "custom_attribute": {
    "value": "Dune"
  }
}

Response

Success

Example response

{
  "custom_attribute": {
    "created_at": "2022-04-26T15:50:27Z",
    "key": "favoritemovie",
    "updated_at": "2022-04-26T15:50:27Z",
    "value": "Dune",
    "version": 1,
    "visibility": "VISIBILITY_READ_ONLY"
  }
}