Updating Payment Method for a Subscription
Merchants can update the payment method of an existing subscription by initiating a payment session and referencing the subscription ID.
Steps to Update a Subscription Payment Method
-
Start a New Payment Session
- Send a
POSTrequest to initialize a CIT payment session. - Include the
subscription.idfield with the ID of the existing subscription. - If no immediate payment is needed, set
amountto0. - For payment methods requiring a known recurring amount (e.g., Vipps MobilePay), set
subscription.amountto the expected recurring subscription amount.
- Send a
-
Handle the Payment Session
- Redirect the customer to ePay Checkout or use Blocks
- The customer completes authentication and payment method update.
-
Receive Confirmation via Webhook
- Once the transaction completes, ePay sends a webhook confirming the updated payment method.
Example Request
Updating a subscription without immediate payment:
{ "pointOfSaleId": "0192473a-e381-705c-b61c-fc2ac9624afc", "amount": 0, "currency": "DKK", "subscription": { "id": "01929a94-5fce-7ccc-a7e4-7e9249133b39", "amount": 20000 }}See all fields.
Expected Behavior
- The new payment method is linked to the existing subscription.
- No charge is made if
amountis0. - Merchants will receive a webhook confirmation once the update is successful.
This process ensures that customers can seamlessly update their payment details while maintaining their active subscriptions.