get
/premium/refund-eligibilityGet self-serve refund eligibility
Returns whether the authenticated user can self-serve refund their most recent purchase, including the refund window and cooldown timestamps.
get_self_serve_refund_eligibility
Responses
200
Success
json
{
"type": "object",
"properties": {
"eligible": {
"type": "boolean",
"description": "Whether the authenticated user can self-serve refund their latest purchase right now"
},
"reason": {
"anyOf": [
{
"$ref": "#/components/schemas/SelfServeRefundIneligibilityReason"
},
{
"type": "null"
}
],
"description": "Why the user is not eligible, when eligible is false"
},
"invoice_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Latest paid invoice considered for refund eligibility"
},
"invoice_amount_paid_cents": {
"anyOf": [
{
"type": "integer",
"format": "int53"
},
{
"type": "null"
}
],
"description": "Amount paid on the latest invoice in the currency minor unit"
},
"currency": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Currency of the latest paid invoice"
},
"paid_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "ISO timestamp the latest invoice was paid"
},
"refund_window_expires_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "ISO timestamp after which the 3-day refund window closes"
},
"cooldown_expires_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "ISO timestamp the 30-day cooldown ends, if currently active"
},
"cancels_subscription": {
"type": "boolean",
"description": "Whether issuing the refund will also cancel the active subscription"
}
},
"required": [
"eligible",
"reason",
"invoice_id",
"invoice_amount_paid_cents",
"currency",
"paid_at",
"refund_window_expires_at",
"cooldown_expires_at",
"cancels_subscription"
]
}400
Bad Request - The request was malformed or contained invalid data
json
{
"type": "object",
"properties": {
"code": {
"$ref": "#/components/schemas/APIErrorCode"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"type": "array",
"description": "Field-specific validation errors",
"items": {
"$ref": "#/components/schemas/ValidationErrorItem"
}
}
},
"required": [
"code",
"message"
]
}401
Unauthorized - Authentication is required or the token is invalid
json
{
"type": "object",
"properties": {
"code": {
"$ref": "#/components/schemas/APIErrorCode"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"type": "array",
"description": "Field-specific validation errors",
"items": {
"$ref": "#/components/schemas/ValidationErrorItem"
}
}
},
"required": [
"code",
"message"
]
}403
Forbidden - You do not have permission to perform this action
json
{
"type": "object",
"properties": {
"code": {
"$ref": "#/components/schemas/APIErrorCode"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"type": "array",
"description": "Field-specific validation errors",
"items": {
"$ref": "#/components/schemas/ValidationErrorItem"
}
}
},
"required": [
"code",
"message"
]
}429
Too Many Requests - You are being rate limited
json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"RATE_LIMITED"
]
},
"message": {
"type": "string"
},
"retry_after": {
"type": "number",
"description": "Seconds to wait before retrying"
},
"global": {
"type": "boolean",
"description": "Whether this is a global rate limit"
}
},
"required": [
"code",
"message",
"retry_after"
]
}500
Internal Server Error - An unexpected error occurred
json
{
"type": "object",
"properties": {
"code": {
"$ref": "#/components/schemas/APIErrorCode"
},
"message": {
"type": "string",
"description": "Human-readable error message"
},
"errors": {
"type": "array",
"description": "Field-specific validation errors",
"items": {
"$ref": "#/components/schemas/ValidationErrorItem"
}
}
},
"required": [
"code",
"message"
]
}