v1

latestOpenAPI 3.0.0Apache 2.02026-07-142008071.1 MB
Devices

CreateDeviceCode

Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected terminal mode.

post/v2/devices/codes

Request body

idempotency_keystring required

A unique string that identifies this CreateDeviceCode request. Keys can be any valid string but must be unique for every CreateDeviceCode request.

See Idempotency keys for more information.

Example request

{
  "request_body": {
    "device_code": {
      "location_id": "B5E4484SHHNYH",
      "name": "Counter 1",
      "product_type": "TERMINAL_API"
    },
    "idempotency_key": "01bb00a6-0c86-4770-94ed-f5fca973cd56"
  }
}

Response

Success

Example response

{
  "device_code": {
    "code": "EBCARJ",
    "created_at": "2020-02-06T18:44:33.000Z",
    "id": "B3Z6NAMYQSMTM",
    "location_id": "B5E4484SHHNYH",
    "name": "Counter 1",
    "pair_by": "2020-02-06T18:49:33.000Z",
    "product_type": "TERMINAL_API",
    "status": "UNPAIRED",
    "status_changed_at": "2020-02-06T18:44:33.000Z"
  }
}