Copper provides an API for all major CRUD operations related to Devices.
POST /devices
Creates a new Device resource. Only merchant accounts are able to create devices.
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. |
A Device resource if object creation was successful.
curl https://api.usecopper.com/next/devices \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-d registration_code="sale-put-catch" \
-d location=loc_XXXXXXXXXXXX
GET /devices/{id}
Retrieves an existing Device resource.
This API method only accepts a single parameter, the id
, via the URL path.
An Device resource if a valid id
was provided.
curl https://api.usecopper.com/next/devices/someid \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX:
POST /devices/{id}
Updates an existing Device resource.
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. |
The updated Device resource if object update was successful.
curl https://api.usecopper.com/next/devices/someid \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-d label="Terminal 1"
GET /devices
Returns one or more Device resources.
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. |
An object containing the matching devices, if any. The response data format is described in more detail in the pagination list response format documentation.
curl https://api.usecopper.com/next/devices \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-d limit=3 \
-G
DELETE /devices/{id}
Deletes an existing Device resource.
This API method only accepts a single parameter, the id
, via the URL path.
A Device resource if a valid id
was provided.
curl https://api.usecopper.com/next/devices/someid \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-X DELETE