Core Resources
Charges
A charge is the representation of a financial transaction linked to the purchase of an item (past or future). It can be a transaction that was processed already or the representation of an upcoming transaction. A
Charge is linked to its corresponding Orders (one Order for pay as you go subscriptions and several for pre-paid). Orders are created once the corresponding Charge is successful. After successful payment, the first Order will be immediately submitted to the external platform if applicable (e.g. Shopify, BigCommerce).75 additions in V2, marked New
Everything marked New also works when you send X-Recharge-Version: 2021-11.

#The charge object
A
A
Charge is the representation of the financial transaction linked to a purchase (past or future). It can be a transaction that was processed already or the representation of an upcoming transaction. A charge is linked to its corresponding Orders (one for pay as you go subscriptions and several for pre-paid).A
Charge can have many parent subscriptions. All subscriptions on a given Address with the same next_charge_date date will be merged into one Charge and that charge will contain one line_item per Subscription.Attributes
- idintegerThe unique numeric identifier for the
Charge. - address_idintegerThe ID of the shipping
Addresstied to theCharge. - analytics_dataobjectAn object containing analytics data associated with the
Charge.Show child attributesHide child attributes1
- utm_paramsarray of objectsAn array containing
utm_paramobjects.Show child attributesHide child attributes7
- utm_campaignstringThe UTM campaign.
- utm_contentstringThe UTM content.
- utm_data_sourcestringThe source of the campaign parameter.
- utm_sourcestringThe UTM source.
- utm_mediumstringThe UTM medium.
- utm_termstringThe UTM term.
- utm_timestampstringThe UTM timestamp.
- billing_addressobjectAll the billing information related to the charge.
Show child attributesHide child attributes10
- address1stringLine one of the billing address.
- address2stringLine two of the billing address.
- citystringThe city of the billing address.
- companystringThe company name of the billing address.
- country_codestring2-letter country code.
- first_namestringThe first name of the billing address.
- last_namestringThe last name of the billing address.
- phonestringThe phone number of the billing address.
- provincestringThe name of the province or state associated with the billing address.
- zipstringThe zip code or postcode of the address.
- client_detailsobjectDetails of the access method used by the purchaser.
Show child attributesHide child attributes2
- browser_ipstringThe IP address of the buyer as detected in
Checkout. - user_agentstringThe user agent detected during
Checkout.
- The ID of the variant, as it appears in the external e-commerce platform, that could not be found when the
Chargewas processed.Only returned when theChargehas astatusoferror. - Specifies whether the
Chargeis scheduled for a regeneration (if theSubscriptionrelated to the charge was updated in the last 5 seconds usingcommit=false). - An object containing the related resources requested with the
includequery parameter.Only returned when theincludequery parameter is passed.Show child attributesHide child attributes1034 new
- The
Addressassociated with theCharge.Only returned whenincludecontainsaddress. - The
BundleSelectionassociated with theCharge.Only returned whenincludecontainsbundle_selections. Populated only for stores with charge-level bundle selections enabled; otherwisenull. - An array of charge activity objects recorded for the
Chargein the last 90 days.Only returned whenincludecontainscharge_activities. - The credits the
Chargeis projected to redeem when it processes, in the currency of theCharge.nullwhen theChargedoes not have astatusofqueuedorerror, or when the projection could not be built.Only returned byGET /charges/{id}whenincludecontainscredit_projection.Show child attributesHide child attributes77 new
- An object keyed by credit type. Each value contains
amount, the additional credit that type would have contributed if no products were excluded, andexcluded_product_ids, the external product IDs on theChargethat the credit type cannot be spent on. - Whether the store's maximum redemption limit would hold back non-gift credit if the
Customeropted in to applying credit. - The code of the currency the projected amounts are expressed in.
- The amount of gift credit the
Chargeis projected to redeem. - The amount of non-gift credit the
Chargeis projected to redeem. - The total amount of credit the
Chargewill redeem if nothing changes. - The total amount of credit the
Chargewould redeem if theCustomerhadapply_credit_to_next_recurring_chargeset totrue.
- The
Customerassociated with theCharge.Only returned whenincludecontainscustomer. - An array of
Metafieldsattached to theCharge.Only returned whenincludecontainsmetafields. - An array of the modifications, such as added free gifts, applied to the
Charge.Only returned whenincludecontainsorder_modifications.Show child attributesHide child attributes710 new
- The unique numeric identifier for the order modification.
- The ID of the
Chargethe modification applies to. - The ID of the
Orderthe modification applies to. - The ID of the
Customerthe modification belongs to. - An object containing the changes applied to the
Charge.Show child attributesHide child attributes33 new
- An array of line item modifications. Each item contains
line_item_id,subscription_id,modification_type,source,source_id,reason,reason_idand amodificationsarray of changed attributes (attribute,value,previous_value,reason,created_at). - Whether the modification can be carried over to the new queued
Chargewhen thisChargeis replaced. - An array of modifications that apply to the whole
Chargerather than to a single line item.
- The date and time when the order modification was created.
- The date and time when the order modification was last updated.
- An array of
PaymentMethodsassociated with theCharge.Only returned whenincludecontainspayment_methods. - An array of the
Subscriptionscontained in theCharge.Only returned whenincludecontainssubscriptions. - An array of the payment transactions recorded for the
Charge.Only returned whenincludecontainstransactions.Show child attributesHide child attributes77 new
- The ID of the transaction in the payment processor system.
- The payment processor used for the transaction.
- The amount of the transaction.
- The kind of transaction, such as
saleorrefund. - The ID of the
PaymentMethodused for the transaction. - Whether the transaction is the primary transaction of the
Charge. - The date and time when the transaction was created.
- The date and time of the most recent attempt to process the
Charge.Only returned when theChargehas astatusoferror. - The date and time when the
Chargewas last merged with anotherCharge. - The date the
Chargewas scheduled to process when it was first created. This value does not change if theChargeis rescheduled. - The sum of all duties applied to the
Charge. - created_atdatetimeThe date and time when the transaction was created.
- currencystringThe code of the currency for this
Charge, such asUSD.Related guides: Supported currencies - customerobjectAn object containing
Customerinformation associated with thisCharge.Show child attributesHide child attributes4
- idintegerThe ID of the associated customer record.
- emailstringThe user email.
- external_customer_idobjectAn object containing customer information associated with this charge.
Show child attributesHide child attributes1
- ecommercestringThe customer ID as it appears in the external e-commerce platform.
- hashstringThe hash of the
Customerassociated with theCharge.
- discountsarray of objectsAn array of
Discountsassociated with theCharge.Show child attributesHide child attributes62 new
- idintegerThe ID of the
Discount. - codestringThe code of the
Discount. - valuefloatThe value of the
Discount. - value_typestringThe type of the value of the
Discount.Possible valuespercentagefixed_amountshipping - The title of the
Discount.Populated only for stores with automatic discounts enabled; otherwisenull. - How the
Discountis applied, either through a code or automatically.Possible valuescodeautomaticPopulated only for stores with automatic discounts enabled; otherwisenull.
- errorstringError reason as sentence text (typically returned direct from the payment processor). e.g.
"error": "Customer needs to update credit card" - error_typestringStructured reason why the charge failed such as
CUSTOMER_NEEDS_TO_UPDATE_CARD. - charge_attemptsintegerShows how many times an attempt to charge was placed. Only returned when the
Chargehas astatusoferror. - external_order_idobjectAn object containing the associated external order ID.
Show child attributesHide child attributes1
- ecommercestringThe order ID as it appears in the external e-commerce platform.
- external_transaction_idobjectAn object containing the associated external transaction ID.
Show child attributesHide child attributes1
- payment_processorstringThe ID of the associated transaction in a payment processor system (like Stripe).
- line_itemsarray of objectsA list of
line_itemobjects, each containing information about a distinct purchase item.Show child attributesHide child attributes226 new
- An object containing the ID of the associated line item as it appears in the external system.Only returned for stores that have external line item IDs enabled.
Show child attributesHide child attributes11 new
- The line item ID as it appears in the external e-commerce platform.Only returned for stores that have external line item IDs enabled.
- An object describing the offer that added the
line_itemto theCharge, such as a free gift.nullwhen theline_itemwas not added by an offer. - purchase_item_idintegerThe
SubscriptionorOnetimeID associated with theline_item. - external_product_idobjectAn object containing the associated product ID as it appears in the external system.
Show child attributesHide child attributes1
- ecommercestringThe product id as it appears in the external e-commerce platform. The
external_product_idof theProductrecord in Recharge, linking aPlanto aProduct.
- external_variant_idobjectAn object containing the associated variant ID as it appears in the external system.
Show child attributesHide child attributes1
- ecommercestringThe variant id as it appears in the external e-commerce platform. The
external_variant_idof theProductrecord in Recharge, linking aPlanto aProduct.
- gramsintegerThe weight of the item in grams.
- handlestringA unique, human-friendly string for the
Product. - imagesobjectAn object containing URLs of the
Productimage. - original_pricestringThe original price of the
line_itemwithout discounts or taxes. - propertiesarray of objectsAn array of name value pairs of additional
line_itemattributes. - purchase_item_typestringAn indicator of the type of the purchase item.Possible values
subscriptiononetime - quantityintegerThe quantity of the
line_item. - skustringThe SKU (stock keeping unit) of the
Productassociated with theline_item. - tax_duestringThe total tax due associated with the
line_item. - tax_linesarray of objectsan array containing
tax_lineobjects associated with thisline_item.Show child attributesHide child attributes41 new
- taxablebooleanA boolean indicating if the
line_itemis taxable or non-taxable. - taxable_amountstringThe taxable revenue associated with the
line_item. - titlestringThe title of the
Productof thisline_item. - total_pricestringThe total price of the
line_itemincluding tax. - unit_pricestringThe unit price of the
line_item. - unit_price_includes_taxbooleanA boolean indicator if tax is included in the price of an item.
- variant_titlestringThe name of a variant of the
Productof thisline_item.
- notestringNotes associated with the
Charge. - order_attributesarray of objectsAn array of name-value pairs of order attributes on the
Charge. - orders_countintegerThe number of
Ordersgenerated from thisCharge(>1 for prepaidSubscriptions). - payment_processorstringThe payment processor used for this
Charge. - processed_atdatetimeThe date and time when the transaction was processed.
- retry_datedatetimeThe date when the next attempt will be placed.
- scheduled_atdateThe date time of when the
Chargeis/was scheduled to process. - shipping_addressobjectThe shipping
Addressof theCharge.Show child attributesHide child attributes10
- address1stringLine one of the billing address.
- address2stringLine two of the billing address.
- citystringThe city of the billing address.
- companystringThe company name of the billing address.
- country_codestring2-letter country code.
- first_namestringThe first name of the billing address.
- last_namestringThe last name of the billing address.
- phonestringThe phone number of the billing address.
- provincestringThe name of the province or state associated with the billing address.
- zipstringThe zip code or postcode of the address.
- shipping_linesarray of objectsAn array of shipping lines associated with the
Charge.Show child attributesHide child attributes93 new
- codestringThe code associated with the
shipping_lineof aCharge. - pricestringThe price of the
shipping_line. - sourcestringThe source of the
shipping_line. - titlestringThe title of the
shipping_line. - taxablebooleanA boolean indicating if the
shipping_lineis taxable. - tax_linesarray of objectsAn array of tax lines associated with the
shipping_line. - The rate associated with the
shipping_line.Only returned when a rate is stored on theshipping_line. - The status of the shipping rate used for the
shipping_line. Defaults toactive.Possible valuesactivependingqueued - The date and time when the shipping rate of the
shipping_linewas last retrieved.
- statusstringThe status of the
Charge.Possible valuessuccesserrorqueuedskippedrefundedpartially_refundedpending_manual_paymentpending - subtotal_pricestringThe combined price of all
line_itemswithout taxes and shipping. - tax_linesarray of objectsAn array of tax lines that apply to the
Charge. - taxablebooleanA boolean indicator of the taxability of the
Charge. - taxes_includedbooleanWhether taxes are included in the order subtotal.
- total_discountsstringThe sum of the
Discountsapplied to theCharge. - total_line_items_pricestringThe total price of all line items of the
Charge. - total_pricestringThe sum of all the prices of all the items in the
Charge, taxes and discounts included (must be positive). - total_refundsstringThe sum of all refunds that were applied to the
Charge. - total_taxstringThe total tax due associated with the
Charge. - total_weight_gramsintegerThe total weight of the
Charge’s line items in grams. - typestringAn indicator of the
Charge’s type, either checkout or recurring.Possible valuescheckoutrecurring - updated_atdatetimeThe date time at which the
Chargewas most recently updated.
{
"charge": {
"id": 100714428,
"address_id": 21317826,
"analytics_data": {
"utm_params": [
{
"utm_campaign": "spring_sale",
"utm_content": "differentiate-content",
"utm_data_source": "cookie",
"utm_medium": "email",
"utm_source": "newsletter",
"utm_term": "test-term",
"utm_time_stamp": "2019-12-16T23:57:28.752Z"
}
]
},
"billing_address": {
"address1": "3030 Nebraska Avenue",
"address2": null,
"city": "Los Angeles",
"company": null,
"country_code": "US",
"first_name": "Mike",
"last_name": "Flynn",
"phone": "3103843698",
"province": "California",
"zip": "90404"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2018-11-14T09:45:44+00:00",
"currency": "USD",
"customer": {
"id": 12345,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "10DOLLAROFF",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_XXXXXXXXXXXXXXX"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "99999999999"
},
"grams": 4536,
"images": {
"large": "https://cdn.shopify.com/s/files/1/0175/0695/9460/products/Sumatra_Coffee_large.png",
"medium": "https://cdn.shopify.com/s/files/1/0175/0695/9460/products/Sumatra_Coffee__medium.png",
"original": "https://cdn.shopify.com/s/files/1/0175/0695/9460/products/Sumatra_Coffee_.png",
"small": "https://cdn.shopify.com/s/files/1/0175/0695/9460/products/Sumatra_Coffee__small.png"
},
"original_price": "12.00",
"properties": [
{
"name": "grind",
"value": "drip"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "MILK-1",
"tax_due": "1.14",
"tax_lines": [
{
"price": "0.870",
"rate": 0.0725,
"title": "CA State Tax",
"unit_price": "0.870"
},
{
"price": "0.270",
"rate": 0.0225,
"title": "Los Angeles County Tax",
"unit_price": "0.270"
}
],
"taxable": true,
"taxable_amount": "12.00",
"title": "Sumatra Coffee",
"total_price": "13.14",
"unit_price": "12.00",
"variant_title": "Milk - a / b"
}
],
"merged_at": null,
"note": "next order #1",
"order_attributes": [
{
"name": "custom name",
"value": "custom value"
}
],
"original_scheduled_at": "2018-12-12",
"processor_name": "stripe",
"scheduled_at": "2018-12-12",
"shipping_address": {
"address1": "3030 Nebraska Avenue",
"address2": "",
"city": "Los Angeles",
"company": "Recharge",
"country": "United States",
"first_name": "Mike",
"last_name": "Flynn",
"phone": "3103843698",
"province": "California",
"zip": "90404"
},
"shipping_lines": [
{
"code": "Standard Shipping",
"price": "0.00",
"title": "Standard Shipping",
"status": "active",
"retrieved_at": null
}
],
"status": "queued",
"subtotal_price": "12.00",
"tags": "Subscription",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxes_included": true,
"total_discounts": "0.00",
"total_duties": "0.00",
"total_line_items_price": "12.00",
"total_price": "13.14",
"total_refunds": null,
"total_tax": "1.14",
"total_weight_grams": 4536,
"type": "recurring",
"updated_at": "2018-11-14T09:45:44+00:00"
}
}#Retrieve a charge
GET/charges/{id}
Retrieve a
Charge using the charge_id.Scope
read_ordersStarting March 19th, 2025, processed charges (those where status equals success, refunded, or partially-refunded) that have a value for processed_at greater than 90 days in the past will no longer appear in responses. As a result, you may receive an error.
Charge data processed over 90 days ago will remain available through the Exports tool in the Recharge merchant portal and within the Merchant portal UI.
Example of unaffected API calls:
[RETRIEVE A CHARGE]
Example of API calls that will result in an error:
[RETRIEVE A CHARGE]
Charge data processed over 90 days ago will remain available through the Exports tool in the Recharge merchant portal and within the Merchant portal UI.
Example of unaffected API calls:
[RETRIEVE A CHARGE]
/charges/{id} (if it's a charge that does not have a processed_at date or the processed_at date is within the last 90 days) Example of API calls that will result in an error:
[RETRIEVE A CHARGE]
/charges/{id} (if it's a charge with a processed_at date older than 90 days)Query parameters
- A comma-separated list of related resources to return under the
includeattribute of theCharge. Each value also requires the read scope of the included resource (credit_projectionrequiresread_credit_summary).Possible valuesaddressbundle_selectionscharge_activitiescredit_projectioncustomermetafieldsorder_modificationspayment_methodssubscriptionstransactions
curl 'https://api.rechargeapps.com/charges/377749210' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": "2021-11-09T23:59:31+00:00",
"retry_date": "2021-01-01",
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "success",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"taxes_included": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}#List charges
GET/charges
Returns a list of
Charges.HTTP request examples
GET /charges?address_id=:address_idGET /charges?created_at_min=2016-05-18&created_at_max=2016-06-18GET /charges?customer_id=:customer_idGET /charges?discount_code=10PERCENTOFFGET /charges?discount_id=:discount_idGET /charges?external_order_id=:external_order_idGET /charges?ids=1123551,262667345,12341535GET /charges?purchase_item_id=:purchase_item_idGET /charges?scheduled_at=2016-06-18GET /charges?scheduled_at_min=2016-05-18&scheduled_at_max=2016-06-18GET /charges?sort_by=id-descGET /charges?status=queuedGET /charges?status=queued,refunded,partially_refundedGET /charges?updated_at_min=2016-05-18&updated_at_max=2016-06-18GET /charges?processed_at_min=2022-01-18&processed_at_max=2022-02-18Scope
read_ordersStarting March 19th, 2025, processed charges (those where status equals success, refunded, or partially- refunded) that have a value for processed_at greater than 90 days in the past will no longer appear in responses. As a result, you may receive a partial data set or an empty list.
Charge data processed over 90 days ago will remain available through the Exports tool in the Recharge merchant portal and within the Merchant portal UI.
Examples of unaffected API calls:
[LIST CHARGES]
[LIST CHARGES]
Examples of API calls that may return partial results:
[LIST CHARGES]
[LIST CHARGES]
Example of API calls that will result in an empty list:
[LIST CHARGES]
Reminder: returned charges are sorted ascending by id value by default.
When
Charge data processed over 90 days ago will remain available through the Exports tool in the Recharge merchant portal and within the Merchant portal UI.
Examples of unaffected API calls:
[LIST CHARGES]
/charges?status=queued [LIST CHARGES]
/charges?status=error Examples of API calls that may return partial results:
[LIST CHARGES]
/charges?processed_at_min=2024-01-01 (this would only return results that have a processed_at date in the last 90 days)[LIST CHARGES]
/charges?status=success,queued (this would return all queued charges but only return success charges that have a processed_at date in the last 90 days)Example of API calls that will result in an empty list:
[LIST CHARGES]
/charges?processed_at_max=2024-01-01 (any date over 90 days old)Reminder: returned charges are sorted ascending by id value by default.
When
ids is passed, all other filters, sorting and pagination parameters are ignored, and a maximum of 250 IDs is accepted.Query parameters
- address_idstringFilter
ChargesbyAddress. - created_at_maxstringShow
Chargescreated before the given date. - created_at_minstringShow
Chargescreated after the given date. - The
next_cursororprevious_cursorvalue returned by a previous call, used to retrieve the next or previous page of results. When passed, the only other parameter that can be passed islimit. - Filter
Chargesby the email address of theCustomer. - customer_idstringFilter
ChargesbyCustomer. - discount_codestringList
Chargesthat contain the givendiscount_code. - discount_idstringList
Chargesthat contain the givendiscount_id. - Filter
Chargesinerrorstatus by a comma-separated list of error types, such asCARD_DECLINED. Requiresstatusto includeerror. - external_order_idstringFilter
Chargesby the associated order ID in the external e-commerce platform. - Filter
Chargesby a comma-separated list of product IDs, as they appear in the external e-commerce platform, contained in theCharge. - Filter
Chargesby a comma-separated list of variant IDs, as they appear in the external e-commerce platform, contained in theCharge. - idsstringFilter
Chargesby ID.If passing multiple values, must be comma separated. Non-integer values will result in a422error. - A comma-separated list of related resources to return under the
includeattribute of eachCharge. Each value also requires the read scope of the included resource.Possible valuesaddressbundle_selectionscharge_activitiescustomermetafieldsorder_modificationspayment_methodssubscriptionstransactions - limitstringThe amount of results.
- Exclude
Chargeswhoseerror_typematches one of the given comma-separated values. OnlyChargesthat have anerror_typeare returned. - The page to show.Page-based pagination has been deprecated but still available to use for pages up to a 100. If you need data past this point, use cursor pagination.
- purchase_item_idstringFilter
Chargesby aSubscriptionorOnetimeID. - purchase_item_idsstringFilter
Chargesby a comma-separated list ofSubscriptionorOnetimeIDs. - scheduled_atstringFilter
Chargesby specific scheduled charge date. - scheduled_at_maxstringShow
Chargesscheduled to be processed before the given date. - scheduled_at_minstringShow
Chargesscheduled to be processed after the given date. - sort_bystringSort listed
Chargesin a specific order.
Available sort options:id-asc,id-desc,updated_at-asc,updated_at-desc,scheduled_at-asc,scheduled_at-desc.Possible valuesid-ascid-desccreated_at-asccreated_at-descupdated_at-ascupdated_at-descscheduled_at-ascscheduled_at-desc - statusstringFilter charges by status.
Available status:success,queued,error,refunded,partially_refunded,skipped,pending_manual_payment,pending.Possible valuessuccessqueuederrorrefundedpartially_refundedskippedpending_manual_paymentpending_manual_payment_overduepending - updated_at_maxstringShow charges updated before the given date.
- updated_at_minstringShow charges updated after the given date.
- processed_at_minstringShow charges processed after, and including, the given date.
- processed_at_maxstringShow charges processed before, and including, the given date.
curl 'https://api.rechargeapps.com/charges?limit=3' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"next": "next_cursor",
"previous": "previous_cursor",
"charges": [
{
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": "2021-11-09T23:59:31+00:00",
"retry_date": "2021-01-01",
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "success",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"taxes_included": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
]
}#Apply a discount
POST/charges/{id}/apply_discount
Endpoint for adding
Discount to an existing queued Charge.Scope
write_ordersYou cannot add a
You can provide either
If a
Discount to an existing queued Charge if the Charge or the associated Address already has one.You can provide either
discount_id or discount_code. If both parameters are passed, the value for discount_id will take precedence.If a
Charge has a Discount and it gets updated, or a regeneration occurs, the Discount will be lost. Regeneration is a process that refreshes the Charge JSON with new data in the case of the Subscription or Address being updated.Body parameters
- discount_codestringCode of the
Discountyou want to apply to aCharge. - discount_idintegerID of the
Discountyou want to apply to aCharge.
Response attributes
- idintegerUnique numeric identifier for the
Address. - payment_method_idintegerUnique numeric identifier for the
Payment Methodassociated to theAddress. - address1stringThe street associated with the
Address. - address2stringAny additional information associated with the
Address. - citystringThe city associated with the address.
- companystringThe company associated with the address.
- country_codestring2-letter country code.
- customer_idintegerUnique numeric identifier for the customer associated with the address.
- discountsarray of objectsA discount which will be applied on the address. While the
discountsparameter is an array, only a single discount code will be applied. If multiple discount codes are provided, only the first discount in the array will apply to the address.Show child attributesHide child attributes1
- idintegerThe id of a discount associated with this address.
- first_namestringThe customer’s first name associated with the address.
- last_namestringThe customer’s last name associated with the address.
- order_attributesarray of objectsReplaces cart_attributes. Extra information that is added to the order.
- order_notestringNotes to be added to all orders associated with the address.
- phonestringThe phone number associated with the address.
- The currency on the subscription contract in Shopify.Only set if the currency is different from the store-level currency. Else, will default to store-level currency.
- provincestringThe state or province associated with the address.
- shipping_lines_conservedarray of objectsShipping rates that have previously been overridden via
shipping_lines_overridebut are currently inactive. - shipping_lines_overridearray of objectsUsed when shipping rates need to be overridden.If this parameter has value
null, rates will be fetched whenChargeis created or regenerated - zipstringThe zip or postal code associated with the address.
- created_atdatetimeThe date and time when the address was created.
- updated_atdatetimeThe date and time when the address was last updated.
curl -X POST 'https://api.rechargeapps.com/charges/105805051/apply_discount' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"discount_code": "test"
}'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": "2021-11-09T23:59:31+00:00",
"retry_date": "2021-01-01",
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "success",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}#Remove a discount
POST/charges/{id}/remove_discount
Remove a
Discount from a Charge without destroying the Discount.HTTP request examples
POST /charges/<charge_id>/remove_discount/Scope
write_ordersIn most cases the
If the
Discount should be removed from the Address. When the Discount is removed from the Address, the Discount is also removed from any future Charges.If the
Discount is on the parent Address, you cannot remove it using charge_id. When removing your Discount, it is preferable to pass the address_id so that the Discount stays removed if the Charge is regenerated. Only pass charge_id in edge cases in which there are two or more Charges on a parent Address and you only want to remove the Discount from one Charge. If you pass both parameters, it will remove the Discount from the Address.Response attributes
- idintegerUnique numeric identifier for the
Address. - payment_method_idintegerUnique numeric identifier for the
Payment Methodassociated to theAddress. - address1stringThe street associated with the
Address. - address2stringAny additional information associated with the
Address. - citystringThe city associated with the address.
- companystringThe company associated with the address.
- country_codestring2-letter country code.
- customer_idintegerUnique numeric identifier for the customer associated with the address.
- discountsarray of objectsA discount which will be applied on the address. While the
discountsparameter is an array, only a single discount code will be applied. If multiple discount codes are provided, only the first discount in the array will apply to the address.Show child attributesHide child attributes1
- idintegerThe id of a discount associated with this address.
- first_namestringThe customer’s first name associated with the address.
- last_namestringThe customer’s last name associated with the address.
- order_attributesarray of objectsReplaces cart_attributes. Extra information that is added to the order.
- order_notestringNotes to be added to all orders associated with the address.
- phonestringThe phone number associated with the address.
- The currency on the subscription contract in Shopify.Only set if the currency is different from the store-level currency. Else, will default to store-level currency.
- provincestringThe state or province associated with the address.
- shipping_lines_conservedarray of objectsShipping rates that have previously been overridden via
shipping_lines_overridebut are currently inactive. - shipping_lines_overridearray of objectsUsed when shipping rates need to be overridden.If this parameter has value
null, rates will be fetched whenChargeis created or regenerated - zipstringThe zip or postal code associated with the address.
- created_atdatetimeThe date and time when the address was created.
- updated_atdatetimeThe date and time when the address was last updated.
curl -X POST 'https://api.rechargeapps.com/charges/459904607/remove_discount' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{}'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": "2021-11-09T23:59:31+00:00",
"retry_date": "2021-01-01",
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "success",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}#Skip a charge
POST/charges/{id}/skip
Skip a
Charge.Scope
write_ordersExactly one of
purchase_item_ids or purchase_item_id must be provided. Only Charges with a status of queued or error can be skipped.Query parameters
- If set to
false, the remaining queuedChargeis regenerated asynchronously instead of before the response is returned. Defaults totrue. - If set to
true, the expiration date of theMembershipassociated with theChargeis moved to the new charge date. Defaults tofalse.
Body parameters
- A list of the
SubscriptionorOnetimeIDs to skip on theCharge. - The ID of a single
SubscriptionorOnetimeto skip on theCharge. Cannot be passed together withpurchase_item_ids.
curl -X POST 'https://api.rechargeapps.com/charges/377749210/skip' \
-H 'X-Recharge-Version: v2' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"purchase_item_ids": [
27363808,
27363809
]
}'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": null,
"retry_date": null,
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "skipped",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}#Unskip a charge
POST/charges/{id}/unskip
Unskip a
Charge.Scope
write_ordersExactly one of
purchase_item_ids or purchase_item_id must be provided. Only Charges with a status of skipped whose scheduled date is not more than one day in the past can be unskipped.Query parameters
- If set to
true, the expiration date of theMembershipassociated with theChargeis moved to the new charge date. Defaults tofalse.
Body parameters
- A list of the
SubscriptionorOnetimeIDs to unskip on theCharge. - The ID of a single
SubscriptionorOnetimeto unskip on theCharge. Cannot be passed together withpurchase_item_ids.
Response attributes
- errorsobjectError object
curl -X POST 'https://api.rechargeapps.com/charges/377749210/unskip' \
-H 'X-Recharge-Version: v2' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"purchase_item_ids": [
27363808
]
}'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": null,
"retry_date": null,
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "queued",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}#Refund a charge
POST/charges/{id}/refund
Refund a
Charge.Scopes
write_orderswrite_paymentsAfter the
At least one of
POST request, that particular Charge will have status parameter updated to refunded or partially_refunded depending on the value of the amount parameter. If retry is true, error and error_type are required, the Charge will have status parameter updated to error. This means a new transaction would occur if the charge dunning process succeeds again. This functionality is used when the order submission attempt on the remote platform failed after the transaction succeeded.At least one of
amount, full_refund or line_items must be provided. Either the write_orders or the write_payments scope is sufficient.Body parameters
- amountfloatAmount of money that will be refunded. It can be fully or partially refunded.
- full_refundbooleanIf this parameter has value
true, theChargewill be totally refunded. - retrybooleanIf this parameter has value
trueandfull_refundhas valuetrue, theChargewill be retried. Thestatuson theChargewill be returned as “error”. - errorstringThe error message to store on the
Charge. If theretryparameter has valuetrue, this value is required. - error_typestringIf the
retryparameter has valuetrue, this value is required.Possible valuesinsufficient_inventorybc_rejected - A list of the line items to refund. Cannot be passed together with
amount. If passed withfull_refund, all line items of theChargemust be listed with their full quantities.Show child attributesHide child attributes22 new
- The
SubscriptionorOnetimeID of the line item to refund. Required for each line item. - The quantity of the line item to refund. Must be at least 1. Required for each line item.
curl -X POST 'https://api.rechargeapps.com/charges/377749210/refund' \
-H 'X-Recharge-Version: v2' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"amount": 11
}'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": "2021-11-09T23:59:31+00:00",
"retry_date": null,
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "refunded",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "11.29",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}#Process a charge
POST/charges/{id}/process
The charge processing route can be used to process
Charges that are in a queued or error status.Scope
write_paymentsThe
Learn more about Recharge Plus.
/charges/{id}/process endpoint is available to Recharge Plus merchants on a request basis. If you’re interested in leveraging the Recharge Charge processing API, reach out to your account manager or our Support team.Learn more about Recharge Plus.
Body parameters
- The outcome of a payment taken outside of Recharge. Must be passed, and can only be passed, when the
Chargeuses a payment method with a custom payment gateway.Only forChargeswhose payment method uses a custom payment gateway.Show child attributesHide child attributes44 new
- The result of the external payment. Required when
custom_gatewayis passed.Possible valuessuccesserror - The ID of the transaction in the external payment system. Required when
external_statusissuccess. - The structured reason why the external payment failed, such as
CARD_DECLINED. Must be a validChargeerror type. Required whenexternal_statusiserrorand not allowed when it issuccess. - The error message returned by the external payment system. Required when
external_statusiserrorand not allowed when it issuccess.
RelatedCharges FAQ →
curl -X POST 'https://api.rechargeapps.com/charges/100714428/process' \
-H 'X-Recharge-Version: v2' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{}'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": "2021-11-09T23:59:31+00:00",
"retry_date": null,
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "success",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}#Capture a charge
POST/charges/{id}/capture_payment
If you are leveraging the authorize/capture workflow with Recharge, the
As a result, Recharge provides a
charge/{id}/capture_payment endpoint is how to capture the funds of a previously authorized Charge.Capture Window
You can only capture payment onCharges that have been authorized within the last 7 days. This is a limitation of payment providers/financial institutions and Recharge cannot configure or override this limit. Any Charges that are attempted to be captured beyond that 7 day window may result in an error indicating the Charge cannot be captured. As a result, Recharge provides a
charge/uncaptured Webhook. If subscribed, this Webhook will notify you of any Charges that are not captured 6 days after authorization. Please refer to the webhooks section for more information.Scopes
write_paymentswrite_orderswrite_subscriptionswrite_customersThe
Learn more about Recharge Plus.
All four scopes are required.
/charges/{id}/capture_payment endpoint is available to Recharge Plus merchants in the Recharge Closed Beta group. If you’re interested in leveraging the Recharge capture_payment endpoint, reach out to your account manager or our Support team. Learn more about Recharge Plus.
All four scopes are required.
Response attributes
- errorsobject
curl -X POST 'https://api.rechargeapps.com/charges/100714428/capture_payment' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{}'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": "2021-11-09T23:59:31+00:00",
"retry_date": null,
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "success",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}#Add a free gift
POST/charges/{id}/add_free_gift
Endpoint for adding
Free Gift to an existing queued Charge.Scopes
write_orderswrite_free_giftsYou can provide
A successful request returns a
external_variant_id to add to the Charge.A successful request returns a
201 status code. free_gifts[].quantity must be at least 1, and the Charge must have a status of queued or error.Body parameters
- List of
Free Gifts you want to add to aCharge.Show child attributesHide child attributes2
- external_variant_idstringID of the
Variantyou want to add to aCharge. - Quantity of the
Free Giftyou want to add to aCharge.
- conserve_on_skipbooleanWhether to conserve the
Free Gifton a skipped charge.
Response attributes
curl -X POST 'https://api.rechargeapps.com/charges/105805051/add_free_gift' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"free_gifts": [
{
"external_variant_id": "1234567890",
"quantity": 1
}
],
"conserve_on_skip": true
}'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
},
{
"purchase_item_id": null,
"external_product_id": {
"ecommerce": "6791118553225"
},
"external_variant_id": {
"ecommerce": "39940738482313"
},
"grams": null,
"handle": null,
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"offer_attributes": null,
"original_price": "0.00",
"properties": [
{
"name": "source",
"value": "gift:API:RequestId:self.request_id,"
}
],
"purchase_item_type": null,
"quantity": 1,
"sku": null,
"tax_due": "0.00",
"tax_lines": [],
"taxable": false,
"taxable_amount": "0.00",
"title": "Free Gift",
"total_price": "0.00",
"unit_price": "0.00",
"unit_price_includes_tax": false,
"variant_title": "Free Gift Title"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": "2021-11-09T23:59:31+00:00",
"retry_date": "2021-01-01",
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "success",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"taxes_included": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}#Remove a free gift
POST/charges/{id}/remove_free_gift
Endpoint for removing a free gift from an existing queued
Charge.Scopes
write_orderswrite_free_giftsYou can provide
external_variant_ids to remove from the Charge.Body parameters
- external_variant_idsarrayList of
ExternalVariantIDs of free gifts you want to remove from aCharge.
curl -X POST 'https://api.rechargeapps.com/charges/105805051/remove_free_gift' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"external_variant_ids": [
"1234567890"
]
}'{
"charge": {
"id": 377749210,
"address_id": 42171447,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "Suite 101",
"city": "Portland",
"company": "Acme Corp",
"country_code": "US",
"first_name": "Jane",
"last_name": "Doe",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2021-11-09T19:22:13+00:00",
"currency": "USD",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"error_type": null,
"external_order_id": {
"ecommerce": "2541635698739"
},
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"has_uncommitted_changes": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"handle": "shirt-package",
"images": {
"large": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_large.jpg",
"medium": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_medium.jpg",
"original": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h.jpg",
"small": "https://example-cdn.com/s/files/1/0257/0351/4163/products/il_570xN.1723312095_a43h_small.jpg"
},
"original_price": "10.00",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"purchase_item_type": "subscription",
"quantity": 1,
"sku": "TOM0001",
"tax_due": "1.30",
"tax_lines": [
{
"price": "0.9931",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.3310"
},
{
"price": "0.3082",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.1027"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt package",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue T-shirt"
}
],
"merged_at": null,
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "Checkout-Method",
"value": "delivery"
}
],
"orders_count": 1,
"original_scheduled_at": "2021-12-09",
"payment_processor": "stripe",
"processed_at": "2021-11-09T23:59:31+00:00",
"retry_date": "2021-01-01",
"scheduled_at": "2021-12-09",
"shipping_address": {
"address1": "1030 Barnum Ave",
"address2": "Suite 101",
"city": "Stratford",
"company": "Fake Company",
"country_code": "US",
"first_name": "Fake First",
"last_name": "Fake Last",
"phone": "999-999-9999",
"province": "Connecticut",
"zip": "06614"
},
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"source": "shopify",
"taxable": true,
"tax_lines": [
{
"price": "0.355",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"title": "Standard",
"status": "active",
"retrieved_at": null
}
],
"status": "success",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.950",
"rate": 0.0725,
"title": "CA State Tax"
},
{
"price": "0.335",
"rate": 0.0225,
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"taxes_included": true,
"total_discounts": "10.0",
"total_duties": "0.00",
"total_line_items_price": "10.00",
"total_price": "11.29",
"total_refunds": "0.00",
"total_tax": "1.29",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2021-11-09T23:59:32+00:00"
}
}