It looks like you're using Google Chrome - try our powerful new extension! Find out more.
x
 

API Documentation

JSON
 

Create Charge

Creates a charge in your connected gateway and returns the created object. Add the billing support URL to invoices and receipts so you know exactly what charge a customer is asking a question about.

This is a gateway method. This means that the status of this resource will be updated on gateway it originated from as well as on ChargeDesk. May not be supported on all gateways.

Parameters

customer[id] (required)
The ID of the customer you would like to charge.
Example: [email protected]
amount (required)
A string representing the amount the charge was for. This amount must be in decimal format with period (.) separating the whole and fractional parts, for example USD is displayed in the usual '29.90' format where the amount is 29 dollars and 90 cents. In German, € 1 234,56 becomes '1234.56'
Do not include the currency symbol such as $ or €
Example: 49.00
currency (required)
A 3 letter code representing the currency the charge was made in. Refer to the link below for a list of supported currency codes.
Example: USD
Refer to: https://chargedesk.com/api-docs#information-supported-currencies
description optional
Describes what this charge is for. Can be shown on receipts and invoices.
 

Request

POST https://api.chargedesk.com/v1/gateway/charges

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$charge = ChargeDesk_Gateway_Charge::create(array(
	"customer" => array(
		"id" => "[email protected]",
	)
	"amount" => "49.00",
	"currency" => "USD",
));

// $charge now contains the created Charge
echo $charge->support_url; // print the support url for this charge

Request Payment

Request a payment from a customer. Can be used to create once off charges, or charges for existing products including recurring charges.

This is a gateway method. This means that the status of this resource will be updated on gateway it originated from as well as on ChargeDesk. May not be supported on all gateways.

Parameters

contact optional
The email address of the customer to send an invoice to. If you have activated SMS payment requests, this can be a mobile phone number. ChargeDesk will recognise phone numbers in most formats, but we recommend including a country code for reliability. If not set, a payment request page will be generated only and no email or SMS will be sent.
Example: [email protected] or +1 (555) 555-5555
amount (required)
A string representing the amount the charge was for. This amount must be in decimal format with period (.) separating the whole and fractional parts, for example USD is displayed in the usual '29.90' format where the amount is 29 dollars and 90 cents. In German, € 1 234,56 becomes '1234.56'
Do not include the currency symbol such as $ or €
Example: 49.00
currency (required)
A 3 letter code representing the currency the charge was made in. Refer to the link below for a list of supported currency codes.
Example: USD
Refer to: https://chargedesk.com/api-docs#information-supported-currencies
quantity optional
The number of times this amount is applied. If provided, it must be a whole number great than 1.
Example: 2
description optional
Describes what this charge is for. Can be shown on receipts and invoices.
customer[id] optional
If this invoice is being sent to an existing customer, this field should be used to tie the charge to that customer.
product[product_id] optional
Only used when invoicing a product. Needs to match the ID of a product you have created or imported to ChargeDesk.
product[interval] optional
Only used when invoicing a product with a subscription. Choose how frequently the subscription is charged. Possible values are day, week, month or year.
product[interval_count] optional
Default: 1
Only used when invoicing a product with a subscription. Multiplies the interval to provide a frequency for the subscription. e.g for every 6 months provide an interval_count of '6' an and interval of 'month'.
product[trial_period_days] optional
Only used when invoicing a product with a subscription. The number of days which the trial period lasts. Enter 0 for none. Must be a positive integer.
product[coupon] optional
Only used when invoicing a product with a subscription. A coupon to apply agains this product. Must match a coupon ID in your payment gateway.
product[billing_cycles_total] optional
Only used when invoicing a product with a subscription. The maximum number of billing cycles for this subscription. Enter 0 or leave blank for unlimited. Must be a positive integer.
product[setup_amount] optional
An additional amount to charge when the subscription is initially created. Has the same requirements as the 'amount' field.

Request

POST https://api.chargedesk.com/v1/gateway/products/charge

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$request = ChargeDesk_Gateway_Product::charge(array(
	"contact" => "[email protected]",
	"amount" => "49.00",
	"currency" => "USD",
));

