Copper provides an API for all major CRUD operations related to Accounts.
POST /accounts
Creates a new Account resource.
Many - but not all - properties of Account resources are accepted as parameters to this API. Specifically:
Parameter | Type | Required? | Description |
---|---|---|---|
type |
string | Required | The Copper Account type. Only accepts one of merchant or reseller . |
name |
string | Required | The name of the Account. |
email |
string | Required | The primary Account email address. |
address[country] |
string | Required | Two-letter country code (ISO 3166-1 alpha2) that Account exists in. |
address[line1] |
string | Optional | Address line 1 (e.g., street, PO Box, or company name). |
address[line2] |
string | Optional | Address line 2 (e.g., apartment, suite, unit, or building). |
address[city] |
string | Optional | City, district, suburb, town, or village. |
address[postal_code] |
string | Optional | ZIP or postal code. |
address[state] |
string | Optional | State, county, province, or region. |
phone |
string | Optional | The Account phone number. |
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. |
An Account resource if object creation was successful.
curl https://api.usecopper.com/next/accounts \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-d type=merchant \
-d "address[city]"=Reno \
-d "address[country]"=US \
-d "address[line1]"="10753 Harbottle Drive" \
-d "address[postal_code]"=89511 \
-d "address[state]"=NV \
-d name="Copper Inc." \
-d email="info@usecopper.com" \
-d phone="+1 (415) 793-8793"
GET /accounts/{id}
Retrieves an existing Account resource.
This API method only accepts a single parameter, the id
, via the URL path.
An Account resource if a valid id
was provided.
curl https://api.usecopper.com/next/accounts/someid \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX:
POST /accounts/{id}
Updates an existing Account resource.
Account properties that can be updated include address
, name
, email
, phone
and metadata
. To unset any of these parameters, post an empty value for them. Any ommitted parameters will be left unchanged.
Parameter | Type | Description |
---|---|---|
type |
string | The Copper Account type. Only accepts one of merchant or reseller . |
name |
string | The name of the Account. |
email |
string | The primary Account email address. |
address[country] |
string | Two-letter country code (ISO 3166-1 alpha2) that Account exists in. |
address[line1] |
string | Address line 1 (e.g., street, PO Box, or company name). |
address[line2] |
string | Address line 2 (e.g., apartment, suite, unit, or building). |
address[city] |
string | City, district, suburb, town, or village. |
address[postal_code] |
string | ZIP or postal code. |
address[state] |
string | State, county, province, or region. |
phone |
string | The Account phone number. |
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 Account resource if object update was successful.
curl https://api.usecopper.com/next/accounts/someid \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-d "address[city]"="Las Vegas"
GET /accounts
Returns one or more Account resources.
This API accepts pagination parameters.
An object containing the matching accounts, if any. The response data format is described in more detail in the pagination list response format documentation.
curl https://api.usecopper.com/next/accounts \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-d limit=3 \
-G
DELETE /accounts/{id}
Deletes an existing Account resource.
☢️ This API is currently disabled - it will abort and return an HTTP 501 status code.