curl --request POST \
--url https://api.rootfi.dev/v4/payments/subscriptions \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"company_id": 123,
"contact_id": "<string>",
"currency_id": "<string>",
"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
}
]
}Create a new subscription for recurring billing.
curl --request POST \
--url https://api.rootfi.dev/v4/payments/subscriptions \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"company_id": 123,
"contact_id": "<string>",
"currency_id": "<string>",
"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
}
]
}| Field | Type | Required | Description |
|---|---|---|---|
| contact_id | string | Yes | Reference to the Contact |
| currency_id | string | Yes | ISO 4217 currency code |
| amount | number | Yes | Recurring charge amount per billing cycle |
| interval | string | Yes | Billing frequency: DAY, WEEK, MONTH, YEAR |
| interval_count | integer | No | Intervals between billings (default: 1) |
| status | string | No | Initial status: ACTIVE, IN_TRIAL (default: ACTIVE) |
| items | array | No | Products/services in the subscription |
| Field | Type | Required | Description |
|---|---|---|---|
| item_id | string | No | Reference to an Item/Product |
| description | string | Yes | Description of the subscribed service |
| quantity | integer | Yes | Number of units |
| unit_amount | number | Yes | Price per unit |
DAY, WEEK, MONTH, YEAR ACTIVE, IN_TRIAL, CANCELED, PAUSED, PAST_DUE, INCOMPLETE, UNKNOWN Show child attributes
Subscription created successfully
V4 Subscription model for recurring billing arrangements.
The unique ID we assign for that data's information
157
The date at which RootFi first synced this data
"2024-01-22T05:07:31.465Z"
The latest date at which RootFi updated this data
"2024-01-22T05:07:31.000Z"
The ID of the company in the accounting platform
1089
An unique custom RootFi ID made from platform's unique_id.
"123456"
The date at which the data was deleted in the accounting platform
The ID of the data in the accounting platform.
A JSON containing fields that you can directly get from the accounting platform.
The hash of the data
Reference to the Contact subscribed.
ISO 4217 currency code for subscription charges.
Current status of the subscription (ACTIVE, IN_TRIAL, CANCELED, PAUSED, PAST_DUE, INCOMPLETE, UNKNOWN).
ACTIVE, IN_TRIAL, CANCELED, PAUSED, PAST_DUE, INCOMPLETE, UNKNOWN Recurring charge amount per billing cycle.
Billing frequency unit (DAY, WEEK, MONTH, YEAR).
DAY, WEEK, MONTH, YEAR Number of intervals between billings (e.g., 2 = every 2 months).
Next scheduled billing date (ISO 8601).
Date when the last invoice was generated (ISO 8601).
Date when the last successful payment was received (ISO 8601).
Original creation timestamp from platform (ISO 8601).
Last update timestamp from platform (ISO 8601).
References to all invoices generated from this subscription.
References to all transactions (payments, refunds, fees).
Products/services included in this subscription.
Show child attributes