API: Products
Products in Recharge are pre-set plans that let you use the same pricing and intervals for a large number of customers.
Product Attributes
Parameter | Description |
---|---|
id | The unique identifier for the product. |
name | The name for the product. This can be displayed to the customer on outgoing emails and Hosted Payment Pages. |
setupfee | A one-time, up-front amount that is added to the amount the first time the customer is charged. |
price | Amount the customer will be charged per interval. |
intervalValue | Number that defines how often a charge should reoccur. For example, this would be the "1" in "charge my customer every 1 month." |
intervalUnit | Either "m" for month(s) or "d" for day(s). Defines whether the customer should be billed every X months or days. |
List Products
GET /products
Lists all your active products.
Get Product Details
GET /products/<product_id>
Returns the product's information in Recharge.
Response
<product id="pr4ea0d3a215297">
<id>pr4ea0d3a215297</id>
<name>Sample Product</name>
<setupFee>0.00</setupFee>
<price>19.99</price>
<intervalValue>1</intervalValue>
<intervalUnit>m</intervalUnit>
</product>
Create Product
POST /products
Creates a new product in Recharge and returns information about it.
Request
$fields['name'] = "$1/mo product with no setup fee";
$fields['setupFee'] = "0";
$fields['price'] = "1.00";
$fields['intervalValue'] = "1";
$fields['intervalUnit'] = "m";
Response
<product id="pr4ea0ceba132d2">
<id>pr4ea0ceba132d2</id>
<name>$1/mo product with no setup fee</name>
<setupFee>0.00</setupFee>
<price>1.00</price>
<intervalValue>1</intervalValue>
<intervalUnit>m</intervalUnit>
</product>
Edit Product
POST /products/<product_id>
Edits a product and returns the current information about it. Charges using this product for their pricing will use the new pricing or interval information the next time the card is charged.
Request
$fields['name'] = "$2/day product with $19.99 setup fee";
$fields['setupFee'] = "19.99";
$fields['price'] = "2.00";
$fields['intervalValue'] = "1";
$fields['intervalUnit'] = "d";
Response
<product id="pr4ea0ceba132d2">
<id>pr4ea0ceba132d2</id>
<name>$2/day product with $19.99 setup fee</name>
<setupFee>19.99</setupFee>
<price>2.00</price>
<intervalValue>1</intervalValue>
<intervalUnit>d</intervalUnit>
</product>
Delete Product
DELETE /products/<product_id>
Deletes the product from Recharge. Charges will not be able to use this pricing plan in the future, but charges already using this product will continue uninterrupted.