v41

latestOpenAPI 3.1.0raw.githubusercontent.com2025-08-053715199.1 KB
Subscription

Subscribe

Create a subscription for the current user.

post/subscription

Request body

idstring required

Unique object identifier. The format and length of IDs may change over time.

productVariantIDstring required

ID of the product variant being subscribed to.

priceinteger required

Price of the subscription in cents (USD).

quantityinteger required

Quantity of the subscription.

addressIDstring required

ID of the shipping address used for the subscription.

cardIDstring required

ID of the card used for the subscription.

nextstring

Next shipment and billing date for the subscription.

createdstring required

Date the subscription was created.

Example request

{
  "id": "sub_XXXXXXXXXXXXXXXXXXXXXXXXX",
  "productVariantID": "var_XXXXXXXXXXXXXXXXXXXXXXXXX",
  "price": 2200,
  "quantity": 1,
  "addressID": "shp_XXXXXXXXXXXXXXXXXXXXXXXXX",
  "cardID": "crd_XXXXXXXXXXXXXXXXXXXXXXXXX",
  "schedule": {
    "type": "weekly",
    "interval": 3
  },
  "next": "2025-02-01T19:36:19.000Z",
  "created": "2024-06-29T19:36:19.000Z"
}

Response

Subscription was created successfully.

data'ok' required