v1

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

CreateOrderCustomAttributeDefinition

Creates an order-related custom attribute definition. Use this endpoint to define a custom attribute that can be associated with orders.

After creating a custom attribute definition, you can set the custom attribute for orders in the Square seller account.

post/v2/orders/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": "The number of people seated at a table",
    "key": "cover-count",
    "name": "Cover count",
    "schema": {
      "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number"
    },
    "visibility": "VISIBILITY_READ_WRITE_VALUES"
  },
  "idempotency_key": "IDEMPOTENCY_KEY"
}

Response

Success

Example response

{
  "custom_attribute_definition": {
    "created_at": "2022-10-06T16:53:23.141Z",
    "description": "The number of people seated at a table",
    "key": "cover-count",
    "name": "Cover count",
    "schema": {
      "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number"
    },
    "updated_at": "2022-10-06T16:53:23.141Z",
    "version": 1,
    "visibility": "VISIBILITY_READ_WRITE_VALUES"
  }
}