// $request now contains details of the payment request
echo $request->charge; // print the details of the created charge
echo $request->subscription; // print the details of the created subscription
echo $request->pay_link; // print the payment url for this request (if no email or phone number was set)

Refund Charge

Process a refund for a charge. Will return a success of failure from the originating payment gateway.

This is a gateway method. This means that the status of this resource will be updated on gateway it originated from as well as on ChargeDesk. May not be supported on all gateways.

Parameters

amount optional
A partial amount you wish to refund on the charge. If not provided, the full amount of the charge will be refunded.
Example: 21.00

Request

POST https://api.chargedesk.com/v1/gateway/charges/{CHARGE_ID}/refund

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$charge = ChargeDesk_Gateway_Charge::refund("{CHARGE_ID}");

Capture Charge

Capture or void an authorized charge. Will return a success of failure from the originating payment gateway.

This is a gateway method. This means that the status of this resource will be updated on gateway it originated from as well as on ChargeDesk. May not be supported on all gateways.

Parameters

amount optional
An amount you wish to capture on the charge. If not provided, the full amount of the authorized charge will be captured. If set to 0, the authorized charge will be voided.
Example: 21.00

Request

POST https://api.chargedesk.com/v1/gateway/charges/{CHARGE_ID}/capture

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$charge = ChargeDesk_Gateway_Charge::capture("{CHARGE_ID}");

Cancel Subscription

Cancels any future recurring charges through original payment gateway it was created. May not be supported on all gateways.

This is a gateway method. This means that the status of this resource will be updated on gateway it originated from as well as on ChargeDesk. May not be supported on all gateways.

Request

POST https://api.chargedesk.com/v1/gateway/subscriptions/{SUBSCRIPTION_ID}/cancel

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$subscription = ChargeDesk_Gateway_Subscription::cancel("{SUBSCRIPTION_ID}");

Cancel Payment Request

Cancel the payment request. The payment page will show that the charge no longer needs to be paid.

This is a gateway method. This means that the status of this resource will be updated on gateway it originated from as well as on ChargeDesk. May not be supported on all gateways.

Request

POST https://api.chargedesk.com/v1/gateway/charges/{CHARGE_ID}/void

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$charge = ChargeDesk_Gateway_Charge::void("{CHARGE_ID}");

List all

Get all charges associated with the secret key provided in the request

Parameters

count optional
Default: 20
Number of charges to return per request in the response. Must be between 1 and 500
offset optional
Default: 0
Position to start returning charges from. Used to paginate through all charges.
customer[id] optional
Only return charges from customers matching this customer id.
customer[email] optional
Only return charges from customers matching this email.
customer[name] optional
Only return charges from customers matching this name.
customer[username] optional
Only return charges from customers matching this username.
customer[country] optional
Only return charges from customers matching this country.
occurred[max] optional
Maximum seconds since epoch (unix timestamp) that charges must have occurred before.
occurred[min] optional
Minimum seconds since epoch (unix timestamp) that charges must have occurred after.

Request

GET https://api.chargedesk.com/v1/charges

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$charges = ChargeDesk_Charge::find(array(
	"count" => "2",
));

Create

Saves a charge and returns a billing support URL. Add the billing support URL to invoices and receipts so you know exactly what charge a customer is asking a question about.

Parameters

