A Subscription
resource represents a recurring charge to a Payment Instrument
at regular intervals. Subscribers can be buyers, customers, or merchants.
When creating a Subscription
, you have the option to use a Subscription Plan
.
DUMMY_V1
and FINIX_V1
.Create a Subscription
resource to charge a Payment Instrument
regularly.
If there is no trial period, the subscription will create a Transfer
shortly after creation (within 60 minutes).
The following options are available when creating a subscription.
You can create a subscription with a trial period by providing trial_details
in the request body. After creating a subscription, a Transfer
will occur after the trial period has elapsed. The first_charge_at
property in the response determines when the transfer will take place.
Think of a Subscription Plan
as a template for the Subscription
resource. When creating a subscription, you can use a Subscription Plan
by providing a subscription_plan_id
. Doing so lets you base a subscription on existing values for amount
, billing_interval
, and more.
Finix-Version | string Default: 2018-01-01 Specify the API version of your request. For more details, see Versioning. Example: 2022-02-01 |
amount | integer <int64> The total amount that will be debited in cents (e.g. 100 cents to debit $1.00). |
currency required | string ISO 4217 3-letter currency code. Currently, the only |
linked_to required | string The ID of the At this time, only approved merchants with one of the following processors are valid:
|
linked_type required | string The type of the resource that is specified in the |
nickname | string A human-readable name for the resource. |
billing_interval required | string How often the subscriber is billed. |
subscription_plan_id | string The ID of the |
required | object An object containing subscription details. |
required | object An object containing details about the subscriber. |
A single Subscription
object
Authentication information is missing or invalid
Forbidden
Object does not exist
Invalid field
{- "id": "subscription_cd7VyFticmvMmxJwv2aMB",
- "created_at": "2024-07-12T10:25:25.50Z",
- "updated_at": "2024-07-12T10:25:25.50Z",
- "first_charge_at": "2024-07-12T10:25:25.00Z",
- "amount": 2,
- "buyer_details": {
- "identity_id": "IDe8MHoq9cevVGocJwpAN8tR",
- "instrument_id": "PIh5syYGDw2SnvFjPVLcV3oD"
}, - "currency": "USD",
- "linked_to": "MUaC9hbNvRwBoCJzqrjWk69N",
- "linked_type": "MERCHANT",
- "nickname": "Gym membership",
- "billing_interval": "YEARLY",
- "subscription_details": {
- "collection_method": "BILL_AUTOMATICALLY",
- "send_invoice": false,
- "send_receipt": false,
- "trial_details": {
- "interval_type": "MONTH",
- "interval_count": 2,
- "trial_started_at": "2024-07-12T10:25:24.00Z",
- "trial_expected_end_at": "2024-07-19T10:25:24.00Z"
}
}, - "subscription_phase": "TRIAL",
- "state": "ACTIVE",
- "subscription_plan_id": null,
- "_links": {
}
}
Retrieve a list of Subscription
resources.
For details on how to query endpoints using the available parameters, see Query Parameters.
Finix-Version | string Default: 2018-01-01 Specify the API version of your request. For more details, see Versioning. Example: 2022-02-01 |
List of Subscription
objects
Authentication information is missing or invalid
Forbidden
Object does not exist
Invalid field
curl "https://finix.sandbox-payments-api.com/subscriptions" \ -H "Finix-Version: 2022-02-01" \ -u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e
{- "_embedded": {
- "subscriptions": [
- {
- "id": "subscription_cd7VyFticmvMmxJwv2aMB",
- "created_at": "2024-07-12T10:25:25.50Z",
- "updated_at": "2024-07-12T10:25:25.50Z",
- "first_charge_at": "2024-07-12T10:25:25.00Z",
- "amount": 999,
- "buyer_details": {
- "identity_id": "IDe8MHoq9cevVGocJwpAN8tR",
- "instrument_id": "PIh5syYGDw2SnvFjPVLcV3oD"
}, - "currency": "USD",
- "linked_to": "MUaC9hbNvRwBoCJzqrjWk69N",
- "linked_type": "MERCHANT",
- "nickname": "Gym membership",
- "billing_interval": "YEARLY",
- "subscription_details": {
- "collection_method": "BILL_AUTOMATICALLY",
- "send_invoice": false,
- "send_receipt": false,
- "trial_details": {
- "interval_type": "DAY",
- "interval_count": 7,
- "trial_started_at": "2024-07-12T10:25:24.00Z",
- "trial_expected_end_at": "2024-07-19T10:25:24.00Z"
}
}, - "subscription_phase": "TRIAL",
- "state": "ACTIVE",
- "subscription_plan_id": null,
- "_links": {
}
}, - {
- "id": "subscription_cdfc75BdNyH4fRJsFSMP7",
- "created_at": "2024-07-16T06:33:23.32Z",
- "updated_at": "2024-07-16T06:33:23.32Z",
- "first_charge_at": "2024-07-16T06:33:23.00Z",
- "amount": 5999,
- "buyer_details": {
- "identity_id": "IDe8MHoq9cevVGocJwpAN8tR",
- "instrument_id": "PIh5syYGDw2SnvFjPVLcV3oD"
}, - "currency": "USD",
- "linked_to": "MUaC9hbNvRwBoCJzqrjWk69N",
- "linked_type": "MERCHANT",
- "nickname": "Video streaming service subscription",
- "billing_interval": "YEARLY",
- "subscription_details": {
- "collection_method": "BILL_AUTOMATICALLY",
- "send_invoice": false,
- "send_receipt": false,
- "trial_details": {
- "interval_type": "MONTH",
- "interval_count": 2,
- "trial_started_at": "2024-07-16T06:33:22.00Z",
- "trial_expected_end_at": "2024-09-16T06:33:22.00Z"
}
}, - "subscription_phase": "TRIAL",
- "state": "ACTIVE",
- "subscription_plan_id": null,
- "_links": {
}
}
]
}, - "_links": {
}, - "page": {
- "limit": 100,
- "next_cursor": "ZTyLnqRtGpWxuTMeOVjPbR7y"
}
}
Retrieve the details of a previously created Subscription
.
Finix-Version | string Default: 2018-01-01 Specify the API version of your request. For more details, see Versioning. Example: 2022-02-01 |
A single Subscription
object
Authentication information is missing or invalid
Forbidden
Object does not exist
Invalid field
curl "https://finix.sandbox-payments-api.com/subscriptions/subscription_cdhqdXjTQfg62wHzJ41g5" \ -H "Finix-Version: 2022-02-01" \ -u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e
{- "id": "subscription_cd7VyFticmvMmxJwv2aMB",
- "created_at": "2024-07-12T10:25:25.50Z",
- "updated_at": "2024-07-12T10:25:25.50Z",
- "first_charge_at": "2024-07-12T10:25:25.00Z",
- "amount": 2,
- "buyer_details": {
- "identity_id": "IDe8MHoq9cevVGocJwpAN8tR",
- "instrument_id": "PIh5syYGDw2SnvFjPVLcV3oD"
}, - "currency": "USD",
- "linked_to": "MUaC9hbNvRwBoCJzqrjWk69N",
- "linked_type": "MERCHANT",
- "nickname": "Gym membership",
- "billing_interval": "YEARLY",
- "subscription_details": {
- "collection_method": "BILL_AUTOMATICALLY",
- "send_invoice": false,
- "send_receipt": false,
- "trial_details": {
- "interval_type": "MONTH",
- "interval_count": 2,
- "trial_started_at": "2024-07-12T10:25:24.00Z",
- "trial_expected_end_at": "2024-07-19T10:25:24.00Z"
}
}, - "subscription_phase": "TRIAL",
- "state": "ACTIVE",
- "subscription_plan_id": null,
- "_links": {
}
}
Update an existing Subscription
resource, typically used for subscriptions created without a Subscription Plan
. Note that you can only update specific resource fields.
Two common use cases for updating a Subscription
are:
This operation allows for adjusting the payment amount, such as when a subscriber decides to donate more or less money to a charity or upgrade/downgrade a product or service.
If the subscriber wishes to change their payment details, you can update the [buyer_details.instrument_id
] property with a new Payment Instrument
.
Finix-Version | string Default: 2018-01-01 Specify the API version of your request. For more details, see Versioning. Example: 2022-02-01 |
A single Subscription
object
Authentication information is missing or invalid
Forbidden
Object does not exist
Invalid field
curl "https://finix.sandbox-payments-api.com/subscriptions/subscription_cdhqdXjTQfg62wHzJ41g5" \ -H "Content-Type: application/json" \ -H "Finix-Version: 2022-02-01" \ -u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e \ -X PUT \ -d ' { "amount": 6299, "nickname": "Video streaming service", "buyer_details": { "instrument_id": "PIh5syYGDw2SnvFjPVLcV3oD" } }'
{- "id": "subscription_cd7VyFticmvMmxJwv2aMB",
- "created_at": "2024-07-12T10:25:25.50Z",
- "updated_at": "2024-07-12T10:25:25.50Z",
- "first_charge_at": "2024-07-12T10:25:25.00Z",
- "amount": 2,
- "buyer_details": {
- "identity_id": "IDe8MHoq9cevVGocJwpAN8tR",
- "instrument_id": "PIh5syYGDw2SnvFjPVLcV3oD"
}, - "currency": "USD",
- "linked_to": "MUaC9hbNvRwBoCJzqrjWk69N",
- "linked_type": "MERCHANT",
- "nickname": "Gym membership",
- "billing_interval": "YEARLY",
- "subscription_details": {
- "collection_method": "BILL_AUTOMATICALLY",
- "send_invoice": false,
- "send_receipt": false,
- "trial_details": {
- "interval_type": "MONTH",
- "interval_count": 2,
- "trial_started_at": "2024-07-12T10:25:24.00Z",
- "trial_expected_end_at": "2024-07-19T10:25:24.00Z"
}
}, - "subscription_phase": "TRIAL",
- "state": "ACTIVE",
- "subscription_plan_id": null,
- "_links": {
}
}
Cancel a Subscription
.
Finix-Version | string Default: 2018-01-01 Specify the API version of your request. For more details, see Versioning. Example: 2022-02-01 |
No content
Authentication information is missing or invalid
Forbidden
Object does not exist
curl "https://finix.sandbox-payments-api.com/subscriptions/subscription_cdhqdXjTQfg62wHzJ41g" \ -H "Finix-Version: 2022-02-01" \ -u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e \ -X DEL
{- "total": 0,
- "_embedded": {
- "errors": [
- {
- "code": "UNKNOWN",
- "logref": {
- "logref": "string"
}, - "message": "string",
- "_links": {
- "self": {
- "href": "string"
}, - "source": {
- "href": "string"
}
}
}
]
}
}