Backend API
Retrieve an existing subscription plan using the product ID that was returned when created.
Arguments
idobjectIdrequired
The id of the product to retrieve.
expandstring
Expanding link fields and child collections is performed using the expand argument.
- For example, expand=account would return a related customer account if one exists.
When the field represents a collection, you can specify the query limit.
- For example, expand=variants:10 would return up to 10 records of the variants collection.
See expanding for more details.
fieldsstring
Return only the specified fields in the result. For example fields=name,slug would return only the fields name and slug in the response. Supports nested object and array fields using dot-notation.
- For example, items.product_id. The category id is always returned.
includestring
Include one or more arbitrary queries in the response, possibly related to the main query.
See including for more details.
GET/products/:id
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.get('/products/{id}');
The product model
{
"name": "Skooma",
"purchase_options": {
"subscription": {
"active": true,
"plans": [
{
"name": "Monthly",
"description": null,
"price": 75,
"billing_schedule": {
"interval": "monthly",
"interval_count": 1,
"limit": null,
"trial_days": 1
},
"id": "64e799c1307e48001237eef5",
"active": true
}
]
}
},
"currency": "USD",
"slug": "skooooma",
"price": 75,
"type": "standard",
"delivery": "shipment",
"tax_class": "standard",
"date_created": "2023-08-24T17:56:17.162Z",
"active": false,
"stock_status": null,
"id": "64e799c1307e48001237eef4"
}