Skip to main content
POST
/
v0
/
subscriptions
/
{id}
/
termination
Terminate
curl --request POST \
  --url https://api.paygentic.io/v0/subscriptions/{id}/termination \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "reason": "<string>"
}'
{
  "id": "sub_z1a2b3c4d5e6f7g8",
  "object": "subscription",
  "autoCharge": false,
  "createdAt": "2024-01-10T08:00:00Z",
  "customerId": "cus_q3r4s5t6u7v8w9x0",
  "endingAt": null,
  "estimatedTaxRate": 8.5,
  "items": [],
  "name": "StartupXYZ - Image Generation Service",
  "payment": null,
  "planId": "plan_t9u0v1w2x3y4z5a6",
  "prefundAmount": "50000000000",
  "startedAt": "2024-01-10T08:00:00Z",
  "status": "terminated",
  "terminatedAt": "2024-03-15T14:20:00Z",
  "terminatedBy": "org_f7g8h9i0j1k2l3m4",
  "terminationReason": "Customer requested cancellation",
  "updatedAt": "2024-03-15T14:20:00Z",
  "walletId": "acc_b7c8d9e0f1g2h3i4"
}

Authorizations

Authorization
string
header
required

API key authentication

Path Parameters

id
string
required

The subscription ID

Body

application/json
reason
string
required

Cancellation explanation text. Sample values: 'Customer requested cancellation', 'Payment failure', 'Service migration', 'Contract expiration'

Required string length: 1 - 1000

Response

Subscription terminated successfully

id
string
object
enum<string>
Available options:
subscription
autoCharge
boolean
default:false

Whether automatic charging is enabled for this subscription. When true, invoices will be automatically paid using stored payment methods.

createdAt
string<date-time>
customerId
string
endingAt
string<date-time>
estimatedTaxRate
number

Projected tax percentage rate. Sample values: 8.875 indicates 8.875% tax rate, 10.0 indicates 10% tax rate, 0 indicates no tax applied

items
object[]

Array of upfront subscription items with quantities and costs

name
string
payment
object

Payment session details when upfront payment is required

planId
string
prefundAmount
string

Minimum required wallet balance in atomic units. Sample values: '200000000000' equals $200.00 minimum, '1000000000000' equals $1000.00 minimum

startedAt
string<date-time>
status
enum<string>
Available options:
pending_payment,
active,
terminated
terminatedAt
string<date-time>
terminatedBy
string

ID of who terminated the subscription (customer ID or merchant ID)

terminationReason
string

Reason for termination

testClockId
string

Test clock ID if this subscription is attached to a test clock. Only present in non-production environments.

updatedAt
string<date-time>
walletId
string

Optional (virtual) wallet ID for the subscription