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_INVALID_REQUEST",
"statusCode": 400,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 404,
"message": "<string>"
}{
"code": "MEMBERSHIP_PORTAL_CONFIGURATION_REQUIRED",
"statusCode": 409,
"message": "<string>"
}{
"code": "MEMBERSHIP_BILLING_UNAVAILABLE",
"statusCode": 503,
"message": "<string>"
}Memberships
Create a membership billing portal session
Creates a short-lived billing portal session where a member can manage their payment details.
How to use it
- Check that your signed-in member holds this policy before calling.
- Redirect the member to
urlstraight away, and don’t log or store it. returnUrlmust use HTTPS. It isn’t checked against your domains, so send only your own return URLs, never one from your client.- Each call creates a new session, so you can safely repeat a request.
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_INVALID_REQUEST",
"statusCode": 400,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 404,
"message": "<string>"
}{
"code": "MEMBERSHIP_PORTAL_CONFIGURATION_REQUIRED",
"statusCode": 409,
"message": "<string>"
}{
"code": "MEMBERSHIP_BILLING_UNAVAILABLE",
"statusCode": 503,
"message": "<string>"
}This endpoint is in beta: its request and response contract can still change while it’s being developed.
Authorizations
Path Parameters
Was this page helpful?

