API
GuidesGet API token
You’re viewing the reference for API version 2021-01.See the latest version, 2021-11 →
Core Resources

Onetimes

Onetimes represent non-recurring line items on a QUEUED Charge.

#The onetime object

Attributes

  • idinteger
    One Time subscription id.
  • address_idinteger
    Unique numeric identifier for the address the One Time Purchase is associated with (cannot be used with next_charge_scheduled_at)
  • Boolean used to automatically add One Time Purchase to the next scheduled charge associated with the indicated address record.
  • The time the One Time Product was first created.
  • Unique numeric identifier for the customer the One Time Purchase is tied to.
  • Date of the One Time Purchase execution.
  • priceinteger
    The price of the item before discounts, taxes, or shipping have been applied.
  • The name of the product in a shop’s catalog.
  • The list of line item objects.
  • quantityinteger
    The number of items on the subscription.
  • Unique number identifier of the product in Recharge.
  • Unique number identifier of the product in Shopify.
  • Unique number identifier of the product variant in Shopify.
  • skustring
    A unique identifier of the item in the fulfillment.
  • statusstring
    The status of the One Time Purchase.
  • The time the One Time Purchase was last updated.
  • The name of the variant in a shop’s catalog.
The onetime object
{
  "onetime": {
    "id": 16909886,
    "address_id": 21317826,
    "created_at": "2018-11-14T11:20:05",
    "customer_id": 18819267,
    "next_charge_scheduled_at": "2018-12-17T00:00:00",
    "price": null,
    "product_title": "SuperKiwi ONETIME",
    "properties": [
      {
        "name": "grind",
        "value": "drip"
      }
    ],
    "quantity": 1,
    "recharge_product_id": 518672,
    "shopify_product_id": 1255175363,
    "shopify_variant_id": 3844892483,
    "sku": null,
    "status": "ONETIME",
    "updated_at": "2018-11-14T11:20:05",
    "variant_title": "6oz"
  }
}

#Create a onetime

POST/addresses/{address_id}/onetimes
Create a new Onetime.
Scopewrite_subscriptions

Body parameters

  • Boolean used to automatically add One Time Purchase to the next scheduled charge associated with the indicated address record.
  • next_charge_scheduled_atdatetimeRequired
    This will set the charge date of a new One Time Purchase (cannot be used with add_to_next_charge).
  • priceinteger
    The price of the product.
  • The name of the product.
  • List of properties.
  • quantityintegerRequired
    The quantity of the product.
  • shopify_product_idintegerRequired
    Unique numeric identifier of the product in Shopify.
  • shopify_variant_idintegerRequired
    Unique numeric identifier of the product variant in Shopify.
POST/addresses/{address_id}/onetimes
curl -X POST 'https://api.rechargeapps.com/addresses/21317826/onetimes' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{
  "next_charge_scheduled_at": "2021-12-17",
  "price": 9,
  "product_title": "SuperKiwi ONETIME",
  "properties": [
    {
      "name": "grind",
      "value": "drip"
    },
    {
      "name": "size",
      "value": "medium"
    }
  ],
  "quantity": 1,
  "shopify_variant_id": 3844892483
}'
Response
{
  "onetime": {
    "id": 16909886,
    "address_id": 21317826,
    "created_at": "2018-11-14T11:20:05",
    "customer_id": 18819267,
    "next_charge_scheduled_at": "2021-12-17T00:00:00",
    "price": null,
    "product_title": "SuperKiwi ONETIME",
    "properties": [
      {
        "name": "grind",
        "value": "drip"
      }
    ],
    "quantity": 1,
    "recharge_product_id": 518672,
    "shopify_product_id": 1255175363,
    "shopify_variant_id": 3844892483,
    "sku": null,
    "status": "ONETIME",
    "updated_at": "2018-11-14T11:20:05",
    "variant_title": "6oz"
  }
}

#Retrieve a onetime