amount (required)
A string representing the amount the charge was for. This amount must be in decimal format with period (.) separating the whole and fractional parts, for example USD is displayed in the usual '29.90' format where the amount is 29 dollars and 90 cents. In German, € 1 234,56 becomes '1234.56'
Do not include the currency symbol such as $ or €
Example: 49.00
currency (required)
A 3 letter code representing the currency the charge was made in. Refer to the link below for a list of supported currency codes.
Example: USD
Refer to: https://chargedesk.com/api-docs#information-supported-currencies
customer[id] (required)
A unique string which all charges from the same customer share. This could be an email address, username or user id.
Example: [email protected]
customer[email] optional
Email address of the customer who this charge is for. Optional, but highly recommended. If an email address is used for the customer[id], and no other address is provided, this field will be automatically populated with the customer[id].
customer[username] optional
The username this customer users to login into your system. Optional, but highly recommended. If not provided, the customer[email] value will be used if available.
customer[name] optional
Full name of the customer who this charge is for.
Example: James Peter
customer[description] optional
Some additional information useful in describing this customer to support agents.
customer[delinquent] optional
Default: false
Is there a problem with the payments of this customer not being processed?
customer[country] optional
Two-letter ISO code of the country where the customer is located.
Example: US
status optional
Default: paid
The current state of this charge. Can be 'pending', 'paid', 'failed', 'partially refunded' or 'refunded'.
amount_refunded optional
A string representing how much of the charge has been refunded if partially refunded. This amount must be in decimal format with the same conditions as the 'amount' parameter.
Example: 24.50
last_4_digits optional
Last 4 digits of the credit card used to create this charge.
transaction_id optional
A unique string of your choice that can be used to identify this transaction in your system. You can use it as an identifier to know when a charge has been refunded through a webhook.
description optional
A short string describing what this charge is for. Displayed to users when they are querying why a charge was made.
product[id] optional
An identifier which ties all charges for the same product together. Used to provide additional information to the customer about what the charge was for.
product[name] optional
The name of the product as your customers will understand it.
product[description] optional
A few sentences explaining what the product is.
product[url] optional
A url where more information can be found about this product, such as a product page on your website.
subscriptions[][id] optional
Used to identify recurring charges. All charges for a subscription should share the same subscription id. Required if providing a subscription in a charge.
subscriptions[][status] optional
Default: active
Has current status of this subscription. Possible values are 'trialing', 'active', 'past_due', 'cancelled' or 'unpaid'.
subscriptions[][amount] optional
The amount that this subscription is for.
subscriptions[][currency] optional
The currency that this subscription uses.
subscriptions[][interval] optional
How frequently the subscription is charged. Possible values are day, week, month or year.
subscriptions[][interval_count] optional
Default: 1
Multiplies the interval to provide a frequency for the subscription. e.g for every 6 months provide an interval_count of '6' an and interval of 'month'.
gateway_id optional
The id of gateway which this charge occurred through. Will be set to the default gateway associated with your account if not provided. You can find the gateway id associated with a gateway on the setup page for your company.
Example: stripe
occurred optional
Default: The current time since epoch will be used.
The time in seconds since epoch when the charge was made (unix timestamp). This can be used to import charges that occurred in the past into ChargeDesk. Must be equal to or less than current time since epoch.
Example: 1361191994

Request

POST https://api.chargedesk.com/v1/charges

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$charge = ChargeDesk_Charge::create(array(
	"amount" => "49.00",
	"currency" => "USD",
	"customer" => array(
		"id" => "[email protected]",
	)
));

// $charge now contains the created Charge
echo $charge->support_url; // print the support url for this charge

Retrieve

Retrieves a charge that has previously been created.

Request

GET https://api.chargedesk.com/v1/charges/{CHARGE_ID}

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$charge = ChargeDesk_Charge::retrieve("{CHARGE_ID}");

Update

Updates an existing charge with new information.

Parameters

amount optional
A string representing the amount the charge was for. This amount must be in decimal format with period (.) separating the whole and fractional parts, for example USD is displayed in the usual '29.90' format where the amount is 29 dollars and 90 cents. In German, € 1 234,56 becomes '1234.56'
Do not include the currency symbol such as $ or €
Example: 49.00
currency optional
A 3 letter code representing the currency the charge was made in. Refer to the link below for a list of supported currency codes.
Example: USD
Refer to: https://chargedesk.com/api-docs#information-supported-currencies
customer[id] optional
A unique string which all charges from the same customer share. This could be an email address, username or user id.
Example: [email protected]
status optional
Default: paid
The current state of this charge. Can be 'paid', 'failed' or 'refunded'.
last_4_digits optional
Last 4 digits of the credit card used to create this charge.
transaction_id optional
A unique string of your choice that can be used to identify this transaction in your system. You can use it as an identifier to know when a charge has been refunded through a webhook.
description optional
A short string describing what this charge is for. Displayed to users when they are querying why a charge was made.
product[id] optional
An identifier which ties all charges for the same product together. Used to provide additional information to the customer about what the charge was for.
subscription[id] optional
Used to identify recurring charges. All charges for a subscription should share the same subscription id. Sent back in webhooks when subscriptions are modified.
gateway_id optional
The id of gateway which this charge occurred through. Will be set to the default gateway associated with your account if not provided. You can find the gateway id associated with a gateway on the setup page for your company.
Example: stripe
occurred optional
Default: The current time since epoch will be used.
The time in seconds since epoch when the charge was made (unix timestamp). This can be used to import charges that occurred in the past into ChargeDesk. Must be equal to or less than current time since epoch.
Example: 1361191994

