Core Resources
Orders
An order is created after a
Charge is successfully processed. The Order contains all the same json data as the Charge. In case of a prepaid order creation, the order will be queued for a particular date and submitted on that date to the external platform.40 additions in V2, marked New
Everything marked New also works when you send X-Recharge-Version: 2021-11.
#The order object
Attributes
- idintegerThe unique numeric identifier for the order.
- address_idintegerThe id of the associated
Addresswithin Recharge. - billing_addressobjectThe billing address at the time the order was created. See
Addressesfor detailed address information.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.
- chargeobjectAn object containing parameters of the
Charge.Show child attributesHide child attributes42 new
- idintegerThe id of the charge associated with this order.
- external_transaction_idobjectAn object containing external transaction ids associated with this charge, as they appear in external platforms.
Show child attributesHide child attributes1
- payment_processorstringThe ID of the associated transaction in a payment processor system (like Stripe).
- The name of the payment processor used to process the
Charge. - The status of the
Chargeassociated with theOrder.
- client_detailsobjectDetails of the access method used by the purchase.
Show child attributesHide child attributes2
- browser_ipstringThe IP address of the buyer as detected in
Checkout. - user_agentstringThe user agent detected during
Checkout.
- The error message recorded when the
Ordercould not be submitted to the external e-commerce platform. - An object containing the external order names.
Show child attributesHide child attributes11 new
- The order name as it appears in the external e-commerce platform, for example
#1001.
- An object containing the related resources requested with the
includequery parameter.Only returned when theincludequery parameter is passed.Show child attributesHide child attributes55 new
- The
Addressassociated with theOrder.Only returned wheninclude=addressis passed. - The
Customerassociated with theOrder.Only returned wheninclude=customeris passed. - The
Metafieldsassociated with theOrder.Only returned wheninclude=metafieldsis passed. - A list of the modifications made to the line items of the
Order.Only returned wheninclude=order_modificationsis passed. - The
Subscriptionson theChargeassociated with theOrder.Only returned wheninclude=subscriptionsis passed.
- created_atdatetimeThe date when the order was created.
- currencystringThe currency of the payment used to create the order.
- customerobjectObject that contains information about the
Customer.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 theOrder.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 - How the
Discountis applied. Returned asnullunless automatic discounts are enabled for the store.Possible valuescodeautomaticThe key is always present; it only has a value for stores with automatic discounts enabled. - The title of the
Discount. Returned asnullunless automatic discounts are enabled for the store.The key is always present; it only has a value for stores with automatic discounts enabled.
- external_cart_tokenstringThe cart token as it appears in an external system.
- external_order_idobjectAn object containing external order ids.
Show child attributesHide child attributes1
- ecommercestringThe order ID as it appears in the external e-commerce platform.
- external_order_numberobjectAn object containing the external order numbers.
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.
- is_prepaidbooleanA boolean representing if this
Orderis generated from a prepaid purchase. - line_itemsarray of objectsA list of
line_itemobjects.Show child attributesHide child attributes237 new
- The inventory behavior applied to the
line_itemwhen theOrderis created in the external e-commerce platform.Possible valuesbypassdecrement_ignoring_policydecrement_obeying_policy - An object containing the ID of the
line_itemas it appears in the external system.Only returned for stores that have external line item IDs enabled on their account.Show child attributesHide child attributes11 new
- The ID of the
line_itemas it appears in the external e-commerce platform.Only returned for stores that have external line item IDs enabled on their account.
- An object describing the offer that added the
line_itemto theOrder. Returned asnullwhen 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
Order. - order_attributesarray of objectsAn array of name value pairs of note attributes on the
Order. - processed_atdatetimeThe date time that the associated charge was processed at.
- scheduled_atdatetimeThe date time of when the associated charge is/was scheduled to process.
- shipping_addressobjectThe shipping address where the order will be shipped. See
Addressesfor detailedAddressinformation.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 order.
Show child attributesHide child attributes6
- 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.
- statusstringThe status of creating the
Order.Possible valuesqueuedsuccesserrorcancelledskippedpending_fraudpending_charge_statusmerged - subtotal_pricestringThe subtotal price (sum of all line items * their quantity) of the order less discounts.
- tax_linesarray of objectsAn array of tax lines that apply to the
Order. - taxablebooleanA boolean indicator of the taxability of the
Order. - total_discountsstringThe total discounted dollar value of the
Order. - total_dutiesstringThe total cost of duties for the order.
- total_line_items_pricestringThe total price of all line items of the
Order. - total_pricestringThe total amount due of the
Order. - total_refundsstringThe total dollar amount of refunds associated with the
Order. - total_taxstringThe total tax due associated with the
Order. - total_weight_gramsintegerThe total weight of the order in grams.
- typestringAn indicator of the order’s type.Possible values
checkoutrecurring - updated_atdatetimeThe date time at which the order was most recently updated.
{
"order": {
"id": 70071255,
"address_id": 4029306,
"billing_address": {
"address1": "1933 Manning",
"address2": "204",
"city": "los angeles",
"company": "bootstrap",
"country_code": "US",
"first_name": "mike",
"last_name": "flynn",
"phone": "3103103101",
"province": "California",
"zip": "90025"
},
"charge": {
"id": 97376832,
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"payment_processor_name": "stripe",
"status": "success"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2018-11-08T08:08:09+00:00",
"currency": "usd",
"customer": {
"id": 12354,
"email": "example@email.com",
"external_customer_id": {
"ecommerce": "382028302"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 123456,
"code": "TESTCODE10",
"value": "10.00",
"value_type": "fixed_amount"
}
],
"error": null,
"external_cart_token": "aeic8101918fs0f8810",
"external_order_id": {
"ecommerce": "123496878536413"
},
"external_order_name": {
"ecommerce": "#125"
},
"external_order_number": {
"ecommerce": "125"
},
"hash": "42039120ee0e6cfa5c97805",
"is_prepaid": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 365974856,
"external_inventory_policy": "decrement_obeying_policy",
"external_product_id": {
"ecommerce": "456123789"
},
"external_variant_id": {
"ecommerce": "4569876413"
},
"grams": 454,
"images": {
"large": "https://cdn.shopify.com/s/files/1/0683/1951/products/milk2_large.jpeg",
"medium": "https://cdn.shopify.com/s/files/1/0683/1951/products/milk2_medium.jpeg",
"original": "https://cdn.shopify.com/s/files/1/0683/1951/products/milk2.jpeg",
"small": "https://cdn.shopify.com/s/files/1/0683/1951/products/milk2_small.jpeg"
},
"original_price": "10.00",
"properties": [
{
"name": "grind",
"value": "drip"
},
{
"name": "size",
"value": "medium"
}
],
"purchase_item_type": "subscription",
"quantity": 4,
"sku": "TOM0001",
"tax_due": "3.80",
"tax_lines": [
{
"price": "0.993",
"rate": "0.0725",
"unit_price": "0.331",
"title": "CA State Tax"
},
{
"price": "0.308",
"rate": "0.0225",
"unit_price": "0.102",
"title": "LA County Tax"
}
],
"taxable": true,
"taxable_amount": "10.00",
"title": "Shirt bundle",
"total_price": "43.80",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue t-shirts"
}
],
"note": "next order #3 - Subscription Recurring Order",
"order_attributes": [
{
"name": "subscription_cycle_count_min",
"value": "3"
}
],
"processed_at": null,
"scheduled_at": "2022-11-16T00:00:00+00:00",
"shipping_address": {
"address1": "1933 Manning",
"address2": "204",
"city": "los angeles",
"company": "bootstrap",
"country_code": "US",
"first_name": "mike",
"last_name": "flynn",
"phone": "3103103101",
"province": "California",
"zip": "90025"
},
"shipping_lines": [
{
"code": "Standard Shipping",
"price": "4.90",
"taxable": true,
"tax_lines": [
{
"price": "0.360",
"rate": "0.0725",
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": "0.0225",
"title": "LA County Tax"
}
],
"title": "Standard Shipping"
}
],
"status": "cancelled",
"subtotal_price": "40.00",
"tags": "Prepaid, 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.00",
"total_duties": "0.0",
"total_line_items_price": "40.00",
"total_price": "38.22",
"total_refunds": "0.00",
"total_tax": "3.32",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2020-12-20T13:25:52+00:00"
}
}#Retrieve an order
GET/orders/{id}
Retrieve one
Order using the Recharge order_id.Scope
read_ordersQuery parameters
- A comma-separated list of related resources to return in the
includeobject of theOrder. Each value other thanmetafieldsrequires the matching read scope on the token:read_customersforaddressandcustomer,read_subscriptionsforsubscriptions,read_ordersfororder_modifications.Possible valuesaddresscustomermetafieldsorder_modificationssubscriptions
curl 'https://api.rechargeapps.com/orders/70071255' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"order": {
"id": 210987092,
"address_id": 42171447,
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "",
"city": "Portland",
"company": "Fake Company Billing",
"country_code": "US",
"first_name": "Fake Billing First",
"last_name": "Fake Billing Last",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"charge": {
"id": 272382456,
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"payment_processor_name": "stripe",
"status": "success"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2020-12-17T18:50:25+00:00",
"currency": "usd",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "382028302"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"external_cart_token": "aeic8101918fs0f8810",
"external_order_id": {
"ecommerce": "27117383938"
},
"external_order_name": {
"ecommerce": "#1938"
},
"external_order_number": {
"ecommerce": "1938"
},
"is_prepaid": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_inventory_policy": "decrement_obeying_policy",
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"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_lines": [
{
"price": "0.993",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.331"
},
{
"price": "0.308",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.102"
}
],
"taxable": true,
"taxable_amount": "10.00",
"tax_due": "1.30",
"title": "Shirt bundle",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue t-shirts"
}
],
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "subscription_cycle_count_min",
"value": "3"
}
],
"processed_at": "2020-12-17T18:50:27+00:00",
"scheduled_at": "2020-12-17T18:50:27+00:00",
"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",
"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": "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.00",
"total_duties": "0.0",
"total_line_items_price": "10.00",
"total_price": "14.90",
"total_refunds": "0.00",
"total_tax": "10.00",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2020-12-17T18:50:27+00:00"
}
}#Clone an order
POST/orders/{id}/clone
You may add additional
Orders onto a success Charge if it has existing prepaid Orders by cloning an existing Order.Scope
write_ordersOnly orders with a status of
success or queued can be cloned. The cloned Order is created as a queued prepaid order.Query parameters
- By default the
Chargeused for the clone must have a status ofsuccess. Passtrueto also allow aChargewith a status ofrefunded,partially_refundedorcancelled.
Body parameters
- Date in future when this order will be sent.
- The ID of the
Chargethe clonedOrderis associated with. Defaults to theChargeof the originalOrder. - Limits the items copied to the cloned
Order. Passsubscriptionsto copy only subscription items oronetimesto copy only one-time items. When omitted, all items are copied.Possible valuessubscriptionsonetimes
curl -X POST 'https://api.rechargeapps.com/orders/70071255/clone' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"scheduled_at": "2022-11-16"
}'{
"order": {
"id": 210987092,
"address_id": 42171447,
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "",
"city": "Portland",
"company": "Fake Company Billing",
"country_code": "US",
"first_name": "Fake Billing First",
"last_name": "Fake Billing Last",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"charge": {
"id": 272382456,
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"payment_processor_name": "stripe",
"status": "success"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2020-12-17T18:50:25+00:00",
"currency": "usd",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "382028302"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"external_cart_token": "aeic8101918fs0f8810",
"external_order_id": {
"ecommerce": "27117383938"
},
"external_order_name": {
"ecommerce": "#1938"
},
"external_order_number": {
"ecommerce": "1938"
},
"is_prepaid": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_inventory_policy": "decrement_obeying_policy",
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"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_lines": [
{
"price": "0.993",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.331"
},
{
"price": "0.308",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.102"
}
],
"taxable": true,
"taxable_amount": "10.00",
"tax_due": "1.30",
"title": "Shirt bundle",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue t-shirts"
}
],
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "subscription_cycle_count_min",
"value": "3"
}
],
"processed_at": "2020-12-17T18:50:27+00:00",
"scheduled_at": "2020-12-17T18:50:27+00:00",
"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",
"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": "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.00",
"total_duties": "0.0",
"total_line_items_price": "10.00",
"total_price": "14.90",
"total_refunds": "0.00",
"total_tax": "10.00",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2020-12-17T18:50:27+00:00"
}
}#Delay an order
POST/orders/{id}/delay
Delay a prepaid
Order by one intervalScope
write_ordersThe
Only
id must be for the next queued Order for a prepaid Subscription. The Order will be delayed by one interval, and all subsequent Orders and Charges will be shifted by the same amount.Only
queued prepaid orders can be delayed, and every prepaid item in the Order must share the same charge and shipping interval. The Order and all later queued orders of the same Charge move forward by one shipping interval, as does the next queued Charge. No request body is required.curl -X POST 'https://api.rechargeapps.com/orders/70071255/delay' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"order": {
"id": 70071255,
"address_id": 4029306,
"created_at": "2022-02-04T23:19:52+00:00",
"currency": "usd",
"discounts": [],
"error": null,
"external_cart_token": null,
"external_order_name": {
"ecommerce": null
},
"is_prepaid": true,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_inventory_policy": "decrement_obeying_policy",
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"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_lines": [
{
"price": "0.993",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.331"
},
{
"price": "0.308",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.102"
}
],
"taxable": true,
"taxable_amount": "10.00",
"tax_due": "1.30",
"title": "Shirt bundle",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue t-shirts"
}
],
"note": null,
"order_attributes": [],
"processed_at": null,
"scheduled_at": "2023-02-07T05:00:00+00:00",
"shipping_lines": [
{
"code": "Standard",
"price": "4.90",
"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": "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": "0.00",
"total_duties": "0.0",
"total_line_items_price": "10.00",
"total_price": "14.90",
"total_refunds": "0.00",
"total_tax": "10.00",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2023-01-05T22:11:46+00:00"
}
}#Update an order
PUT/orders/{id}
Updating existing
Order using the order_id.Scope
write_ordersOnly
queued and error orders can be updated; on a success order only external_order_id and external_order_number can be set. When line_items is passed it replaces all line items of the Order, and each item must include quantity, external_product_id and external_variant_id. Passing status as cancelled cancels a queued order.Body parameters
- billing_addressobjectBilling address details.
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.
- customerobjectThe key values related with customer.
Show child attributesHide child attributes1
- emailstringThe user email.
- line_itemsarray of objectsLine item properties can be updated on Prepaid Queued Orders. To change Queued Charges you must change the parent subscription(s) or address.Important: When updating
line_items, you must provide the entire json block that was inline_itemsbefore, as the data provided overrides the entire block and only new parameters will remain.Show child attributesHide child attributes10
- purchase_item_idintegerThe
SubscriptionorOnetimeID associated with theline_item. By default this value is ignored and theline_itemis linked to the activeSubscriptionon the sameAddressthat has the same external variant ID. - An 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.
- An 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.
- propertiesarray of objectsAn array of name value pairs of additional
line_itemattributes. - The quantity of the
line_item. - skustringThe SKU (stock keeping unit) of the
Productassociated with theline_item. - titlestringThe title of the
Productof thisline_item. - unit_pricestringThe unit price of the
line_item. - variant_titlestringThe name of a variant of the
Productof thisline_item.
- external_order_idobjectAn object containing external order ids.
Show child attributesHide child attributes1
- ecommercestringThe order ID as it appears in the external e-commerce platform.
- scheduled_atdatetimeThe date when the order will be shipped.
- shipping_addressobjectShipping address details.
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.
- statusstringThe status of the orderPossible values
cancelled - An object containing the external order numbers.
Show child attributesHide child attributes11 new
- The order number as it appears in the external e-commerce platform.
- An array of name value pairs of note attributes on the
Order. Replaces the existing attributes.
curl -X PUT 'https://api.rechargeapps.com/orders/70071255' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"billing_address": {
"city": "Los Angeles",
"first_name": "mike",
"last_name": "flynn",
"zip": "90025"
}
}'{
"order": {
"id": 210987092,
"address_id": 42171447,
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "",
"city": "Portland",
"company": "Fake Company Billing",
"country_code": "US",
"first_name": "Fake Billing First",
"last_name": "Fake Billing Last",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"charge": {
"id": 272382456,
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"payment_processor_name": "stripe",
"status": "success"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2020-12-17T18:50:25+00:00",
"currency": "usd",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "382028302"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"external_cart_token": "aeic8101918fs0f8810",
"external_order_id": {
"ecommerce": "27117383938"
},
"external_order_name": {
"ecommerce": "#1938"
},
"external_order_number": {
"ecommerce": "1938"
},
"is_prepaid": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_inventory_policy": "decrement_obeying_policy",
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"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_lines": [
{
"price": "0.725",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.331"
},
{
"price": "0.225",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.102"
}
],
"taxable": true,
"taxable_amount": "10.00",
"tax_due": "0.95",
"title": "Shirt bundle",
"total_price": "10.95",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue t-shirts"
}
],
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "subscription_cycle_count_min",
"value": "3"
}
],
"processed_at": "2020-12-17T18:50:27+00:00",
"scheduled_at": "2020-12-17T18:50:27+00:00",
"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",
"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": "success",
"subtotal_price": "10.00",
"tags": "Subscription, Subscription Recurring Order",
"tax_lines": [
{
"price": "0.355",
"rate": "0.0725",
"title": "CA State Tax"
},
{
"price": "0.110",
"rate": "0.0225",
"title": "Los Angeles County Tax"
}
],
"taxable": true,
"total_discounts": "10.00",
"total_line_items_price": "10.00",
"total_price": "5.37",
"total_refunds": "0.00",
"total_tax": "0.47",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2020-12-17T18:50:27+00:00"
}
}curl -X DELETE 'https://api.rechargeapps.com/orders/70071255' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{}#List orders
GET/orders
Returns a list of orders.
HTTP request examples
GET /orders GET /orders?customer_id=123 GET /orders?address_id=4587216 GET /orders?charge_id=45678542 GET /orders?created_at_min=2016-05-18&created_at_max=2016-06-18Scope
read_ordersThe response also contains
next_cursor and previous_cursor. Requests for a page above 100 return a 422; use cursor pagination instead.Query parameters
- address_idstringFilter orders by address.
GET /orders/?address_id=123will return all orders for the givenaddress_id. - charge_idstringFilter orders by charge.
GET /orders/?charge_id=123will return all orders for the givencharge_id. - created_at_maxdatetimeShow orders created before the given date.
- created_at_mindatetimeShow orders created after the given date.
- The cursor returned in
next_cursororprevious_cursorof a previous response. When a cursor is passed,limitis the only other parameter that can be passed with it. - Filter orders by the email of the
Customer. - customer_idstringFilter orders by customer.
GET /orders/?customer_id=123will return all orders for the givencustomer_id - external_customer_idstringFilter orders by external_customer_id.
- external_order_idstringFilter orders by external_order_id.
- Filter orders by external_order_id. Accepts a comma-separated list of up to 100 values.
- Filter orders by the order number as it appears in the external e-commerce platform.
- Filter orders that contain any of the given external product IDs. If passing multiple values, must be comma separated.
- Filter orders that contain any of the given external variant IDs. If passing multiple values, must be comma separated.
- idsstringFilter orders by id. If passing multiple values, must be comma separated. Non-integer values will result in a 422 error
- A comma-separated list of related resources to return in the
includeobject of eachOrder. Each value other thanmetafieldsrequires the matching read scope on the token:read_customersforaddressandcustomer,read_subscriptionsforsubscriptions,read_ordersfororder_modifications.Possible valuesaddresscustomermetafieldsorder_modificationssubscriptions - Pass
trueto return only orders generated from a prepaid purchase. Passingfalsedoes not filter the results. - limitstringThe number of results.
- The page to show. Default is 1.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.
- Show orders processed before the given date.
- Show orders processed after the given date.
- scheduled_at_maxdatetimeShow orders scheduled before the given date.
- scheduled_at_mindatetimeShow orders scheduled after the given date.
- has_external_orderstringFilter orders with/without external_order_id.
- Sort the results. Default is
id-desc.Possible valuesid-ascid-descupdated_at-ascupdated_at-descprocessed_at-ascprocessed_at-descscheduled_at-ascscheduled_at-desc - statusstringFilter orders by status.Possible values
cancellederrorpending_charge_statuspending_fraudqueuedskippedsuccess - typestringFilter orders by type.Possible values
checkoutrecurringGET /api/orders/?type=recurringwill return all orders for the given type. - purchase_item_idstringFilter orders by subscription or onetime.
- updated_at_maxdatetimeShow orders updated before the given date.
- updated_at_mindatetimeShow orders updated after the given date.
curl 'https://api.rechargeapps.com/orders?limit=3' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"next": "next_cursor",
"previous": "previous_cursor",
"orders": [
{
"id": 210987092,
"address_id": 42171447,
"billing_address": {
"address1": "601 SW Washing St.",
"address2": "",
"city": "Portland",
"company": "Fake Company Billing",
"country_code": "US",
"first_name": "Fake Billing First",
"last_name": "Fake Billing Last",
"phone": "888-888-8888",
"province": "Oregon",
"zip": "97205"
},
"charge": {
"id": 272382456,
"external_transaction_id": {
"payment_processor": "ch_1HzWElJ2zqHvZRd1TWKFFqDR"
},
"payment_processor_name": "stripe",
"status": "success"
},
"client_details": {
"browser_ip": "192.168.0.1",
"user_agent": "safari webkit"
},
"created_at": "2020-12-17T18:50:25+00:00",
"currency": "usd",
"customer": {
"id": 37657002,
"email": "test@test.com",
"external_customer_id": {
"ecommerce": "382028302"
},
"hash": "7e706455cbd13e40"
},
"discounts": [
{
"id": 12345,
"code": "TESTCODE10",
"value": 10,
"value_type": "fixed_amount"
}
],
"error": null,
"external_cart_token": "aeic8101918fs0f8810",
"external_order_id": {
"ecommerce": "27117383938"
},
"external_order_name": {
"ecommerce": "#1938"
},
"external_order_number": {
"ecommerce": "1938"
},
"is_prepaid": false,
"line_items": [
{
"offer_attributes": null,
"purchase_item_id": 63898947,
"external_inventory_policy": "decrement_obeying_policy",
"external_product_id": {
"ecommerce": "4381728735283"
},
"external_variant_id": {
"ecommerce": "999999999999"
},
"grams": 454,
"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_lines": [
{
"price": "0.993",
"rate": "0.0725",
"title": "CA State Tax",
"unit_price": "0.331"
},
{
"price": "0.308",
"rate": "0.0225",
"title": "LA County Tax",
"unit_price": "0.102"
}
],
"taxable": true,
"taxable_amount": "10.00",
"tax_due": "1.30",
"title": "Shirt bundle",
"total_price": "11.30",
"unit_price": "10.00",
"unit_price_includes_tax": false,
"variant_title": "Blue t-shirts"
}
],
"note": "next order in sequence 3",
"order_attributes": [
{
"name": "subscription_cycle_count_min",
"value": "3"
}
],
"processed_at": "2020-12-17T18:50:27+00:00",
"scheduled_at": "2020-12-17T18:50:27+00:00",
"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",
"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": "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.00",
"total_duties": "0.0",
"total_line_items_price": "10.00",
"total_price": "14.90",
"total_refunds": "0.00",
"total_tax": "10.00",
"total_weight_grams": 454,
"type": "recurring",
"updated_at": "2020-12-17T18:50:27+00:00"
}
]
}