Cancel subscription

Cancel a subscription at period end or immediately.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Overview

Cancel one of the authenticated customer's subscriptions. subscription_id is required. mode defaults to end of period; mode=now cancels immediately and refunds/credits per the plan and account settings — but only when the account enables immediate cancellation. reason is optional. Returns the customer resource with a fresh JWT.

Example:

curl --request POST \
  --url 'https://www.pelcro.com/api/v1/sdk/subscription/cancel?site_id=1232' \
  --header 'Authorization: Bearer <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{ "subscription_id": 4055, "reason": "too_expensive" }'

Notes

  • Protected — requires the customer's JWT.
  • A missing subscription_id, an unknown subscription, or immediate-cancel when disabled all return 404 with a message.
Query Params
int32
required

The unique identifier of the site associated with your account.

Body Params
int32
required

The unique identifier of the subscription to cancel.

string
enum
Defaults to last_period_end

Defines the cancellation mode, one of now, current_period_end or last_period_end. Choosing now will cancel it immediately and refund the prorated amount, if applicable. Default is to cancel at last_period_end.

Allowed:
string

The cancellation reason.

Responses

Language
Credentials
Query
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json