Request

POST https://api.chargedesk.com/v1/charges/{CHARGE_ID}

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$charge = ChargeDesk_Charge::update("{CHARGE_ID}", array(
	"status" => "refunded",
));

Create

Used to tie all charges from the same person together.

Parameters

customer_id (required)
A unique string which all charges from the same customer share. This could be an email address, username or user id.
Example: [email protected]
email optional
Email address of the customer who this charge is for. Optional, but highly recommended. If an email address is used for the customer[id], and no other address is provided, this field will be automatically populated with the customer[id].
username optional
The username this customer users to login into your system. Optional, but highly recommended. If not provided, the customer[email] value will be used if available.
name optional
Full name of the customer who this charge is for.
Example: James Peter
country optional
Two-letter ISO code of the country where the customer is located.
Example: US
tax_number_abr optional
Tax ID Abbreviation. Generally 3-4 letters such as GST or VAT.
Example: VAT
tax_number optional
Tax ID. This is an alphanumeric tax identification for the customer. It is listed on invoices in the case of VAT can be used to determine if the invoice should have 0% tax applied.
Example: 123 123 1234
invoice_details optional
This is generally the full address for the customer, as listed on invoices. It can be formatted in multiple lines.
Example: 12 Example Street London, United Kingdom

Request

POST https://api.chargedesk.com/v1/customers

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$customer = ChargeDesk_Customer::create(array(
	"customer_id" => "[email protected]",
	"country" => "US",
));

List all

Get all customers associated with the secret key provided in the request

Parameters

count optional
Default: 20
Number of customers to return per request in the response. Must be between 1 and 500
offset optional
Default: 0
Position to start returning customers from. Used to paginate through all customers.
id optional
Only return customers matching this customer id.
email optional
Only return customers matching this email.
name optional
Only return customers matching this name.
username optional
Only return customers matching this username.
country optional
Only return customers matching this country.

Request

GET https://api.chargedesk.com/v1/customers

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$customers = ChargeDesk_Customer::find(array(
	"count" => "2",
));

Retrieve

Retrieves a customer that has previously been created.

Request

GET https://api.chargedesk.com/v1/customers/{CUSTOMER_ID}

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$customer = ChargeDesk_Customer::retrieve("{CUSTOMER_ID}");

Update

Update the data stored for an existing customer.

Parameters

customer_id optional
A unique string which all charges from the same customer share. This could be an email address, username or user id.
Example: [email protected]
email optional
Email address of the customer who this charge is for. Optional, but highly recommended. If an email address is used for the customer[id], and no other address is provided, this field will be automatically populated with the customer[id].
username optional
The username this customer users to login into your system. Optional, but highly recommended. If not provided, the customer[email] value will be used if available.
name optional
Full name of the customer who this charge is for.
Example: James Peter
country optional
Two-letter ISO code of the country where the customer is located.
Example: US
tax_number_abr optional
Tax ID Abbreviation. Generally 3-4 letters such as GST or VAT.
Example: VAT
tax_number optional
Tax ID. This is an alphanumeric tax identification for the customer. It is listed on invoices in the case of VAT can be used to determine if the invoice should have 0% tax applied.
Example: 123 123 1234
invoice_details optional
This is generally the full address for the customer, as listed on invoices. It can be formatted in multiple lines.
Example: 12 Example Street London, United Kingdom

