Billing Portal

Read Billing Portal Management Link

GET
/portal/customers/{customer_id}/management_link.json

Returns the exact URL required for a subscriber to access the Billing Portal.

Management Link Request Rules

  • When retrieving a management URL, multiple requests for the same customer in a short period return the same URL
  • A new URL is not generated for 15 days
  • You must cache and remember this URL if you are going to need it again within 15 days
  • Only request a new URL after the new_link_available_at date
  • You are limited to 15 requests for the same URL. If you make more than 15 requests before new_link_available_at, you are blocked from further Management URL requests (with a response code 429).

Authorization

BasicAuth
AuthorizationBasic <token>

The username is a Maxio Chargify API key. The password is x.

In: header

Path Parameters

customer_id*integer

The Chargify id of the customer

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/portal/customers/0/management_link.json"
{  "url": "https://www.billingportal.com/manage/19804639/1517596469/bd16498719a7d3e6",  "fetch_count": 1,  "created_at": "2018-02-02T18:34:29Z",  "new_link_available_at": "2018-02-17T18:34:29Z",  "expires_at": "2018-04-08T17:34:29Z",  "last_invite_sent_at": "2018-02-02T18:34:29Z"}

Enable Billing Portal for Customer POST

Enables Billing Portal access for a customer, with an option to send an invitation email at the same time. ## Billing Portal Security If your customer has been invited to the Billing Portal, they receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** If you need to provide your customer their Management URL through other means, you can retrieve it [via the API](https://maxio-test-wp.pages.dev/api/openapi/billing-portal/readBillingPortalLink). Because the URL is cryptographically signed with a timestamp, merchants cannot generate the URL without requesting it through the API. To prevent abuse and overuse, request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), **do not** make an API request every time. For more information configuring the Billing Portal, see [Billing Portal Overview](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview).

Resend Billing Portal Invitation POST

Resends a customer's Billing Portal invitation. If you attempt to resend an invitation 5 times within 30 minutes, you will receive a `422` response with an `error` message in the body. If you attempt to resend an invitation when the Billing Portal is already disabled for a Customer, you will receive a `422` error response. If you attempt to resend an invitation when the Customer does not exist, you will receive a `404` error response. ## Limitations This endpoint will only return a JSON response.