Ordering a subscription via the API and confirming online payment
How an external program orders a subscription package for its own client, and when the subscription takes effect after an online payment.
An external program can order a subscription package through the API. The orderer is always the owner of the API key; ordering on someone else's behalf is not possible. With online payment the subscription changes when the payment provider confirms the payment, not when the buyer returns to the website.
Ordering
- Ask the administrator for the IDs of the orderable subscription definition and plan. Only an active, enabled definition can be ordered, and the plan must belong to the definition and to the current store.
- Send the order with the definition, the plan and the number of months. The number of months is at most 120; with 0 the subscription has no end date.
- Check the response: client, users concerned, number of permissions created and updated, start and end of validity.
What happens after the order?
- Validity starts on the orderer's registration date and ends after the given number of months.
- If the orderer has a home client, the package's features go to every user of that client, otherwise only to the orderer.
- The order adds: users keep their existing permissions.
Online payment
When the buyer returns from the payment page, the message is: "Payment received. The subscription is updated once the provider confirms it." The subscription state changes after the provider's signed notification: settled on success, failed on failure, cancelled on cancellation.
Example
Sample Ltd.'s reseller interface orders a package for 12 months. All three users of Sample Ltd.'s client receive the package's features and keep their earlier individual permissions.