Request

POST https://api.chargedesk.com/v1/customers/{CUSTOMER_ID}

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$customer = ChargeDesk_Customer::update("{CUSTOMER_ID}", array(
	"username" => "example",
));

Grouped

Gets the structured billing history for a customer. Used for assisting agents to solve support requests. As much data as possible should be provided for most accurate results.

Parameters

customer[id] optional
Looks for customers & charges matching this id
customer[email] optional
Looks for customers & charges matching this email.
customer[username] optional
Looks for customers & charges matching this username.
customer[name] optional
Looks for customers & charges matching this name.
customer[phone] optional
Looks for customers & charges matching this phone number.
query optional
A text string to find matching customers & charges. Can be a name, email address, username, phone number or last 4 digits of a credit card. If provided, the other parameters are ignored.

Request

GET https://api.chargedesk.com/v1/customers/grouped

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$grouped = ChargeDesk_Customer::grouped(array(
	"customer[email]" => "[email protected]",
));

Create

Retrieves the data stored for a subscription.

Parameters

subscription_id (required)
Used to identify recurring charges. All charges for a subscription should share the same subscription id. Sent back in webhooks when subscriptions are modified.
customer_id optional
The ID of the customer that this subscription is associated with.
status optional
Default: active
Has current status of this subscription. Possible values are active or cancelled.
gateway_id optional
The id of gateway which this subscription occurred through. Will be set to the default gateway associated with your account if not provided. You can find the gateway id associated with a gateway on the setup page for your company.
Example: stripe
amount optional
The amount that this subscription is for. Must be a decimal value.
currency optional
The currency that this subscription uses.
Refer to: https://chargedesk.com/api-docs#information-supported-currencies
interval optional
How frequently the subscription is charged. Possible values are day, week, month or year.

Request

POST https://api.chargedesk.com/v1/subscriptions

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$subscription = ChargeDesk_Subscription::create(array(
	"subscription_id" => "{SUBSCRIPTION_ID}",
	"customer_id" => "{CUSTOMER_ID}",
	"amount" => "49.00",
	"currency" => "USD",
	"interval" => "month",
));

List all

Get all subscriptions associated with the secret key provided in the request

Parameters

count optional
Default: 20
Number of subscriptions to return per request in the response. Must be between 1 and 500
offset optional
Default: 0
Position to start returning subscriptions from. Used to paginate through all subscriptions.

Request

GET https://api.chargedesk.com/v1/subscriptions

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$subscriptions = ChargeDesk_Subscription::find(array(
	"count" => "2",
));

Retrieve

Retrieves a subscription that has previously been created.

Request

GET https://api.chargedesk.com/v1/subscriptions/{SUBSCRIPTION_ID}

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$subscription = ChargeDesk_Subscription::retrieve("{SUBSCRIPTION_ID}");

Update

Update the data stored for an existing subscription.

Parameters

subscription_id optional
Used to identify recurring charges. All charges for a subscription should share the same subscription id. Sent back in webhooks when subscriptions are modified.
customer_id optional
The ID of the customer that this subscription is associated with.
status optional
Default: active
Has current status of this subscription. Possible values are active or cancelled.
gateway_id optional
The id of gateway which this subscription occurred through. Will be set to the default gateway associated with your account if not provided. You can find the gateway id associated with a gateway on the setup page for your company.
Example: stripe
amount optional
The amount that this subscription is for. Must be a decimal value.
currency optional
The currency that this subscription uses.
Refer to: https://chargedesk.com/api-docs#information-supported-currencies
interval optional
How frequently the subscription is charged. Possible values are day, week, month or year.

Request

POST https://api.chargedesk.com/v1/subscriptions/{SUBSCRIPTION_ID}

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$subscription = ChargeDesk_Subscription::update("{SUBSCRIPTION_ID}", array(
	"status" => "cancelled",
));

Create

Creates a new product. Products are a general way of associating charges for the same type of sale together.

Parameters

