v1

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

CreateMerchantCustomAttributeDefinition

Creates a merchant-related custom attribute definition for a Square seller account. Use this endpoint to define a custom attribute that can be associated with a merchant connecting to your application. A custom attribute definition specifies the key, visibility, schema, and other properties for a custom attribute. After the definition is created, you can call UpsertMerchantCustomAttribute or BulkUpsertMerchantCustomAttributes to set the custom attribute for a merchant.

post/v2/merchants/custom-attribute-definitions

Request body

idempotency_keystring

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

Example request

{
  "custom_attribute_definition": {
    "description": "This is the other name this merchant goes by.",
    "key": "alternative_seller_name",
    "name": "Alternative Merchant Name",
    "schema": {
      "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String"
    },
    "visibility": "VISIBILITY_READ_ONLY"
  }
}

Response

Success

Example response

{
  "custom_attribute_definition": {
    "created_at": "2023-05-05T19:06:36.559Z",
    "description": "This is the other name this merchant goes by.",
    "key": "alternative_seller_name",
    "name": "Alternative Merchant Name",
    "schema": {
      "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String"
    },
    "updated_at": "2023-05-05T19:06:36.559Z",
    "version": 1,
    "visibility": "VISIBILITY_READ_ONLY"
  }
}