Update subscription products
A subscription can handle different type of updates: adding or removing items, and the most common, making an exchange of an item by another one. In any of these case what the API requires is to get the new full cart
Endpoint /api/public/v1/subscriptions/:subscription_id/update_products
Method POST
Shopper confirmation
An update requires a subscriber confirmation. You have to listen for a webhook to get the confirmation of the operation.
Payload
The service will calculate the difference between items based on their item IDs. In this example, the first item doesn't change, so no more data is required. The second item is new. If the previous cart had another item, that item would be removed because its ID is no longer present.
{
"cart_items": [
{
"id": "5025d4dc-7eb2-4686-9b11-cde4e1469f4d"
},
{
"type": "material_subscription",
"reference": "NEW-001",
"name": "New Product",
"price_with_tax": 30000,
"quantity": 1,
"subscription_price": 1200,
"subscription_period": "24 months"
}
]
}
Response
{
"success": true,
"message": "Productos de suscripción actualizados exitosamente"
}
Updated about 2 hours ago