Accounts API

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

Create an Account

POST /accounts

Creates a new Account resource.

Parameters

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.

Returns

An Account resource if object creation was successful.

Example

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"

Retrieve an Account

GET /accounts/{id}

Retrieves an existing Account resource.

Parameters

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

Returns

An Account resource if a valid id was provided.

Example

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

Update an Account

POST /accounts/{id}

Updates an existing Account resource.

Parameters

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.

Returns

The updated Account resource if object update was successful.

Example

curl https://api.usecopper.com/next/accounts/someid \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
    -d "address[city]"="Las Vegas"

List Accounts

GET /accounts

Returns one or more Account resources.

Parameters

This API accepts pagination parameters.

Returns

An object containing the matching accounts, 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/accounts \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
    -d limit=3 \
    -G

Delete an Account

DELETE /accounts/{id}

Deletes an existing Account resource.

☢️ This API is currently disabled - it will abort and return an HTTP 501 status code.