Subscriptions is the VTEX solution for customers who want to make recurring purchases at the store on a regular schedule. When customers subscribe, they define what products they want to acquire regularly and at the frequency they want these automatic orders to be created.
When a new subscription is created from an order containing SKUs with attachments, the platform default behavior is to discard the attachments in future subscription orders. However, you can configure the store to incorporate SKU attachments from the original order into recurring orders.
Configuring the store to keep attachments from original orders
To allow a VTEX store to keep SKU attachments for subscription orders, use the Edit subscriptions settings endpoint. Within the request body, in the attachmentPreferences
object, set the enableAttachments
field as true
, as shown below:
_10"attachmentPreferences": {_10 "enableAttachments": true_10 }
Whether an order contains the same SKU with or without attachments, keep in mind that the platform's default behavior is to group these SKUs. You can configure the platform to split the same SKUs with attachments instead.
Original orders containing the same SKUs with different attachments
The platform’s default behavior when keeping attachments from original orders is to group the same SKUs, regardless of whether they have attachments.
The table below shows how the SKU grouping works:
Original order | Subscription order grouping different attachments for the same SKU | Behavior |
---|---|---|
Total: 8 items
| Total: 8 items
| When the original order has the same SKUs, with and without attachments, the subscription order groups them together. |
You can change this behavior so that subscription orders created from original orders containing the same SKUs with different attachments are not grouped together but kept separate.
The table below shows how that works:
Original order | Subscription orders splitting the same SKUs with different attachments | Behavior |
---|---|---|
Total: 8 items
| Total: 8 items
| The organization from the original order is kept for subscription orders, and the same SKUs with attachments are no longer grouped, not even if they have the same type of attachment. Only SKUs that do not have attachments will be grouped. |
Configuring to split the same SKUs with different attachments
To allow a VTEX store to keep SKU attachments for new subscriptions, use the Edit subscriptions settings endpoint. In the request body, inside the property attachmentPreferences
, set the enableAttachments
field to true
, as shown below:
_10"attachmentPreferences": {_10 "enableAttachments": true,_10 "splitSameSkuWithDifferentAttachments": true_10 }
The
splitSameSkuWithDifferentAttachments
field can only be set totrue
if theenableAttachments
field is also set totrue
.