Skip to content
Developers
Get started
Early access: these pages are being written and reviewed. Facts in the header boxes come straight from the product.

Cancel the subscription

POST
/api/v1/billing/subscription/cancel
curl --request POST \
--url https://api.pitch2sale.com/api/v1/billing/subscription/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "at_period_end": true }'

Cancels at Cashfree immediately, so no further charge is taken. Access continues until the end of the paid period. A subscription that was never charged (payment setup only) ends at once and leaves the plan, status and trial exactly as they were. A subscription Cashfree had already ended (canceled, expired, completed) counts as canceled. No refunds. Idempotent: a repeat returns the canceled subscription (also for a never-charged setup that already ended). A subscription Cashfree no longer knows (404) counts as ended. 10 billing changes per hour per organization. 409 gateway_cancel_refused (nothing changed) when Cashfree refuses to cancel a subscription it still reports as live — the message names its status; 502 gateway_error (nothing changed) only when Cashfree is unavailable. Owners and admins only.

Media typeapplication/json
object
at_period_end
required
boolean

OK

Validation failed

Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example",
"code": "example"
}
]
}

Authentication required or token invalid

Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example",
"code": "example"
}
]
}

Role permission or token scope missing; OAuth app tokens are not accepted on this route

Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example",
"code": "example"
}
]
}

Rate limit exceeded

Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{
"error": "example",
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example",
"code": "example"
}
]
}