Square OrderCustomAttributes API

The OrderCustomAttributes API from Square — 6 operation(s) for ordercustomattributes.

Documentation

📖
Documentation
https://developer.squareup.com/docs/payments-overview
📖
APIReference
https://developer.squareup.com/reference/square/payments-api
📖
Documentation
https://developer.squareup.com/docs/orders-api/what-it-does
📖
APIReference
https://developer.squareup.com/reference/square/orders-api
📖
Documentation
https://developer.squareup.com/docs/catalog-api/what-it-does
📖
APIReference
https://developer.squareup.com/reference/square/catalog-api
📖
Documentation
https://developer.squareup.com/docs/inventory-api/what-it-does
📖
APIReference
https://developer.squareup.com/reference/square/inventory-api
📖
Documentation
https://developer.squareup.com/docs/customers
📖
APIReference
https://developer.squareup.com/reference/square/customers-api
📖
Documentation
https://developer.squareup.com/docs/locations-api
📖
APIReference
https://developer.squareup.com/reference/square/locations-api
📖
Documentation
https://developer.squareup.com/docs/team/overview
📖
APIReference
https://developer.squareup.com/reference/square/team-api
📖
Documentation
https://developer.squareup.com/docs/labor-api/what-it-does
📖
APIReference
https://developer.squareup.com/reference/square/labor-api
📖
Documentation
https://developer.squareup.com/docs/bookings-api/what-it-is
📖
APIReference
https://developer.squareup.com/reference/square/bookings-api
📖
Documentation
https://developer.squareup.com/docs/loyalty-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/loyalty-api
📖
Documentation
https://developer.squareup.com/docs/gift-cards/using-gift-cards-api
📖
APIReference
https://developer.squareup.com/reference/square/gift-cards-api
📖
Documentation
https://developer.squareup.com/docs/invoices-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/invoices-api
📖
Documentation
https://developer.squareup.com/docs/subscriptions-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/subscriptions-api
📖
Documentation
https://developer.squareup.com/docs/checkout-api
📖
APIReference
https://developer.squareup.com/reference/square/checkout-api
📖
Documentation
https://developer.squareup.com/docs/terminal-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/terminal-api
📖
Documentation
https://developer.squareup.com/docs/payments-refunds
📖
APIReference
https://developer.squareup.com/reference/square/refunds-api
📖
Documentation
https://developer.squareup.com/docs/disputes-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/disputes-api
📖
Documentation
https://developer.squareup.com/docs/merchants-api
📖
APIReference
https://developer.squareup.com/reference/square/merchants-api
📖
Documentation
https://developer.squareup.com/docs/cards-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/cards-api
📖
Documentation
https://developer.squareup.com/docs/vendors-api/manage-vendors-in-apps
📖
APIReference
https://developer.squareup.com/reference/square/vendors-api
📖
Documentation
https://developer.squareup.com/docs/cashdrawershift-api/reporting
📖
APIReference
https://developer.squareup.com/reference/square/cash-drawers-api
📖
Documentation
https://developer.squareup.com/docs/bank-accounts-api
📖
APIReference
https://developer.squareup.com/reference/square/bank-accounts-api
📖
Documentation
https://developer.squareup.com/docs/payouts-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/payouts-api
📖
Documentation
https://developer.squareup.com/docs/web-payments/apple-pay
📖
APIReference
https://developer.squareup.com/reference/square/apple-pay-api
📖
Documentation
https://developer.squareup.com/docs/sites-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/sites-api
📖
Documentation
https://developer.squareup.com/docs/snippets-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/snippets-api
📖
Documentation
https://developer.squareup.com/docs/oauth-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/oauth-api
📖
Documentation
https://developer.squareup.com/docs/webhooks/overview
📖
APIReference
https://developer.squareup.com/reference/square/webhook-subscriptions-api
📖
Documentation
https://developer.squareup.com/docs/events-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/events-api
📖
Documentation
https://developer.squareup.com/docs/devices-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/devices-api
📖
Documentation
https://developer.squareup.com/docs/customer-groups-api/what-it-does
📖
APIReference
https://developer.squareup.com/reference/square/customer-groups-api
📖
Documentation
https://developer.squareup.com/docs/customer-segments-api/what-it-does
📖
APIReference
https://developer.squareup.com/reference/square/customer-segments-api
📖
Documentation
https://developer.squareup.com/docs/gift-cards/using-gift-card-activities-api
📖
APIReference
https://developer.squareup.com/reference/square/gift-card-activities-api
📖
Documentation
https://developer.squareup.com/docs/customer-custom-attributes-api/overview
📖
APIReference
https://developer.squareup.com/reference/square/customer-custom-attributes-api

