Create a membership billing portal session
curl --request POST \
--url https://api.letsdothis.com/v0/membership-policies/{policyId}/billing-portal-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"returnUrl": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({returnUrl: '<string>'})
};
fetch('https://api.letsdothis.com/v0/membership-policies/{policyId}/billing-portal-session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.letsdothis.com/v0/membership-policies/{policyId}/billing-portal-session"
payload = { "returnUrl": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"url": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 123,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 123,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 123,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 123,
"message": "<string>"
}Memberships
Create a membership billing portal session
Creates a short-lived billing portal session for the policy. The caller must authorize its logged-in member to the policy before invoking this endpoint. Each call returns a new session, so a request can be repeated safely. returnUrl must use HTTPS and isn’t checked against your domains, so send only your own return URLs and never forward one from your client. Redirect the member to url straight away and don’t log or store it. Returns 409 MEMBERSHIP_BILLING_UNAVAILABLE when the policy has no billing customer, 409 MEMBERSHIP_PORTAL_CONFIGURATION_REQUIRED when the organizer’s billing portal isn’t set up yet, and 503 MEMBERSHIP_BILLING_UNAVAILABLE when billing is temporarily unreachable; retry a 503 with backoff.
POST
/
v0
/
membership-policies
/
{policyId}
/
billing-portal-session
Create a membership billing portal session
curl --request POST \
--url https://api.letsdothis.com/v0/membership-policies/{policyId}/billing-portal-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"returnUrl": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({returnUrl: '<string>'})
};
fetch('https://api.letsdothis.com/v0/membership-policies/{policyId}/billing-portal-session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.letsdothis.com/v0/membership-policies/{policyId}/billing-portal-session"
payload = { "returnUrl": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"url": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 123,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 123,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 123,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 123,
"message": "<string>"
}This endpoint is in beta: its request and response contract can still change while it’s being developed.
Was this page helpful?