product_id (required)
An identifier which ties all charges for the same product together. Used to provide additional information to the customer about what the charge was for.
name optional
The name of the product as your customers will understand it.
description optional
A few sentences explaining what the product is.
url optional
A url where more information can be found about this product, such as a product page on your website.

Request

POST https://api.chargedesk.com/v1/products

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$product = ChargeDesk_Product::create(array(
	"product_id" => "pro",
	"name" => "Pro",
	"description" => "A premium subscription",
));

List all

Get all products associated with the secret key provided in the request

Parameters

count optional
Default: 20
Number of products to return per request in the response. Must be between 1 and 500
offset optional
Default: 0
Position to start returning products from. Used to paginate through all products.

Request

GET https://api.chargedesk.com/v1/products

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$products = ChargeDesk_Product::find(array(
	"count" => "2",
));

Retrieve

Retrieves a product that has previously been created.

Request

GET https://api.chargedesk.com/v1/products/{PRODUCT_ID}

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$product = ChargeDesk_Product::retrieve("{PRODUCT_ID}");

Update

Update the data stored for an existing product.

Parameters

name optional
The name of the product as your customers will understand it.
description optional
A few sentences explaining what the product is.
url optional
A url where more information can be found about this product, such as a product page on your website.

Request

POST https://api.chargedesk.com/v1/products/{PRODUCT_ID}

Example PHP Code

// Include the PHP library
include_once "chargedesk-php/bootstrap.php";

// Set your secret key
ChargeDesk::apiKey("YOUR_SECRET_KEY");

// Perform API request
$product = ChargeDesk_Product::update("{PRODUCT_ID}", array(
	"name" => "New Name",
));

API Authentication

The ChargeDesk API is authenticated using HTTP Basic Authentication. Pass your secret key in the basic auth username. A password is not required.

Each company you create on ChargeDesk has their own secret key and must have API access enabled. You can turn on API access for your company and find your secret key at https://chargedesk.com/connect/api

Every piece of example code on the page contains all the authentication information you need. If you login with your account and visit this page, your secret key from the last company you looked at will be filled out for you (if the API is active for that company).

Supported Currencies

Below is a list of all currency codes supported by ChargeDesk.

Please note that in order to create a charge in a currency, it must be supported by your connected payment gateways.

AED
United Arab Emirates Dirham

AFN
Afghan Afghani

ALL
Albanian Lek

AMD
Armenian Dram

ANG
Netherlands Antillean Guilder

AOA
Angolan Kwanza

ARS
Argentine Peso

AUD
Australian Dollar

AWG
Aruban Florin

AZN
Azerbaijani Manat

BAM
Bosnia-Herzegovina Convertible Mark

BBD
Barbadian Dollar

BDT
Bangladeshi Taka

BGN
Bulgarian Lev

BHD
Bahraini Dinar

BIF
Burundian Franc

BMD
Bermudan Dollar

BND
Brunei Dollar

BOB
Bolivian Boliviano

BRL
Brazilian Real

BSD
Bahamian Dollar

BTC
Bitcoin

BTN
Bhutanese Ngultrum

BWP
Botswanan Pula

BYN
Belarusian Ruble

BYR
Belarusian Ruble (pre-2016)

BZD
Belize Dollar

CAD
Canadian Dollar

CDF
Congolese Franc

CHF
Swiss Franc

CLF
Chilean Unit of Account (UF)

CLP
Chilean Peso

CNH

CNY
Chinese Yuan

COP
Colombian Peso

CRC
Costa Rican Colón

CUC
Cuban Convertible Peso

CUP
Cuban Peso

CVE
Cape Verdean Escudo

CZK
Czech Republic Koruna

DJF
Djiboutian Franc

DKK
Danish Krone

DOP
Dominican Peso

DZD
Algerian Dinar

EEK
Estonian Kroon

EGP
Egyptian Pound

ERN
Eritrean Nakfa

ETB
Ethiopian Birr

EUR
Euro

FJD
Fijian Dollar

FKP
Falkland Islands Pound

GBP
British Pound Sterling

GEL
Georgian Lari

GGP
Guernsey Pound

GHS
Ghanaian Cedi

GIP
Gibraltar Pound

