Catalog/commerce-refund-proration

Commerce

Partial-refund proration API

Prorates a refund for the unused portion of a service period, net of an optional non-refundable fee, and reports merchant-retained amount. Answers 'How much refund for the unused days?', 'What does the merchant keep after the fee?'.

Price$0.02per request
MethodPOST
Route/v1/commerce/refund-proration
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
commercerefundprorationpartial-refundsubscriptioncancellationcreditbilling
API URLhttps://x402.hexl.dev/v1/commerce/refund-proration
Integration docs
Example request
{
  "amountPaid": 120,
  "periodDays": 30,
  "daysUsed": 10,
  "nonRefundableFee": 5
}
Example response
{
  "amountPaid": 120,
  "periodDays": 30,
  "daysUsed": 10,
  "daysUnused": 20,
  "usedPortion": 40,
  "unusedPortion": 80,
  "nonRefundableFee": 5,
  "refundAmount": 75,
  "retainedByMerchant": 45,
  "interpretation": "Used 10/30 days ($40); refund unused $80 − fee $5 = $75."
}
Input schema
{
  "type": "object",
  "required": [
    "amountPaid",
    "periodDays",
    "daysUsed"
  ],
  "properties": {
    "amountPaid": {
      "type": "number",
      "examples": [
        120
      ]
    },
    "periodDays": {
      "type": "integer",
      "examples": [
        30
      ]
    },
    "daysUsed": {
      "type": "integer",
      "examples": [
        10
      ]
    },
    "nonRefundableFee": {
      "type": "number",
      "examples": [
        5
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}