Backend API
Create a gift card product that will be fulfilled by shipping a physical card.
Arguments
Human-friendly name of the product.
Specify the denominations available on the product.
Name of the denominated value.
List of possible values for this option.
Human-friendly name of the option value.
Value fulfilled as a gift card when the option is selected.
Must be true for gift card options.
Set to giftcard to indicate the product is a gift card.
For gift cards fulfilled digitally, set delivery=shipment.
Possible enum values:
Set true to make the product visible to customers in a storefront, otherwise it will be hidden.
An object containing custom attribute key/value pairs. See attributes for more details.
Primary category, commonly used as a navigation anchor.
A long-form description of the product. Can have HTML or other markup languages.
List of images depicting the bundle.
A brief description of the image, intended for display as a caption or alt text.
An object representing the image's source file.
Set or overwrite file data. Use the following format when writing a file from binary data (for example an image): data[$binary]=<base64 encoded binary daya>.
Optional file name.
Page description used for search engine optimization purposes.
Page keywords used for search engine optimization purposes.
Page title used to override product name in storefronts.
Lowercase, hyphenated identifier typically used in URLs. When creating a product, a slug will be generated automatically from the name. Maximum length of 1,000 characters.
List of arbitrary tags typically used as metadata to improve search results or associate custom behavior with a product.
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.post('/products', {
name: 'Gift Card',
type: 'giftcard',
delivery: 'shipment',
options: [
{
name: 'Value',
variant: true,
values: [
{
name: '$25',
price: 25,
},
{
name: '$50',
price: 50,
},
{
name: '$100',
price: 100,
},
],
},
],
});
Response
{
"id": "5cad15bc9b14d1990724663a",
"delivery": "shipment"
"name": "Gift Card",
"options": [
{
"id": "5ca24ab32599d4179c24a624",
"name": "Value",
"variant": true,
"values": [
{
"id": "5ca24ad59c077817e5fe2ba3",
"name": "$25",
"price": 25
},
{
"id": "5ca24ad59c077817e5fe2ba4",
"name": "$50",
"price": 50
},
{
"id": "5ca24ad59c077817e5fe2ba5",
"name": "$100",
"price": 100
}
]
}
],
"slug": "gift-card",
"type": "giftcard"
}