Correct a subscription before the shopper accepts it
Use POST /api/public/v1/subscriptions/{id}/replace when a subscription you created has wrong data — a mistyped phone, email or address, or the wrong products — and the shopper has not accepted it yet. It replaces the subscription's cart with a new one; the old cart and its link stop working.
When you can replace
| Subscription status | Replace allowed |
|---|---|
draft | Yes — the subscription stays draft |
sent | Yes |
in_progress | Yes, until the shopper accepts |
| Any other status, or the shopper already accepted | No — 409 |
Request
The body is the same as POST /api/public/v1/subscriptions (create), with the same validations and the same price and fee calculation.
mobile_phoneis required.- Send the full customer block, as in create. Omit it to keep the stored customer.
cart_items: omit to keep the current items and discounts; send it to rebuild both.reference: may change, but not to a reference used by another of your subscriptions (422). If your references are auto-generated, the previous one is kept and this field is ignored.operator_ref: optional, as in create.
curl -X POST https://<host>/api/public/v1/subscriptions/1049/replace \
-u <user>:<password> \
-H "Content-Type: application/json" \
-d '{
"mobile_phone": "611222333",
"given_names": "John",
"surnames": "Doe Jr",
"email": "[email protected]",
"date_of_birth": "2000-12-20",
"nin": "12345678Z",
"address": "C falsa, 123",
"postal_code": "01234",
"city": "Barcelona"
}'Response
200 with the subscription, exactly as create returns it. last_persisted_cart is the new cart, with its own code and expiry.
The shopper is not notified
Replace sends no SMS. To send the shopper the new link, call POST /api/public/v1/subscriptions/{id}/send_sms afterwards.
Errors
Same format as create: {"errors": [{"code", "title", "attribute"}]}.
| Status | When |
|---|---|
401 | Credentials missing or wrong |
404 | No subscription with that id for your credentials |
409 | The cart can no longer be replaced (e.g. already_accepted) |
422 | The body is invalid, as create would refuse it, or the reference belongs to another subscription |
Full schema: see Replace subscription cart in the API reference.
Updated about 1 hour ago