Specifications

Other Resources

OpenAPI Specification

square-ordercustomattributes-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: '2.0'
  title: Square ApplePay OrderCustomAttributes API
  description: 'Supercharge Square for sellers of every size. Our entire connected commerce platform  from elegant hardware to a rich suite of Square APIs  is yours to build with. Whether youre developing an app or composing a bespoke solution, this is the place to make it happen. '
  termsOfService: https://connect.squareup.com/tos
  contact:
    name: Square Developer Platform
    email: developers@squareup.com
    url: https://squareup.com/developers
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  externalDocs:
    description: 'Read the official documentation here:'
    url: https://docs.connect.squareup.com/
  x-server-configuration:
    default-environment: production
    default-server: default
    environments:
    - name: production
      servers:
      - name: default
        url: https://connect.squareup.com
    - name: sandbox
      servers:
      - name: default
        url: https://connect.squareupsandbox.com
    - name: custom
      servers:
      - name: default
        url: '{custom_url}'
    parameters:
    - name: custom_url
      description: Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
      type: string
      example: https://connect.squareup.com
  x-square-generic-error-codes:
  - ACCESS_TOKEN_EXPIRED
  - ACCESS_TOKEN_REVOKED
  - API_VERSION_INCOMPATIBLE
  - APPLICATION_DISABLED
  - ARRAY_EMPTY
  - ARRAY_LENGTH_TOO_LONG
  - ARRAY_LENGTH_TOO_SHORT
  - BAD_CERTIFICATE
  - BAD_GATEWAY
  - BAD_REQUEST
  - CONFLICT
  - CONFLICTING_PARAMETERS
  - CURRENCY_MISMATCH
  - EXPECTED_ARRAY
  - EXPECTED_BASE64_ENCODED_BYTE_ARRAY
  - EXPECTED_BOOLEAN
  - EXPECTED_FLOAT
  - EXPECTED_INTEGER
  - EXPECTED_JSON_BODY
  - EXPECTED_MAP
  - EXPECTED_OBJECT
  - EXPECTED_STRING
  - FORBIDDEN
  - GATEWAY_TIMEOUT
  - GONE
  - IDEMPOTENCY_KEY_REUSED
  - INCORRECT_TYPE
  - INSUFFICIENT_SCOPES
  - INTERNAL_SERVER_ERROR
  - INVALID_ARRAY_VALUE
  - INVALID_CONTENT_TYPE
  - INVALID_CURSOR
  - INVALID_ENUM_VALUE
  - INVALID_FORM_VALUE
  - INVALID_SORT_ORDER
  - INVALID_SQUARE_VERSION_FORMAT
  - INVALID_TIME
  - INVALID_TIME_RANGE
  - INVALID_VALUE
  - LOCATION_MISMATCH
  - MAP_KEY_LENGTH_TOO_LONG
  - MAP_KEY_LENGTH_TOO_SHORT
  - MERCHANT_SUBSCRIPTION_NOT_FOUND
  - METHOD_NOT_ALLOWED
  - MISSING_REQUIRED_PARAMETER
  - NOT_ACCEPTABLE
  - NOT_FOUND
  - NOT_IMPLEMENTED
  - NO_FIELDS_SET
  - RATE_LIMITED
  - REQUEST_ENTITY_TOO_LARGE
  - REQUEST_TIMEOUT
  - SANDBOX_NOT_SUPPORTED
  - SERVICE_UNAVAILABLE
  - TOO_MANY_MAP_ENTRIES
  - UNAUTHORIZED
  - UNEXPECTED_VALUE
  - UNKNOWN_BODY_PARAMETER
  - UNKNOWN_QUERY_PARAMETER
  - UNPROCESSABLE_ENTITY
  - UNSUPPORTED_MEDIA_TYPE
  - V1_ACCESS_TOKEN
  - V1_APPLICATION
  - VALUE_EMPTY
  - VALUE_REGEX_MISMATCH
  - VALUE_TOO_HIGH
  - VALUE_TOO_LONG
  - VALUE_TOO_LOW
  - VALUE_TOO_SHORT
