Subscriptions

Refund Subscription Payment

Refunds the latest payment for a subscription (or the specific payment provided) and records the refund with your PSP. Supports partial refunds and can optionally terminate the subscription after a successful refund. When an original invoice exists, a credit note or cancellation invoice is generated to mirror the refund.

POST
/subscriptions/{id}/refunds

Authorization

bearerAuth
AuthorizationBearer <token>

Use your secret API key as the bearer token

In: header

Path Parameters

id*string

Stable subscription ID (sub_*). Must belong to your merchant.

Match^sub_[A-Za-z0-9]{22}$

Request Body

application/json

paymentId*string

Payment ID (pay_*) to refund. Must belong to the same merchant as the subscription.

Match^pay_[A-Za-z0-9]{22}$
amountCents?integer

Amount to refund in cents. If omitted, the remaining refundable balance is refunded.

Range1 <= value
reason?string

Optional reason recorded for audit and credit note memo.

terminateSubscription?boolean

When true, cancels the subscription after a successful refund by ending it immediately.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.getlumen.dev/v1/subscriptions/sub_5n3K2gVDt1xQ78kPq4LzYh/refunds" \  -H "Content-Type: application/json" \  -d '{    "paymentId": "pay_6MZtR1qX8bLC3Dgo5NsQ0u",    "reason": "Customer requested cancellation within cooling-off period"  }'

{
  "success": true,
  "refund": {
    "id": "re_3Op4p2Lkd6Y2L0M1",
    "status": "succeeded",
    "amountCents": 12900
  },
  "terminated": false,
  "adjustmentInvoiceId": "inv_7N2fQy1YVPa4XoRDb3t6s"
}

{
  "error": "Nothing to refund or invalid refund amount"
}

Empty

{
  "error": "Subscription not found or access denied"
}

{
  "error": "Failed to issue refund"
}