General

Customer portal Link

 

Create a link for a customer so that they can manage their subscriptions, billing details, invoices and payment methods.

Request

Request to generate a customer postal page session URL.

Path

POST /customer-portal/link

Example (No Subscription)

The example below only includes the customer_id. When no subscription_id is provided, the customer will be presented with the available packages and can create a new subscription.

{
  "customer_id": "cus_abc123...",
}

Example (Subscription)

The example below includes both the customer_id and subscription_id. This allows the customer to manage a specific subscription. If the subscription is inactive, the customer will have the option to reactivate it.

{
  "customer_id": "cus_abc123...",
  "subscription_id": "sub_abc123...",
}

Example (Advanced settings)

The example below demonstrates how to override the default settings configured in the dashboard. This can be useful when you need to disable specific features for certain customers or subscriptions, or when different products should be displayed for a particular subscription.

{
  "customer_id": "cus_abc123...",
  "subscription_id": "sub_abc123...",
  "settings": {
    "show_invoices": true, // allow the user to view the invoices
    "show_billing_info": true, // show the user's billing info
    "allow_update_billing_info": true, // allow the user to update their billing info
    "allow_cancel": true, // allow the user to cancel the subscription
    "cancel_type": "AFTER_BILLING_PERIOD", // NOW or AFTER_BILLING_PERIOD
    "allow_switch_plan": true, // allow the user to switch to another plan
    "products_ids": ["pro_abc123...", "pro_abc123..."], // add multiple products that the user can select. This will be grouped by interval and orders from the smallest amount to largest
    "redirect_url": "https://my-portal.site.com", // if the user selects back to site or closes the link then they will be redirected to this page
    "page_title": "My SaaS business" // Change the left side page title
  }
}

Request Parameters

Fields below appear in the request body examples on this page. Y = always required, C = conditional, N = optional.

Field
RequiredType
Description
Example
customer_idYStringThe customer the portal link is generated forcus_abc123...
subscription_idNStringManage a specific subscription. If omitted, the customer can select a package to create a new subscription. If the subscription is inactive the user can activate it.sub_abc123...
settingsNObjectOverride the default portal settings. Omit to use your account defaults.See advanced example
settings.show_invoicesNBooleanAllow the user to view their invoicestrue
settings.show_billing_infoNBooleanShow the user's billing infotrue
settings.allow_update_billing_infoNBooleanAllow the user to update their billing infotrue
settings.allow_cancelNBooleanAllow the user to cancel the subscriptiontrue
settings.cancel_typeNENUMWhen a cancellation takes effect: NOW or AFTER_BILLING_PERIODAFTER_BILLING_PERIOD
settings.allow_switch_planNBooleanAllow the user to switch to another plantrue
settings.products_idsNArrayProduct ids the user can select from. Grouped by interval and ordered from the smallest amount to the largest.["pro_abc123...", "pro_abc123..."]
settings.redirect_urlNStringWhere the user is redirected when they select "back to site" or close the linkhttps://my-portal.site.com
settings.page_titleNStringOverride the left-side page titleMy SaaS business

Response Body

{
    "status": true,
    "result": {
      "id": "cpl_HVpCeoNys1f22X7QcuWHY",
      "session_id": "ses_G-xkVKoxHgEBrY8suKgR3",
      "customer_id": "cus_abc123...",
      "subscription_id": "sub_abc123...",
      "link_url": "https://pay.kwik.co.za/portal/a0oDxntJxWlA8LjfOR9bgck9C4w....",
      "expires_at": "2026-03-13T12:30:00Z"
    }
}

Response Parameters

Field
Type
Description
Example
statusBooleanIndicates if the request was successfultrue
result.idStringUnique customer portal link identifiercpl_HVpCeoNys1f22X7QcuWHY
result.session_idString(32)Session identifier for the portal linkses_G-xkVKoxHgEBrY8suKgR3
result.customer_idString(32)Associated customer IDcus_abc123...
result.subscription_idString(32)Associated subscription ID, when a subscription_id was suppliedsub_abc123...
result.link_urlStringURL to redirect the user to the customer portalhttps://pay.kwik.co.za/portal/a0oDxntJxWlA8LjfOR9bgck9C4w....
result.expires_atStringISO timestamp when the portal link expires2026-03-13T12:30:00Z