Core Resources
Onetimes
Onetimes represent non-recurring line items on a
QUEUED Charge.39 additions in V2, marked New
Everything marked New also works when you send X-Recharge-Version: 2021-11.
#The onetime object
Attributes
- idintegerUnique numeric identifier for the
Onetimepurchase. - address_idintegerUnique numeric identifier for the address the
OnetimePurchase is associated with (cannot be used withnext_charge_scheduled_at) - An object containing the related objects requested with the
includequery parameter.Only returned when theincludequery parameter is passed on the retrieve or list endpoints.Show child attributesHide child attributes712 new
- The
AddresstheOnetimeis associated with.Returned whenincludecontainsaddress. - The bundle product that matches the product of the
Onetime.nullif the product is not a bundle.Returned whenincludecontainsbundle_product. - The
BundleSelectionlinked to theOnetime.nullif there is none.Returned whenincludecontainsbundle_selections. - The charge activity records created in the last 90 days for the
Chargesthat contain theOnetime.Returned whenincludecontainscharge_activities. - The
CustomertheOnetimeis tied to.Returned whenincludecontainscustomer. - The entitlements granted to the
Customerby theOnetime.Returned whenincludecontainscustomer_entitlements.Show child attributesHide child attributes55 new
- Unique numeric identifier for the customer entitlement.
- The description of the entitlement feature.
- The time the entitlement expires.
nullif it does not expire. - The lookup key of the entitlement feature.
- The name of the entitlement feature.
- The
Metafieldsattached to theOnetime.Returned whenincludecontainsmetafields.
- The presentment currency of the
Onetime. - created_atdatetimeThe time the
Onetimeitem was first created. - customer_idintegerUnique numeric identifier for the customer the
Onetimepurchase is tied to. - external_product_idobjectAn object containing the product id as it appears in external platforms.
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 variant id as it appears in external platforms.
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.
- is_cancelledbooleanFlag indicating if the the onetime is cancelled.
- Date of the
Onetimepurchase execution.Cannot be used withadd_to_next_charge - pricestringThe price of the item before discounts, taxes, or shipping have been applied.
- product_titlestringThe name of the product in a shop’s catalog.
- propertiesarray of objectsAn array containing key value pairs for any supplementary data.
- quantityintegerThe number of items in the
Onetimepurchase. - skustringA unique identifier of the item in the fulfillment.
- sku_overridebooleanFlag that is automatically updated to
truewhen SKU is passed onPOSTorPUT.Whensku_overrideistrue, theskuon theOnetimewill be used to generateChargesandOrders.
Whensku_overrideisfalse, Recharge will dynamically fetch theskufrom the correspondingexternal_platform_variant. - updated_atdatetimeThe time the
Onetimepurchase was last updated. - variant_titlestringThe name of the variant in a shop’s catalog.
{
"onetime": {
"id": 16909886,
"address_id": 21317826,
"customer_id": 18819267,
"created_at": "2018-11-14T11:20:05+00:00",
"external_product_id": {
"ecommerce": "4950280863846"
},
"external_variant_id": {
"ecommerce": "32139793137766"
},
"is_cancelled": false,
"next_charge_scheduled_at": "2018-12-17T00:00:00+00:00",
"presentment_currency": "USD",
"price": null,
"product_title": "SuperKiwi ONETIME",
"properties": [
{
"name": "grind",
"value": "drip"
}
],
"quantity": 1,
"sku": "TOM0001",
"sku_override": false,
"updated_at": "2018-11-14T11:20:05+00:00",
"variant_title": "Blue star"
}
}#Create a onetime
POST/onetimes
Create a new
Onetime.Scope
write_subscriptionsnext_charge_scheduled_at is required unless add_to_next_charge is true. The two parameters cannot be passed together.Body parameters
- Unique numeric identifier for the address the one time purchase is associated with.
- add_to_next_chargebooleanInstructs to add the
Onetimeto the next charge scheduled under thisAddress. - A list of up to 10 custom key-value pairs to attach to the
Eventsgenerated by this request. They are returned in thecustom_attributesof thoseEvents. - external_product_idobjectUnique numeric identifier of the product in external platform.
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.
- Unique numeric identifier of the product variant in external platform.
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.
- This will set the charge date of a new Onetime purchase.Cannot be used with
add_to_next_charge - Unique numeric identifier of a
Planof the product. Whenpriceis not provided, the discount of thisPlanis used to calculate the price of theOnetime. - The presentment currency of the
price. It must match the currency of theAddress. Required whenpriceis provided and the currency of theAddressis not the store's default currency. - pricestringThe price of the product.
- Set to
trueto indicate that thepricein the request was explicitly chosen by the caller instead of being calculated by Recharge. - product_titlestringThe name of the product.
- propertiesarray of objectsList of properties.
- The quantity of the product.
- skustringA unique identifier of the item in the fulfillment.
- When
true, theskustored on theOnetimeis used instead of the SKU of the product variant. - The name of the product variant.
curl -X POST 'https://api.rechargeapps.com/onetimes' \
-H 'X-Recharge-Version: v2' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"address_id": 45154492,
"next_charge_scheduled_at": "2021-12-17",
"price": 6,
"product_title": "ABC Shirt",
"properties": [
{
"name": "Color",
"value": "Blue"
},
{
"name": "Size",
"value": "Medium"
}
],
"quantity": 1,
"external_variant_id": {
"ecommerce": "3844892483"
}
}'{
"onetime": {
"id": 156155818,
"address_id": 45154492,
"customer_id": 40565990,
"created_at": "2021-05-24T19:14:25+00:00",
"external_product_id": {
"ecommerce": "4950280863846"
},
"external_variant_id": {
"ecommerce": "32139793137766"
},
"is_cancelled": false,
"next_charge_scheduled_at": "2021-12-17T05:00:00+00:00",
"presentment_currency": "USD",
"price": "6.00",
"product_title": "ABC Shirt",
"properties": [
{
"name": "Color",
"value": "Red"
}
],
"quantity": 1,
"sku": "TOM0001",
"sku_override": false,
"updated_at": "2021-05-24T19:30:14+00:00",
"variant_title": "Blue star"
}
}#Retrieve a onetime
GET/onetimes/{id}
Retrieve a Onetime.
Scope
read_subscriptionsQuery parameters
- A comma-separated list of related objects to return in the
includeattribute of theOnetime.address,customerandcustomer_entitlementsalso require theread_customersscope, andcharge_activitiesalso requires theread_ordersscope.Possible valuesaddressbundle_productbundle_selectionscharge_activitiescustomercustomer_entitlementsmetafields - If
true, theOnetimeis returned even if it has been deleted.
curl 'https://api.rechargeapps.com/onetimes/16909886' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"onetime": {
"id": 16909886,
"address_id": 45154492,
"created_at": "2021-05-24T19:14:25+00:00",
"customer_id": 40565990,
"external_product_id": {
"ecommerce": "4950280863846"
},
"external_variant_id": {
"ecommerce": "32139793137766"
},
"is_cancelled": false,
"next_charge_scheduled_at": "2021-12-17T05:00:00+00:00",
"presentment_currency": "USD",
"price": "6.00",
"product_title": "ABC Shirt",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"quantity": 1,
"sku": "TOM0001",
"sku_override": false,
"updated_at": "2021-05-24T19:30:14+00:00",
"variant_title": "Blue star"
}
}#Update a onetime
PUT/onetimes/{id}
Update an existing
Onetime item.Scope
write_subscriptionsBody parameters
- address_idintegerUnique numeric identifier for the address the
OnetimePurchase is associated with (cannot be used withnext_charge_scheduled_at) - A list of up to 10 custom key-value pairs to attach to the
Eventsgenerated by this request. They are returned in thecustom_attributesof thoseEvents. - An object containing the product id as it appears in external platforms.
Show child attributesHide child attributes11 new
- The product id as it appears in the external e-commerce platform.
- This will set the charge date of a new
Onetimepurchase. - The presentment currency of the
price. It must match the currency of theOnetime. Required whenpriceis provided and the currency of theOnetimeis not the store's default currency. - pricestringThe price of the product.
- Set to
trueto indicate that thepricein the request was explicitly chosen by the caller instead of being calculated by Recharge. - product_titlestringThe name of the product.
- propertiesarray of objectsList of properties.
- quantityintegerThe quantity of the product.
- external_variant_idobjectUnique numeric identifier of the product variant.
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.
- skustringA unique alphanumeric identifier of the item in the fulfillment.
- When
true, theskustored on theOnetimeis used instead of the SKU of the product variant. - variant_titlestringThe name of the product variant.
curl -X PUT 'https://api.rechargeapps.com/onetimes/16909886' \
-H 'X-Recharge-Version: v2' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"quantity": 1
}'{
"onetime": {
"id": 16909886,
"address_id": 45154492,
"created_at": "2021-05-24T19:14:25+00:00",
"customer_id": 40565990,
"external_product_id": {
"ecommerce": "4950280863846"
},
"external_variant_id": {
"ecommerce": "32139793137766"
},
"is_cancelled": false,
"next_charge_scheduled_at": "2021-12-17T05:00:00+00:00",
"presentment_currency": "USD",
"price": "6.00",
"product_title": "ABC Shirt",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"quantity": 1,
"sku": "TOM0001",
"sku_override": false,
"updated_at": "2021-05-24T19:30:14+00:00",
"variant_title": "Blue star"
}
}curl -X DELETE 'https://api.rechargeapps.com/onetimes/16665185' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{}#List onetimes
GET/onetimes
Returns a list of all
Onetime products from store.Scope
read_subscriptionsWhen
cursor is passed, limit is the only other query parameter that can be passed with it.Query parameters
- address_idstringReturn the onetimes linked to the given
address_id. - address_idsstringReturn the onetimes linked to the given comma-separated list of
address_ids. - created_at_maxdatetimeReturn the onetimes created before the given date.
- created_at_mindatetimeReturn the onetimes created after the given date.
- customer_idstringReturn the onetimes linked to the given Recharge
customer_id. - include_cancelledbooleanIf
truethe response will include the cancelledOnetimesas well as the others. - limitstringThe number of results.
- 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.
- external_variant_idstringReturn the one time purchases linked to the given external platform product
variant_id. - updated_at_maxdatetimeReturn the onetimes updated before the given date.
- updated_at_mindatetimeReturn the onetimes updated after the given date.
- idsstringComma-separated list of one time purchase ids to filter.
- Return either the next or previous page of onetimes using the
next_cursororprevious_cursorattributes in the response. - Return the onetimes linked to the customer with the given id in the external e-commerce platform.
- A comma-separated list of related objects to return in the
includeattribute of theOnetimes.address,customerandcustomer_entitlementsalso require theread_customersscope, andcharge_activitiesalso requires theread_ordersscope.Possible valuesaddressbundle_productbundle_selectionscharge_activitiescustomercustomer_entitlementsmetafields - If
truethe response will include the deletedOnetimesas well as the others. - Sort the results by the given attribute and direction. Defaults to
id-desc.Possible valuesid-ascid-desccreated_at-asccreated_at-descupdated_at-ascupdated_at-desc
curl 'https://api.rechargeapps.com/onetimes?limit=3' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"next": "next_cursor",
"previous": "previous_cursor",
"onetimes": [
{
"id": 16909886,
"address_id": 45154492,
"created_at": "2021-05-24T19:14:25+00:00",
"customer_id": 40565990,
"external_product_id": {
"ecommerce": "4950280863846"
},
"external_variant_id": {
"ecommerce": "32139793137766"
},
"is_cancelled": false,
"next_charge_scheduled_at": "2021-12-17T05:00:00+00:00",
"presentment_currency": "USD",
"price": "6.00",
"product_title": "ABC Shirt",
"properties": [
{
"name": "Color",
"value": "Blue"
}
],
"quantity": 1,
"sku": "TOM0001",
"sku_override": false,
"updated_at": "2021-05-24T19:30:14+00:00",
"variant_title": "Blue star"
}
]
}