Payment Link for Failed Autocharged

There are some cases where payment cycles may fail due to generic errors in the payment method (e.g. insufficient balance, expired card, etc), preventing the cycle payment from being completed. In such cases, we offer an alternative solution - Payment Links. This link enables your customers to make payments manually to complete their transaction.

Payment Links helps collect payments from your customers by sharing a URL that leads to Xendit’s free checkout page which contains all of Xendit’s payment channels. You may refer to this documentation to learn more about Payment Links.

Benefits of using this feature :

  • Improve your Subscriptions plan’s success rate by capturing missed payments
  • Provide more payment options to your customers when their auto-debit payment fails to charge due to various reasons (example: Insufficient balance)
  • Allow customers to pay using a another payment method that they do not want to save/link to their Subscriptions plan

How to enable Payment Links in Subscriptions

How it works

When your plan has the payment_link_for_failed_attempt parameter set to “true,” then a payment link will be generated if there’s an auto-debit payment attempt fails. Below are the conditions you may need to know :

  • Payment Link will be generated when all Payment Methods attached to the plan failed on the payment attempt
  • Payment Link URL will be sent out to end customer along with failed cycle notification and also being included on the payload of recurring.cycle.retrying callback
    • Example of Subscription Cycle Failed Notification which contains Payment Link URL that will be sent out to the end customer
  • Example of recurring.cycle.retrying which include Payment Link URL
{
  "created": "2023-05-12T08:51:46.876Z",
  "business_id": "615f95632xxxxx232bf451",
  "event": "recurring.cycle.retrying",
  "data": {
      "id": "recy_xxx-xxx",
      "type": "SCHEDULED",
      "amount": 21110,
      "status": "RETRYING",
      "created": "2023-05-12T08:49:51.996Z",
      "plan_id": "repl_xxx-xxx",
      "updated": "2023-05-12T08:51:44.225Z",
      "currency": "IDR",
      "metadata": null,
      "customer_id": "cust-xxx-xxx",
      "cycle_number": 1,
      "reference_id": "Reference123",
      "attempt_count": 1,
      "attempt_details": [
          {
              "type": "INITIAL",
              "status": "FAILED",
              "created": "2023-05-12T08:51:39.959Z",
              "action_id": "ewc_xxx-xxx",
              "failure_code": "INSUFFICIENT_BALANCE",
              "payment_link": null,
              "action_number": 1,
              "attempt_number": 1,
              "next_retry_timestamp": "2023-05-13T08:51:44.229Z"
          },
          {
              "type": "PAYMENT_LINK",
              "status": "PENDING",
              "created": "2023-05-12T08:51:44.248Z",
              "action_id": null,
              "failure_code": null,
              "payment_link": {
                  "invoice_id": "645dfe201d87fa6953xxxxx",
                  "payment_link_url": "https://dev.xen.to/UffXxxx"
              },
              "action_number": 1,
              "attempt_number": 1,
              "next_retry_timestamp": null
          }
      ],
      "recurring_action": "PAYMENT",
      "scheduled_timestamp": "2023-05-12T00:00:00.000Z",
      "forced_attempt_count": 0
  },
  "api_version": "v1" }
  • Each cycle will only have 1 valid Payment Link URL that will remain active from the first failed attempt timestamp until the last retry attempt timestamp + 1 hour.
  • When retry payment attempt keeps failing, we will send again the Payment Link URL to the end customer respecting your notification configuration.
  • Immediate Charge and Force Cycle Attempt will not trigger the creation of payment link

Flow Chart

FAQ

QuestionAnswers
What would happen if a Payment Link had been generated and it remains unpaid, but the cycle has been completely paid?Once there’s a successful payment attempt, the cycle will be marked as “paid,” and the pending Payment Link will be voided to prevent any potential double payments for that cycle.
What will happen if no payment is made even after the maximum retry attempts, and the cycle fails?The cycle will be marked as “failed,” and no further payment attempts will be made for that particular cycle. At this point, the Payment Link will become inactive and can no longer be used for payment.
What are the payment methods that will be shown in the Payment Link?We will follow the same payment methods that have been implemented in your Checkout Settings. Please refer to this documentation for more information.

Last Updated on 2023-06-03