Change a policy's offering
curl --request POST \
--url https://api.letsdothis.com/v0/membership-policies/{policyId}/offering-change \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"toOfferingId": "<string>"
}
'const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({toOfferingId: '<string>'})
};
fetch('https://api.letsdothis.com/v0/membership-policies/{policyId}/offering-change', 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}/offering-change"
payload = { "toOfferingId": "<string>" }
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"policyChangeId": "<string>",
"state": "ACCEPTED",
"effectiveAt": "2023-11-07T05:31:56Z",
"payment": {
"amountDue": {
"value": 123,
"currencyCode": "<string>"
},
"payBy": "2023-11-07T05:31:56Z",
"status": "PAID",
"reason": "BILLING_SCOPE_NOT_GRANTED",
"url": "<string>"
}
}{
"code": "MEMBERSHIP_INVALID_REQUEST",
"statusCode": 400,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 404,
"message": "<string>"
}{
"code": "MEMBERSHIP_OFFERING_CHANGE_REFUSED",
"statusCode": 409,
"message": "<string>",
"reasons": [
"<string>"
]
}{
"code": "MEMBERSHIP_IDEMPOTENCY_KEY_REUSED",
"statusCode": 422,
"message": "<string>"
}{
"code": "MEMBERSHIP_OFFERING_CHANGES_UNAVAILABLE",
"statusCode": 503,
"message": "<string>"
}Memberships
Change a policy's offering
Moves the policy to another offering in its scheme, either now or from its next renewal.
How to use it
- Send an
Idempotency-Keyheader, unique to each change you mean to make, and the same key on a retry. A retry returns the change the first request made. - With an organizer key, your organization makes the change: member rules and the notice period don’t apply, and nothing is charged.
returnUrlisn’t accepted. - With a member token, only the primary member can ask, and the scheme’s member rules and notice period apply. An upgrade made
NOWmay owe the difference, andpaymentsays what is due and by when.
Paying for an upgrade
- A token with the
memberships:billingscope charges the member’s saved card straight away, andstatusisPAID. - Otherwise, or when the card is declined, needs the member’s bank to confirm it, or there’s no card,
statusisACTION_REQUIREDwith areason. Send the member tourl, our page where they finish paying. The change applies once it’s paid. - Send
returnUrlto bring the member back afterwards. It must be on the origin of one of your app’s redirect URIs, or use the same custom scheme and host. We addpolicyChangeIdandoutcome(paid,failedorexpired) to its query.
POST
/
v0
/
membership-policies
/
{policyId}
/
offering-change
Change a policy's offering
curl --request POST \
--url https://api.letsdothis.com/v0/membership-policies/{policyId}/offering-change \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"toOfferingId": "<string>"
}
'const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({toOfferingId: '<string>'})
};
fetch('https://api.letsdothis.com/v0/membership-policies/{policyId}/offering-change', 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}/offering-change"
payload = { "toOfferingId": "<string>" }
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"policyChangeId": "<string>",
"state": "ACCEPTED",
"effectiveAt": "2023-11-07T05:31:56Z",
"payment": {
"amountDue": {
"value": 123,
"currencyCode": "<string>"
},
"payBy": "2023-11-07T05:31:56Z",
"status": "PAID",
"reason": "BILLING_SCOPE_NOT_GRANTED",
"url": "<string>"
}
}{
"code": "MEMBERSHIP_INVALID_REQUEST",
"statusCode": 400,
"message": "<string>"
}{
"code": "MEMBERSHIP_RESOURCE_NOT_FOUND",
"statusCode": 404,
"message": "<string>"
}{
"code": "MEMBERSHIP_OFFERING_CHANGE_REFUSED",
"statusCode": 409,
"message": "<string>",
"reasons": [
"<string>"
]
}{
"code": "MEMBERSHIP_IDEMPOTENCY_KEY_REUSED",
"statusCode": 422,
"message": "<string>"
}{
"code": "MEMBERSHIP_OFFERING_CHANGES_UNAVAILABLE",
"statusCode": 503,
"message": "<string>"
}This endpoint is in beta: its request and response contract can still change while it’s being developed.
Authorizations
Headers
Path Parameters
Body
application/json
Member tokens only: where our payment page sends the member once they have paid, failed to or run out of time, with policyChangeId and outcome (paid, failed or expired) added to its query. It must be on the origin of one of your app's redirect URIs, or use the same custom scheme and host.
Response
The change that was made or scheduled. For an upgrade that needs paying for, payment says what's due.
Was this page helpful?