servers:
- url: https://connect.squareup.com
  variables: {}
tags:
- name: OrderCustomAttributes
paths:
  /v2/orders/custom-attribute-definitions:
    get:
      tags:
      - OrderCustomAttributes
      summary: Square List Order Custom Attribute Definitions
      operationId: ListOrderCustomAttributeDefinitions
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.


        When all response pages are retrieved, the results include all custom attribute definitions

        that are visible to the requesting application, including those that are created by other

        applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that

        seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_READ
      parameters:
      - name: visibility_filter
        description: Requests that all of the custom attributes be returned, or only those that are read-only or read-write.
        schema:
          $ref: '#/components/schemas/VisibilityFilter'
        in: query
        required: false
      - name: cursor
        description: "The cursor returned in the paged response from the previous call to this endpoint. \nProvide this cursor to retrieve the next page of results for your original request. \nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)."
        schema:
          type: string
        in: query
        required: false
      - name: limit
        description: "The maximum number of results to return in a single paged response. This limit is advisory. \nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. \nThe default value is 20.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)."
        schema:
          type: integer
        in: query
        required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOrderCustomAttributeDefinitionsResponse'
    post:
      tags:
      - OrderCustomAttributes
      summary: Square Create Order Custom Attribute Definition
      operationId: CreateOrderCustomAttributeDefinition
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: '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.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_WRITE
      parameters: []
      requestBody:
        required: true
        description: 'An object containing the fields to POST for the request.


          See the corresponding object definition for field details.'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderCustomAttributeDefinitionRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderCustomAttributeDefinitionResponse'
  /v2/orders/custom-attribute-definitions/{key}:
    delete:
      tags:
      - OrderCustomAttributes
      summary: Square Delete Order Custom Attribute Definition
      operationId: DeleteOrderCustomAttributeDefinition
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Deletes an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.


        Only the definition owner can delete a custom attribute definition.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_WRITE
      parameters:
      - name: key
        description: The key of the custom attribute definition to delete.
        schema:
          type: string
        in: path
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteOrderCustomAttributeDefinitionResponse'
    get:
      tags:
      - OrderCustomAttributes
      summary: Square Retrieve Order Custom Attribute Definition
      operationId: RetrieveOrderCustomAttributeDefinition
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Retrieves an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.


        To retrieve a custom attribute definition created by another application, the `visibility`

        setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes

        (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_READ
      parameters:
      - name: key
        description: The key of the custom attribute definition to retrieve.
        schema:
          type: string
        in: path
        required: true
      - name: version
        description: 'To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)

          control, include this optional field and specify the current version of the custom attribute.'
        schema:
          type: integer
        in: query
        required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieveOrderCustomAttributeDefinitionResponse'
    put:
      tags:
      - OrderCustomAttributes
      summary: Square Update Order Custom Attribute Definition
      operationId: UpdateOrderCustomAttributeDefinition
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Updates an order-related custom attribute definition for a Square seller account.


        Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_WRITE
      parameters:
      - name: key
        description: The key of the custom attribute definition to update.
        schema:
          type: string
        in: path
        required: true
      requestBody:
        required: true
        description: 'An object containing the fields to POST for the request.


          See the corresponding object definition for field details.'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrderCustomAttributeDefinitionRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateOrderCustomAttributeDefinitionResponse'
  /v2/orders/custom-attributes/bulk-delete:
    post:
      tags:
      - OrderCustomAttributes
      summary: Square Bulk Delete Order Custom Attributes
      operationId: BulkDeleteOrderCustomAttributes
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Deletes order [custom attributes](entity:CustomAttribute) as a bulk operation.


        Use this endpoint to delete one or more custom attributes from one or more orders.

        A custom attribute is based on a custom attribute definition in a Square seller account.  (To create a

        custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.)


        This `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual delete

        requests and returns a map of individual delete responses. Each delete request has a unique ID

        and provides an order ID and custom attribute. Each delete response is returned with the ID

        of the corresponding request.


        To delete 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`.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_WRITE
      parameters: []
      requestBody:
        required: true
        description: 'An object containing the fields to POST for the request.


          See the corresponding object definition for field details.'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkDeleteOrderCustomAttributesRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkDeleteOrderCustomAttributesResponse'
  /v2/orders/custom-attributes/bulk-upsert:
    post:
      tags:
      - OrderCustomAttributes
      summary: Square Bulk Upsert Order Custom Attributes
      operationId: BulkUpsertOrderCustomAttributes
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Creates or updates order [custom attributes](entity:CustomAttribute) as a bulk operation.


        Use this endpoint to delete one or more custom attributes from one or more orders.

        A custom attribute is based on a custom attribute definition in a Square seller account.  (To create a

        custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.)


        This `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert

        requests and returns a map of individual upsert responses. Each upsert request has a unique ID

        and provides an order ID and custom attribute. Each upsert response is returned with the ID

        of the corresponding request.


        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`.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_WRITE
      parameters: []
      requestBody:
        required: true
        description: 'An object containing the fields to POST for the request.


          See the corresponding object definition for field details.'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkUpsertOrderCustomAttributesRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkUpsertOrderCustomAttributesResponse'
  /v2/orders/{order_id}/custom-attributes:
    get:
      tags:
      - OrderCustomAttributes
      summary: Square List Order Custom Attributes
      operationId: ListOrderCustomAttributes
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Lists the [custom attributes](entity:CustomAttribute) associated with an order.


        You can use the `with_definitions` query parameter to also retrieve custom attribute definitions

        in the same call.


        When all response pages are retrieved, the results include all custom attributes that are

        visible to the requesting application, including those that are owned by other applications

        and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_READ
      parameters:
      - name: order_id
        description: The ID of the target [order](entity:Order).
        schema:
          type: string
        in: path
        required: true
      - name: visibility_filter
        description: Requests that all of the custom attributes be returned, or only those that are read-only or read-write.
        schema:
          $ref: '#/components/schemas/VisibilityFilter'
        in: query
        required: false
      - name: cursor
        description: "The cursor returned in the paged response from the previous call to this endpoint. \nProvide this cursor to retrieve the next page of results for your original request. \nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)."
        schema:
          type: string
        in: query
        required: false
      - name: limit
        description: "The maximum number of results to return in a single paged response. This limit is advisory. \nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. \nThe default value is 20.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)."
        schema:
          type: integer
        in: query
        required: false
      - name: with_definitions
        description: "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom attribute, \ninformation about the data type, or other definition details. The default value is `false`."
        schema:
          type: boolean
          default: false
        in: query
        required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOrderCustomAttributesResponse'
  /v2/orders/{order_id}/custom-attributes/{custom_attribute_key}:
    delete:
      tags:
      - OrderCustomAttributes
      summary: Square Delete Order Custom Attribute
      operationId: DeleteOrderCustomAttribute
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile.


        To delete 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`.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_WRITE
      parameters:
      - name: order_id
        description: The ID of the target [order](entity:Order).
        schema:
          type: string
        in: path
        required: true
      - name: custom_attribute_key
        description: 'The key of the custom attribute to delete.  This key must match the key of an

          existing custom attribute definition.'
        schema:
          type: string
        in: path
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteOrderCustomAttributeResponse'
    get:
      tags:
      - OrderCustomAttributes
      summary: Square Retrieve Order Custom Attribute
      operationId: RetrieveOrderCustomAttribute
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Retrieves a [custom attribute](entity:CustomAttribute) associated with an order.


        You can use the `with_definition` query parameter to also retrieve the custom attribute definition

        in the same call.


        To retrieve a custom attribute owned by another application, the `visibility` setting must be

        `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes

        also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_READ
      parameters:
      - name: order_id
        description: The ID of the target [order](entity:Order).
        schema:
          type: string
        in: path
        required: true
      - name: custom_attribute_key
        description: 'The key of the custom attribute to retrieve.  This key must match the key of an

          existing custom attribute definition.'
        schema:
          type: string
        in: path
        required: true
      - name: version
        description: 'To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)

          control, include this optional field and specify the current version of the custom attribute.'
        schema:
          type: integer
        in: query
        required: false
      - name: with_definition
        description: "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each \ncustom attribute. Set this parameter to `true` to get the name and description of each custom attribute, \ninformation about the data type, or other definition details. The default value is `false`."
        schema:
          type: boolean
          default: false
        in: query
        required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieveOrderCustomAttributeResponse'
    post:
      tags:
      - OrderCustomAttributes
      summary: Square Upsert Order Custom Attribute
      operationId: UpsertOrderCustomAttribute
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      description: 'Creates or updates a [custom attribute](entity:CustomAttribute) 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](api-endpoint:OrderCustomAttributes-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`.'
      x-release-status: BETA
      security:
      - oauth2:
        - ORDERS_WRITE
      parameters:
      - name: order_id
        description: The ID of the target [order](entity:Order).
        schema:
          type: string
        in: path
        required: true
      - name: custom_attribute_key
        description: "The key of the custom attribute to create or update.  This key must match the key \nof an existing custom attribute definition."
        schema:
          type: string
        in: path
        required: true
      requestBody:
        required: true
        description: 'An object containing the fields to POST for the request.


          See the corresponding object definition for field details.'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertOrderCustomAttributeRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpsertOrderCustomAttributeResponse'
components:
  schemas:
    ErrorCategory:
      type: string
      enum:
      - API_ERROR
      - AUTHENTICATION_ERROR
      - INVALID_REQUEST_ERROR
      - RATE_LIMIT_ERROR
      - PAYMENT_METHOD_ERROR
      - REFUND_ERROR
      - MERCHANT_SUBSCRIPTION_ERROR
      - EXTERNAL_VENDOR_ERROR
      x-enum-elements:
      - name: API_ERROR
        description: An error occurred with the Connect API itself.
      - name: AUTHENTICATION_ERROR
        description: 'An authentication error occurred. Most commonly, the request had

          a missing, malformed, or otherwise invalid `Authorization` header.'
      - name: INVALID_REQUEST_ERROR
        description: 'The request was invalid. Most commonly, a required parameter was

          missing, or a provided parameter had an invalid value.'
      - name: RATE_LIMIT_ERROR
        description: 'Your application reached the Square API rate limit. You might receive this error if your application sends a high number of requests

          to Square APIs in a short period of time.


          Your application should monitor responses for `429 RATE_LIMITED` errors and use a retry mechanism with an [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff)

          schedule to resend the requests at an increasingly slower rate. It is also a good practice to use a randomized delay (jitter) in your retry schedule.'
      - name: PAYMENT_METHOD_ERROR
        description: 'An error occurred while processing a payment method. Most commonly,

          the details of the payment method were invalid (such as a card''s CVV

          or expiration date).'
      - name: REFUND_ERROR
        description: An error occurred while attempting to process a refund.
      - name: MERCHANT_SUBSCRIPTION_ERROR
        description: An error occurred when checking a merchant subscription status
      - name: EXTERNAL_VENDOR_ERROR
        description: An error that is returned from an external vendor's API
      description: 'Indicates which high-level category of error has occurred during a

        request to the Connect API.'
      x-release-status: PUBLIC
    ErrorCode:
      type: string
      enum:
      - INTERNAL_SERVER_ERROR
      - UNAUTHORIZED
      - ACCESS_TOKEN_EXPIRED
      - ACCESS_TOKEN_REVOKED
      - CLIENT_DISABLED
      - FORBIDDEN
      - INSUFFICIENT_SCOPES
      - APPLICATION_DISABLED
      - V1_APPLICATION
      - V1_ACCESS_TOKEN
      - CARD_PROCESSING_NOT_ENABLED
      - MERCHANT_SUBSCRIPTION_NOT_FOUND
      - BAD_REQUEST
      - MISSING_REQUIRED_PARAMETER
      - INCORRECT_TYPE
      - INVALID_TIME
      - INVALID_TIME_RANGE
      - INVALID_VALUE
      - INVALID_CURSOR
      - UNKNOWN_QUERY_PARAMETER
      - CONFLICTING_PARAMETERS
      - EXPECTED_JSON_BODY
      - INVALID_SORT_ORDER
      - VALUE_REGEX_MISMATCH
      - VALUE_TOO_SHORT
      - VALUE_TOO_LONG
      - VALUE_TOO_LOW
      - VALUE_TOO_HIGH
      - VALUE_EMPTY
      - ARRAY_LENGTH_TOO_LONG
      - ARRAY_LENGTH_TOO_SHORT
      - ARRAY_EMPTY
      - EXPECTED_BOOLEAN
      - EXPECTED_INTEGER
      - EXPECTED_FLOAT
      - EXPECTED_STRING
      - EXPECTED_OBJECT
      - EXPECTED_ARRAY
      - EXPECTED_MAP
      - EXPECTED_BASE64_ENCODED_BYTE_ARRAY
      - INVALID_ARRAY_VALUE
      - INVALID_ENUM_VALUE
      - INVALID_CONTENT_TYPE
      - INVALID_FORM_VALUE
      - CUSTOMER_NOT_FOUND
      - ONE_INSTRUMENT_EXPECTED
      - NO_FIELDS_SET
      - TOO_MANY_MAP_ENTRIES
      - MAP_KEY_LENGTH_TOO_SHORT
      - MAP_KEY_LENGTH_TOO_LONG
      - CUSTOMER_MISSING_NAME
      - CUSTOMER_MISSING_EMAIL
      - INVALID_PAUSE_LENGTH
      - INVALID_DATE
      - UNSUPPORTED_COUNTRY
      - UNSUPPORTED_CURRENCY
      - APPLE_TTP_PIN_TOKEN
      - CARD_EXPIRED
      - INVALID_EXPIRATION
      - INVALID_EXPIRATION_YEAR
      - INVALID_EXPIRATION_DATE
      - UNSUPPORTED_CARD_BRAND
      - UNSUPPORTED_ENTRY_METHOD
      - INVALID_ENCRYPTED_CARD
      - INVALID_CARD
      - PAYMENT_AMOUNT_MISMATCH
      - GENERIC_DECLINE
      - CVV_FAILURE
      - ADDRESS_VERIFICATION_FAILURE
      - INVALID_ACCOUNT
      - CURRENCY_MISMATCH
      - INSUFFICIENT_FUNDS
      - INSUFFICIENT_PERMISSIONS
      - CARDHOLDER_INSUFFICIENT_PERMISSIONS
      - INVALID_LOCATION
      - TRANSACTION_LIMIT
      - VOICE_FAILURE
      - PAN_FAILURE
      - EXPIRATION_FAILURE
      - CARD_NOT_SUPPORTED
      - INVALID_PIN
      - MISSING_PIN
      - MISSING_ACCOUNT_TYPE
      - INVALID_POSTAL_CODE
      - INVALID_FEES
      - MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED
      - PAYMENT_LIMIT_EXCEEDED
      - GIFT_CARD_AVAILABLE_AMOUNT
      - ACCOUNT_UNUSABLE
      - BUYER_REFUSED_PAYMENT
      - DELAYED_TRANSACTION_EXPIRED
      - DELAYED_TRANSACTION_CANCELED
      - DELAYED_TRANSACTION_CAPTURED
      - DELAYED_TRANSACTION_FAILED
      - CARD_TOKEN_EXPIRED
      - CARD_TOKEN_USED
      - AMOUNT_TOO_HIGH
      - UNSUPPORTED_INSTRUMENT_TYPE
      - REFUND_AMOUNT_INVALID
      - REFUND_ALREADY_PENDING
      - PAYMENT_NOT_REFUNDABLE
      - PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE
      - REFUND_DECLINED
      - INSUFFICIENT_PERMISSIONS_FOR_REFUND
      - INVALID_CARD_DATA
      - SOURCE_USED
      - SOURCE_EXPIRED
      - UNSUPPORTED_LOYALTY_REWARD_TIER
      - LOCATION_MISMATCH
      - IDEMPOTENCY_KEY_REUSED
      - UNEXPECTED_VALUE
      - SANDBOX_NOT_SUPPORTED
      - INVALID_EMAIL_ADDRESS
      - INVALID_PHONE_NUMBER
      - CHECKOUT_EXPIRED
      - BAD_CERTIFICATE
      - INVALID_SQUARE_VERSION_FORMAT
      - API_VERSION_INCOMPATIBLE
      - CARD_PRESENCE_REQUIRED
      - UNSUPPORTED_SOURCE_TYPE
      - CARD_MISMATCH
      - PLAID_ERROR
      - PLAID_ERROR_ITEM_LOGIN_REQUIRED
      - PLAID_ERROR_RATE_LIMIT
      - CARD_DECLINED
      - VERIFY_CVV_FAILURE
      - VERIFY_AVS_FAILURE
      - CARD_DECLINED_CALL_ISSUER
      - CARD_DECLINED_VERIFICATION_REQUIRED
      - BAD_EXPIRATION
      - CHIP_INSERTION_REQUIRED
      - ALLOWABLE_PIN_TRIES_EXCEEDED
      - RESERVATION_DECLINED
      - UNKNOWN_BODY_PARAMETER
      - NOT_FOUND
      - APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND
      - METHOD_NOT_ALLOWED
      - NOT_ACCEPTABLE
      - REQUEST_TIMEOUT
      - CONFLICT
      - GONE
      - REQUEST_ENTITY_TOO_LARGE
      - UNSUPPORTED_MEDIA_TYPE
      - UNPROCESSABLE_ENTITY
      - RATE_LIMITED
      - NOT_IMPLEMENTED
      - BAD_GATEWAY
      - SERVICE_UNAVAILABLE
      - TEMPORARY_ERROR
      - GATEWAY_TIMEOUT
      x-enum-elements:
      - name: INTERNAL_SERVER_ERROR
        description: A general server error occurred.
        error-category: API_ERROR
      - name: UNAUTHORIZED
        description: A general authorization error occurred.
        error-category: AUTHENTICATION_ERROR
      - name: ACCESS_TOKEN_EXPIRED
        description: The provided access token has expired.
        error-category: AUTHENTICATION_ERROR
      - name: ACCESS_TOKEN_REVOKED
        description: The provided access token has been revoked.
        error-category: AUTHENTICATION_ERROR
      - name: CLIENT_DISABLED
        description: The provided client has been disabled.
        error-category: AUTHENTICATION_ERROR
      - name: FORBIDDEN
        description: A general access error occurred.
        error-category: AUTHENTICATION_ERROR
      - name: INSUFFICIENT_SCOPES
        description: 'The provided access token does not have permission

          to execute the requested action.'
        error-category: AUTHENTICATION_ERROR
      - name: APPLICATION_DISABLED
        description: The calling application was disabled.
        error-category: INVALID_REQUEST_ERROR
      - name: V1_APPLICATION
        description: 'The calling application was created prior to

          2016-03-30 and is not compatible with v2 Square API calls.'
        error-category: INVALID_REQUEST_ERROR
      - name: V1_ACCESS_TOKEN
        description: 'The calling application is using an access token

          created prior to 2016-03-30 and is not compatible with v2 Square API

          calls.'
        error-category: INVALID_REQUEST_ERROR
      - name: CARD_PROCESSING_NOT_ENABLED
        description: 'The location provided in the API call is not

          enabled for credit card processing.'
        error-category: INVALID_REQUEST_ERROR
      - name: MERCHANT_SUBSCRIPTION_NOT_FOUND
        description: A required subscription was not found for the merchant
        error-category: MERCHANT_SUBSCRIPTION_ERROR
      - name: BAD_REQUEST
        description: A general error occurred with the request.
        error-category: INVALID_REQUEST_ERROR
      - name: MISSING_REQUIRED_PARAMETER
        description: 'The request is missing a required path, query, or

          body parameter.'
        error-category: INVALID_REQUEST_ERROR
      - name: INCORRECT_TYPE
        description: 'The value provided in the request is the wrong

          type. For example, a string instead of an integer.'
        error-category: INVALID_REQUEST_ERROR
      - name: INVALID_TIME
        description: 'Formatting for the provided time value is

          incorrect.'
        error-category: INVALID_REQUEST_ERROR
      - name: INVALID_TIME_RANGE
        description: 'The time range provided in the request is invalid.

          For example, the end time is before the start time.'
        error-category: INVALID_REQUEST_ERROR
      - name: INVALID_VALUE
        description: 'The provided value is invalid. For example,

          including

# --- truncated at 32 KB (96 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/square/refs/heads/main/openapi/square-ordercustomattributes-api-openapi.yml