Documentation
Feedback
Guides
API Reference

Guides
Orders
Subscriptions
How to keep attachments from original orders in subscriptions

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 orderSubscription order grouping different attachments for the same SKUBehavior

Total: 8 items

  • [1] SKU X - Attachment A: Type I
    • Quantity: 2
  • [2] SKU X - Attachment A: Type II
    • Quantity: 3
  • [3] SKU X - No attachment
    • Quantity: 1
  • [4] SKU X - No attachment
    • Quantity: 1
  • [5] SKU Y - No attachment
    • Quantity: 1

Total: 8 items

  • [1] SKU X - Attachment A: Type I + SKU X - Attachment A: Type II + SKU X - No attachment
    • Quantity: 7
  • [2] SKU Y - No attachment
    • Quantity: 1

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 orderSubscription orders splitting the same SKUs with different attachmentsBehavior

Total: 8 items

  • [1] SKU X - Attachment A: Type I
    • Quantity: 2
  • [2] SKU X - Attachment A: Type II
    • Quantity: 3
  • [3] SKU X - No attachment
    • Quantity: 1
  • [4] SKU X - No attachment
    • Quantity: 1
  • [5] SKU Y
    • Quantity: 1

Total: 8 items

  • [1] SKU X - Attachment A: Type I
    • Quantity: 2
  • [2] SKU X - Attachment A: Type II
    • Quantity: 3
  • [3] SKU X - No attachment
    • Quantity: 2
  • [4] SKU Y - No attachment
    • Quantity: 1

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 to true if the enableAttachments field is also set to true.

Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page