Skip to main content
PUT
/
payments
/
subscriptions
/
{id}
Update Subscription
curl --request PUT \
  --url https://api.rootfi.dev/v4/payments/subscriptions/{id} \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "amount": 123,
  "interval": "DAY",
  "interval_count": 123,
  "status": "ACTIVE",
  "items": [
    {
      "description": "<string>",
      "quantity": 123,
      "unit_amount": 123,
      "item_id": "<string>"
    }
  ]
}
'
{
  "rootfi_id": 157,
  "rootfi_created_at": "2024-01-22T05:07:31.465Z",
  "rootfi_updated_at": "2024-01-22T05:07:31.000Z",
  "rootfi_company_id": 1089,
  "platform_id": "123456",
  "rootfi_deleted_at": "2023-11-07T05:31:56Z",
  "platform_unique_id": "<string>",
  "raw_data": {},
  "data_hash": "<string>",
  "contact_id": "<string>",
  "currency_id": "<string>",
  "status": "ACTIVE",
  "amount": 123,
  "interval": "DAY",
  "interval_count": 123,
  "next_billing_date": "<string>",
  "last_invoice_date": "<string>",
  "last_payment_date": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "invoice_ids": [
    "<string>"
  ],
  "transaction_ids": [
    "<string>"
  ],
  "items": [
    {
      "rootfi_id": 123,
      "item_id": "<string>",
      "description": "<string>",
      "quantity": 123,
      "unit_amount": 123
    }
  ]
}
Update an existing subscription. Common updates include changing the billing amount, interval, or subscription items.

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe rootfi_id or platform_id of the subscription

Request Body

FieldTypeRequiredDescription
amountnumberNoNew recurring charge amount
intervalstringNoNew billing frequency
interval_countintegerNoNew interval count
statusstringNoChange status (e.g., pause with PAUSED)
itemsarrayNoUpdate subscription items
Changes to amount or items typically take effect on the next billing cycle. Some platforms prorate changes immediately.
See Subscription Overview for complete field details.

Authorizations

api_key
string
header
required

Path Parameters

id
string
required

Body

application/json
amount
number<double> | null
interval
enum<string> | null
Available options:
DAY,
WEEK,
MONTH,
YEAR
interval_count
integer | null
status
enum<string> | null
Available options:
ACTIVE,
IN_TRIAL,
CANCELED,
PAUSED,
PAST_DUE,
INCOMPLETE,
UNKNOWN
items
paymentsV4SubscriptionItemCreate · object[] | null

Response

Subscription updated successfully

V4 Subscription model for recurring billing arrangements.

rootfi_id
number<double>
required

The unique ID we assign for that data's information

Example:

157

rootfi_created_at
string<date-time>
required

The date at which RootFi first synced this data

Example:

"2024-01-22T05:07:31.465Z"

rootfi_updated_at
string<date-time>
required

The latest date at which RootFi updated this data

Example:

"2024-01-22T05:07:31.000Z"

rootfi_company_id
number<double>
required

The ID of the company in the accounting platform

Example:

1089

platform_id
string
required

An unique custom RootFi ID made from platform's unique_id.

Example:

"123456"

rootfi_deleted_at
string<date-time> | null

The date at which the data was deleted in the accounting platform

platform_unique_id
string | null

The ID of the data in the accounting platform.

raw_data
object

A JSON containing fields that you can directly get from the accounting platform.

data_hash
string | null

The hash of the data

contact_id
string | null

Reference to the Contact subscribed.

currency_id
string | null

ISO 4217 currency code for subscription charges.

status
enum<string> | null

Current status of the subscription (ACTIVE, IN_TRIAL, CANCELED, PAUSED, PAST_DUE, INCOMPLETE, UNKNOWN).

Available options:
ACTIVE,
IN_TRIAL,
CANCELED,
PAUSED,
PAST_DUE,
INCOMPLETE,
UNKNOWN
amount
number<double> | null

Recurring charge amount per billing cycle.

interval
enum<string> | null

Billing frequency unit (DAY, WEEK, MONTH, YEAR).

Available options:
DAY,
WEEK,
MONTH,
YEAR
interval_count
integer | null

Number of intervals between billings (e.g., 2 = every 2 months).

next_billing_date
string | null

Next scheduled billing date (ISO 8601).

last_invoice_date
string | null

Date when the last invoice was generated (ISO 8601).

last_payment_date
string | null

Date when the last successful payment was received (ISO 8601).

created_at
string | null

Original creation timestamp from platform (ISO 8601).

updated_at
string | null

Last update timestamp from platform (ISO 8601).

invoice_ids
string[] | null

References to all invoices generated from this subscription.

transaction_ids
string[] | null

References to all transactions (payments, refunds, fees).

items
paymentsV4SubscriptionItem · object[] | null

Products/services included in this subscription.