Separate refunds and subscription cancellations

You can refund a payment while keeping the subscription active, or cancel a subscription without refunding any payments. Use the separate endpoints below to control each operation.

Default refund behavior

By default, a successful refund of the first subscription payment or a recurring subscription payment automatically deactivates the subscription. This happens when Truegate processes REFUND_SUCCESS, rather than when you submit the refund request.

To preserve the subscription state, explicitly send preserveSubscriptionState: true in the refund request. This is a public, optional JSON body parameter. Omitting it or setting it to false keeps the default behavior.

This automatic deactivation applies to subscription purchase and recurring payments (SUBSCRIPTION_BUY and SUBSCRIPTION_RECURRENT). A refund of a one-time payment within a subscription (ONE_TIME) does not trigger this automatic cancellation.

Refund without cancelling the subscription

Call Refund a payment:

POST /api/v1/pay/refund

{
  "projectId": "YOUR_PROJECT_ID",
  "transactionId": "PAYMENT_TRANSACTION_ID",
  "preserveSubscriptionState": true,
  "signature": "YOUR_SIGNATURE"
}

Use the transactionId of the payment you want to refund. Generate the signature from projectId → transactionId, in that order. Do not include preserveSubscriptionState in the signature. See Signing requests.

The flag preserves the existing subscription state; it does not reactivate a subscription that is already cancelled or deactivated.

An HTTP 201 response with status: "SUCCESS" does not confirm that the refund has completed. Wait for the Refund webhook with REFUND_SUCCESS or REFUND_FAILED to determine the final outcome.

Use this endpoint for a refund that must preserve the subscription state. The combined Cancel or refund a payment endpoint, /api/v1/pay/start-cancellation, does not expose preserveSubscriptionState.

Cancel the subscription without a refund

Call Cancel subscription:

POST /api/v1/subscriptions/cancel

{
  "projectId": "YOUR_PROJECT_ID",
  "subscriptionId": "SUBSCRIPTION_ID",
  "isHard": false,
  "signature": "YOUR_SIGNATURE"
}

Send isHard explicitly to choose when access ends:

ValueResult
falseStops renewal and changes the state to CANCELLED. Access can continue until the end of the paid period, given by deactivatesAt.
trueImmediately deactivates the subscription.

Neither option refunds a payment. Generate the signature from projectId → subscriptionId → isHard, in that order, signing isHard as true or false.

A successful request returns HTTP 201 with an empty body. Use Get subscription details and Subscription events to keep access in your application aligned with the subscription state.

Refund and cancel with separate control

If you need both operations, request the refund with preserveSubscriptionState: true and call the subscription cancellation endpoint separately with your chosen isHard value. If cancellation should depend on a successful refund, wait for REFUND_SUCCESS before cancelling the subscription.


Did this page help you?