Updating the subscriptions
How to customize the next subscription occurrences
Problem
Solution
Updating the order subscription
Suspending, activating, and cancelling an order subscription
Deactivate
curl -g -X PATCH \
'https://yourdomain.commercelayer.io/api/order_subscriptions/BkMdJFGdjX' \
-H 'Authorization: Bearer your-access-token' \
-H 'Accept: application/vnd.api+json' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "order_subscriptions",
"id": "BkMdJFGdjX",
"attributes": {
"_deactivate": true
}
}
}'{
"data": {
"id": "BkMdJFGdjX",
"type": "order_subscriptions",
"links": {
"self": "https://yourdomain.commercelayer.io/api/order_subscriptions/BkMdJFGdjX"
},
"attributes": {
"number": "825",
"status": "inactive",
"frequency": "two-month",
"activate_by_source_order": true,
"customer_email": "[email protected]",
"starts_at": "2023-03-23T14:47:21.136Z",
"expires_at": "2023-12-31T23:59:59.000Z",
"next_run_at": "2023-03-30T17:30:00.000Z",
"occurrencies": 0,
"errors_count": 0,
"succeeded_on_last_run": true,
"options": {
"activate_by_source_order": true,
"place_target_order": true
},
"created_at": "2023-03-23T14:47:21.138Z",
"updated_at": "2023-03-23T16:55:19.649Z",
"reference": null,
"reference_origin": null,
"metadata": {}
},
"relationships": {
"market": { ... },
"subscription_model": { ... },
"source_order": { ... },
"customer": { ... },
"customer_payment_source": { ... },
"order_subscription_items": { ... },
"order_factories": { ... },
"order_copies": { ... },
"recurring_order_copies": { ... },
"orders": { ... },
"events": { ... }
},
"meta": {
"mode": "test",
"organization_id": "EnAvaFOrRe"
}
}
}Activate / Reactivate
Cancel
Changing the subscription frequency
Changing the subscription expiration date
Changing the subscription next run date
Changing the customer payment source
Updating the order subscription items
Changing the quantity of a product belonging to a subscription
Changing the price of a product belonging to a subscription
Changing one of the subscription products
Adding a new product to a subscription
Removing a product from a subscription
More to read
Last updated