• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
List device codes BETA

Lists all DeviceCodes associated with the merchant.

Required permissions: DEVICE_CREDENTIAL_MANAGEMENT

Query Parameters

Name Description
cursor
string

A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query.

See Paginating results for more information.

location_id
string

If specified, only returns DeviceCodes of the specified location. Returns DeviceCodes of all locations if empty.

product_type
string

If specified, only returns DeviceCodes targeting the specified product type. Returns DeviceCodes of all product types if empty.

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

device_codes
DeviceCode [ ]

The queried DeviceCode.

cursor
string

A pagination cursor to retrieve the next set of results for your original query to the endpoint. This value is present only if the request succeeded and additional results are available.

See Paginating results for more information.

Examples

You are viewing an old version of the API
GET /v2/devices/codes
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
curl https://connect.squareup.com/v2/devices/codes \
  -H 'Square-Version: 2020-06-25' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json'
Response JSON
{
  "device_codes": [
    {
      "id": "B3Z6NAMYQSMTM",
      "name": "Counter 1",
      "code": "EBCARJ",
      "product_type": "TERMINAL_API",
      "location_id": "B5E4484SHHNYH",
      "created_at": "2020-02-06T18:44:33.000Z",
      "pair_by": "2020-02-06T18:49:33.000Z",
      "status": "PAIRED",
      "device_id": "907CS13101300122",
      "status_changed_at": "2020-02-06T18:47:28.000Z"
    },
    {
      "id": "YKGMJMYK8H4PQ",
      "name": "Unused device code",
      "code": "GVXNYN",
      "product_type": "TERMINAL_API",
      "location_id": "A6SYFRSV4WAFW",
      "pair_by": "2020-02-07T20:00:04.000Z",
      "created_at": "2020-02-07T19:55:04.000Z",
      "status": "UNPAIRED",
      "status_changed_at": "2020-02-07T19:55:04.000Z"
    }
  ]
}

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?