Next Commerce
Subscriptions

Subscriptions Lines Create

Create a new subscription line.

POST
/subscriptions/{id}/lines/

Authorization

oauth2 subscriptions:write
AuthorizationBearer <token>

Generate an Access Token through Settings > API Access for single store access or use the Authorization Code flow with your partner App Client ID. Use required permission scopes for API endpoint access. Example Authorization: Bearer 123

In: header

Scope: subscriptions:write

Path Parameters

id*integer

A unique integer value identifying the Subscription.

Header Parameters

X-29next-API-Version*string
Default"unstable"
Value in"unstable"

Request Body

metadata?unknown|null
price?string
Match^-?\d{0,10}(?:\.\d{0,2})?$
Formatdecimal
product_id*integer
quantity*integer

Response Body

application/json

curl -X POST "https://example.com/subscriptions/0/lines/" \  -H "X-29next-API-Version: unstable" \  -H "Content-Type: application/json" \  -d '{    "product_id": 0,    "quantity": 0  }'
{
  "id": 0,
  "metadata": null,
  "price": "string",
  "product_id": 0,
  "product_image": "http://example.com",
  "product_title": "string",
  "product_url": "http://example.com",
  "quantity": 0,
  "sku": "string",
  "variant_id": 0,
  "variant_title": "string"
}