Skip to main content

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

  1. Start a New Payment Session

    • Send a POST request to initialize a CIT payment session.
    • Include the subscription.id field with the ID of the existing subscription.
    • If no immediate payment is needed, set amount to 0.
    • For payment methods requiring a known recurring amount (e.g., Vipps MobilePay), set subscription.amount to the expected recurring subscription amount.
  2. Handle the Payment Session

    • Redirect the customer to the ePay payment window or use hosted fields.
    • The customer completes authentication and payment method update.
  3. 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:

POST /public/api/v1/cit
{
"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 amount is 0.
  • 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.