GET/onetimes/{id}
Retrieve a Onetime.
Scoperead_subscriptions
GET/onetimes/{id}
curl 'https://api.rechargeapps.com/onetimes/16909886' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "onetime": {
    "id": 16909886,
    "address_id": 21317826,
    "created_at": "2018-11-14T11:20:05",
    "customer_id": 18819267,
    "next_charge_scheduled_at": "2021-12-17T00:00:00",
    "price": null,
    "product_title": "SuperKiwi ONETIME",
    "properties": [
      {
        "name": "grind",
        "value": "drip"
      },
      {
        "name": "size",
        "value": "medium"
      }
    ],
    "quantity": 1,
    "recharge_product_id": 518676,
    "shopify_product_id": 1255175363,
    "shopify_variant_id": 3844892483,
    "sku": null,
    "status": "ONETIME",
    "updated_at": "2018-11-14T11:20:05",
    "variant_title": "6oz"
  }
}

#Update a onetime

PUT/onetimes/{id}
Update an existing One Time Product.
Scopewrite_subscriptions

Body parameters

  • This will set the charge date of a new One Time Purchase (cannot be used with add_to_next_charge).
  • priceinteger
    The price of the product.
  • The name of the product.
  • List of properties.
  • quantityinteger
    The quantity of the product.
  • Unique numeric identifier of the product variant in Shopify.
  • skustring
    A unique alphanumeric identifier of the item in the fulfillment.
  • The name of the product variant.
PUT/onetimes/{id}
curl -X PUT 'https://api.rechargeapps.com/onetimes/16909886' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{
  "quantity": 1
}'
Response
{
  "onetime": {
    "id": 16909886,
    "address_id": 21317826,
    "created_at": "2018-11-14T11:20:05",
    "customer_id": 18819267,
    "next_charge_scheduled_at": "2021-12-17T00:00:00",
    "price": null,
    "product_title": "SuperKiwi ONETIME",
    "properties": [
      {
        "name": "grind",
        "value": "drip"
      },
      {
        "name": "size",
        "value": "medium"
      }
    ],
    "quantity": 1,
    "recharge_product_id": 518676,
    "shopify_product_id": 1255175363,
    "shopify_variant_id": 3844892483,
    "sku": null,
    "status": "ONETIME",
    "updated_at": "2018-11-14T11:20:05",
    "variant_title": "6oz"
  }
}

#Delete a onetime

DELETE/onetimes/{id}
Delete a Onetime.
Scopewrite_subscriptions
DELETE/onetimes/{id}
curl -X DELETE 'https://api.rechargeapps.com/onetimes/16665185' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{}

#List onetimes

GET/onetimes
Returns a list of all One Time products from store.
Scoperead_subscriptions

Query parameters

  • Return the onetimes linked to the given address_id.
  • Return the onetimes created before the given date.
  • Return the onetimes created after the given date.
  • Return the onetimes linked to the given Recharge customer id.
  • limitstring
    The number of results. Default is 50, maximum is 250.
    Default 50Maximum 250
  • pagestringDeprecated
    The page to show. Default is 1.
    Default 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.
  • Return the onetimes linked to the given Shopify customer id.
  • Return the onetimes updated before the given date.
  • Return the onetimes updated after the given date.
GET/onetimes
curl 'https://api.rechargeapps.com/onetimes?limit=3' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "onetimes": [
    {
      "id": 16909886,
      "address_id": 21317826,
      "created_at": "2018-11-14T11:20:05",
      "customer_id": 18819267,
      "next_charge_scheduled_at": "2018-12-17T00:00:00",
      "price": null,
      "product_title": "SuperKiwi ONETIME",
      "properties": [
        {
          "name": "grind",
          "value": "drip"
        },
        {
          "name": "size",
          "value": "medium"
        }
      ],
      "quantity": 1,
      "recharge_product_id": 518676,
      "shopify_product_id": 1255175363,
      "shopify_variant_id": 3844892483,
      "sku": null,
      "status": "ONETIME",
      "updated_at": "2018-11-14T11:20:05",
      "variant_title": "6oz"
    }
  ]
}