patch
https://sandbox.dev.business.mamopay.com/manage_api/v1/subscriptions//subscribers//change_customer_subscription
Moves a subscriber from their current subscription to another one, without asking the customer to enter their card again. Send the target subscription's ID as target_subscription_id.
Mamo charges the customer's saved card the target plan's price minus the unused part of their current period. If the charge succeeds, the customer is subscribed to the target subscription and unsubscribed from the current one, and the response is the new subscriber. If it fails, the customer stays on their current subscription.
Constraints
- The charge is the target plan's price minus the unused part of the current period. If that amount is below the minimum chargeable amount (or is zero or negative), the call fails with
PRORATION_BELOW_MINIMUM. Moving to a cheaper plan therefore only succeeds when little of the current period is left. - Both subscriptions must use the same currency.
- The target subscription must be attached to a payment link. Otherwise the call returns
404.
Error codes
These return 422.
error_code | Message | Meaning |
|---|---|---|
INACTIVE_SUBSCRIBER | Subscriber must be active to upgrade | The subscriber is not active. |
MISSING_CARD | Customer has no saved card for off-session charging | The subscriber has no saved card that can be charged without the customer present. |
SAME_SUBSCRIPTION | Target subscription is the same as the current one | The target is the subscriber's current subscription. |
ALREADY_SUBSCRIBED | Customer is already subscribed to the target | This card has (or had) a subscriber record on the target subscription, including an unsubscribed one. |
CURRENCY_MISMATCH | Subscriptions must have the same currency to upgrade | The two subscriptions use different currencies. |
PRORATION_BELOW_MINIMUM | Upgrade charge amount is below the minimum | The prorated charge is below the minimum chargeable amount: AED 2, USD 0.55, EUR 0.50, GBP 0.50, and 2 in any other currency (for example SAR 2). |
CHARGE_FAILED | Includes the decline reason | The proration charge was declined. |
Recipes
🔁
Bill a customer every month
Open Recipe
429Too many requests. You sent more than 100 requests in 30 seconds from one IP address. This response has no JSON body. See Rate limits.
500Unexpected error