<- Devices API

Devices API

Create device code

POST

 /v2/devices/codes

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

Permissions:DEVICE_CREDENTIAL_MANAGEMENT
Try in API Explorer
Link to section

Request body

Example code

Link to section

idempotency_key

string

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.

Link to section

device_code

Required

The device code to create.

Link to section

Response fields

Link to section

errors

Any errors that occurred during the request.

Link to section

device_code

The created DeviceCode object containing the device code string.