Syntax
createUpgradePurchase(
purchase_ids,
upgrade_id,
payment_plan_id=false,
quantities=array()
)
Performs an upgrade without user interaction.
Access rights
Full access required.
In addition, the “Billing on demand” right must be enabled for the vendor account.
Arguments
purchase_ids – One or more purchase ids (comma separated). Digistore picks one matching purchase id to upgrade.
upgrade_id – The id of the upgrade to be applied. Either the numeric id (NNN) or the id containing the authkey (NNN-XXXXXXX).
payment_plan_id – (optional) Id or index (starting with 1) of the payment plan to be applied to the new purchase.
quantities – (optional) An array with quantities. The array keys are either the item positions (starting with 1) or the product ids. E.g. buy the main product once and the first addon product five times:
[
1 => 1,
2 => 5,
]
or
[
12345
=> 1,
54321 => 5,
]
Buyer information
If you use this API function
- you must make sure the buyer is informed about automatic upgrades
- and that they agree to them.
After each upgrade, Digistore sends an email to the buyer informing them about the upgrade.
Return data
[data] => Array
(
[new_purchase] => Array
(
[id] =>
ABCD1234
[billing_status]
=> paying
[paid_amount] =>
97.3
[next_payment_at]
=> 2021-03-21
[next_amount] =>
139.23
[currency] =>
EUR
)
[upgrade_info] => Array
(
[upgrade_type]
=> upgrade
[upgrade_amount_left] => 0.00
[upgrade_amount_total] => 41.93
[upgraded_purchase_id] => CDEF3456
)
)