GMD
Gambian Dalasi

GNF
Guinean Franc

GTQ
Guatemalan Quetzal

GYD
Guyanaese Dollar

HKD
Hong Kong Dollar

HNL
Honduran Lempira

HRK
Croatian Kuna

HTG
Haitian Gourde

HUF
Hungarian Forint

IDR
Indonesian Rupiah

ILS
Israeli New Sheqel

IMP
Manx pound

INR
Indian Rupee

IQD
Iraqi Dinar

IRR
Iranian Rial

ISK
Icelandic Króna

JEP
Jersey Pound

JMD
Jamaican Dollar

JOD
Jordanian Dinar

JPY
Japanese Yen

KES
Kenyan Shilling

KGS
Kyrgystani Som

KHR
Cambodian Riel

KMF
Comorian Franc

KPW
North Korean Won

KRW
South Korean Won

KWD
Kuwaiti Dinar

KYD
Cayman Islands Dollar

KZT
Kazakhstani Tenge

LAK
Laotian Kip

LBP
Lebanese Pound

LKR
Sri Lankan Rupee

LRD
Liberian Dollar

LSL
Lesotho Loti

LTL
Lithuanian Litas

LVL
Latvian Lats

LYD
Libyan Dinar

MAD
Moroccan Dirham

MDL
Moldovan Leu

MGA
Malagasy Ariary

MKD
Macedonian Denar

MMK
Myanma Kyat

MNT
Mongolian Tugrik

MOP
Macanese Pataca

MRO
Mauritanian Ouguiya

MTL
Maltese Lira

MUR
Mauritian Rupee

MVR
Maldivian Rufiyaa

MWK
Malawian Kwacha

MXN
Mexican Peso

MYR
Malaysian Ringgit

MZN
Mozambican Metical

NAD
Namibian Dollar

NGN
Nigerian Naira

NIO
Nicaraguan Córdoba

NOK
Norwegian Krone

NPR
Nepalese Rupee

NZD
New Zealand Dollar

OMR
Omani Rial

PAB
Panamanian Balboa

PEN
Peruvian Nuevo Sol

PGK
Papua New Guinean Kina

PHP
Philippine Peso

PKR
Pakistani Rupee

PLN
Polish Zloty

PYG
Paraguayan Guarani

QAR
Qatari Rial

RON
Romanian Leu

RSD
Serbian Dinar

RUB
Russian Ruble

RWF
Rwandan Franc

SAR
Saudi Riyal

SBD
Solomon Islands Dollar

SCR
Seychellois Rupee

SDG
Sudanese Pound

SEK
Swedish Krona

SGD
Singapore Dollar

SHP
Saint Helena Pound

SLL
Sierra Leonean Leone

SOS
Somali Shilling

SRD
Surinamese Dollar

SSP

STD
São Tomé and Príncipe Dobra

SVC
Salvadoran Colón

SYP
Syrian Pound

SZL
Swazi Lilangeni

THB
Thai Baht

TJS
Tajikistani Somoni

TMT
Turkmenistani Manat

TND
Tunisian Dinar

TOP
Tongan Paʻanga

TRY
Turkish Lira

TTD
Trinidad and Tobago Dollar

TWD
New Taiwan Dollar

TZS
Tanzanian Shilling

UAH
Ukrainian Hryvnia

UGX
Ugandan Shilling

USD
United States Dollar

UYU
Uruguayan Peso

UZS
Uzbekistan Som

VEF
Venezuelan Bolívar Fuerte

VND
Vietnamese Dong

VUV
Vanuatu Vatu

WST
Samoan Tala

XAF
CFA Franc BEAC

XAG
Silver (troy ounce)

XAU
Gold (troy ounce)

XCD
East Caribbean Dollar

XDR
Special Drawing Rights

XOF
CFA Franc BCEAO

XPD
Palladium Ounce

XPF
CFP Franc

XPT
Platinum Ounce

YER
Yemeni Rial

ZAR
South African Rand

ZMK
Zambian Kwacha (pre-2013)

ZMW
Zambian Kwacha

ZWL
Zimbabwean Dollar