Devices API

Copper provides an API for all major CRUD operations related to Devices.

Create a Device

POST /devices

Creates a new Device resource. Only merchant accounts are able to create devices.

Parameters

Many - but not all - properties of Device resources are accepted as parameters to this API. Specifically:

Parameter Type Required? Description
registration_code string Required A code generated by the device used for registering to an account.
location string Optional The location to assign the device to. If no location is specified, the device will be assigned to the account's default location.
label string Optional A custom label assigned to the device for easier identification. If no label is specified, the registration code will be used.
metadata object Optional Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

Returns

A Device resource if object creation was successful.

Example

curl https://api.usecopper.com/next/devices \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
    -d registration_code="sale-put-catch" \
    -d location=loc_XXXXXXXXXXXX

Retrieve a Device

GET /devices/{id}

Retrieves an existing Device resource.

Parameters

This API method only accepts a single parameter, the id, via the URL path.

Returns

An Device resource if a valid id was provided.

Example

curl https://api.usecopper.com/next/devices/someid \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX:

Update a Device

POST /devices/{id}

Updates an existing Device resource.

Parameters

Device properties that can be updated include label and metadata. To unset any of these parameters, post an empty value for them. Any ommitted parameters will be left unchanged.

Parameter Type Description
label string A custom label assigned to the device for easier identification. If no label is specified, the registration code will be used.
metadata object Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

Returns

The updated Device resource if object update was successful.

Example

curl https://api.usecopper.com/next/devices/someid \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
    -d label="Terminal 1"

List Devices

GET /devices

Returns one or more Device resources.

Parameters

This API accepts the base pagination parameters. In addition, you may provide the following parameters to further refine your query:

Parameter Type Required? Description
device_type string Optional Filters returned devices by device type. Possibly values include: copper_Cord, poynt_P5, poynt_P6, pax_A60, pax_A77, pax_A920 and clover_Flex.
location string Optional A location identifier to filter the response list to only devices at the specified location.
status string Optional Provides a means of filtering results to only devices that are online or offline by specifying online or offline for this parameter, respectively.

Returns

An object containing the matching devices, if any. The response data format is described in more detail in the pagination list response format documentation.

Example

curl https://api.usecopper.com/next/devices \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
    -d limit=3 \
    -G

Delete a Location

DELETE /devices/{id}

Deletes an existing Device resource.

Parameters

This API method only accepts a single parameter, the id, via the URL path.

Returns

A Device resource if a valid id was provided.

Example

curl https://api.usecopper.com/next/devices/someid \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
    -X DELETE