v1

latestOpenAPI 3.0.02026-08-06363576.8 KB
Subscription

Update a single subscription

patch/subscriptions/{subscriptionId}/

Path parameters

subscriptionIdstring required

Subscription id

Request body

amountstring

Amount to overwrite the plan amount

discountstring

Discount percentage, from 0 to 100. A value of 10 means 10% discount, calculated on the next charge.

descriptionstring

An optional description for internal purposes.

Example request

{
  "plan": {
    "id": 1
  },
  "amount": "1500",
  "discount": "10",
  "description": "My custom note"
}

Response

Successful operation

idinteger
trial_endstring date-time
start_datestring date-time
ended_atstring date-time
active_untilstring date-time
referencestring
descriptionstring
is_on_trialboolean
activeboolean
cancelledboolean
cancel_datestring date-time
metastring json
tokenstring
customerinteger

Example response

{
  "id": 123,
  "reference": "REF-12345",
  "token": "637302f0412e2e11adc0ba21adafcf11",
  "customer": 123,
  "plan": {
    "id": 1,
    "name": "Name of the plan.",
    "alternative_name": "A slightly longer name or more descriptive.",
    "reference": "SKU-1",
    "interval": "day|week|month|year",
    "interval_count": 1,
    "amount": "1.0000",
    "currency": "USD",
    "description": "A longer description.",
    "enabled": true,
    "electronic_only": true,
    "payment_processor": {
      "id": 1,
      "name": "Adyen processor",
      "type": "adyen"
    }
  },
  "billing_logs": [
    {
      "total": "6.99",
      "transaction": {
        "amount": "6.99",
        "currency": "USD"
      }
    }
  ]
}