Subscription - Get Estimate
GET /subscriptions/estimate
Try it
curl --request GET \
--url https://sandbox.hyperswitch.io/subscriptions/estimate \
--header 'X-Profile-Id: <x-profile-id>' \
--header 'api-key: <api-key>'Response 200 (application/json)
{
"amount": 123,
"currency": "AED",
"line_items": [
{
"item_id": "<string>",
"item_type": "<string>",
"description": "<string>",
"amount": 123,
"currency": "AED",
"quantity": 123
}
],
"plan_id": "<string>",
"item_price_id": "<string>",
"coupon_code": "<string>",
"customer_id": "<string>"
}Authorizations
api-key (string, header) — required Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.
Headers
X-Profile-Id (string) — required Profile ID for authentication
Query parameters
plan_id (string) — required Plan ID for estimation
customer_id (string | null) — optional Customer ID for personalized pricing
coupon_id (string | null) — optional Coupon ID to apply discount
trial_days (integer | null) — optional Number of trial days Required range: x >= 0
Response fields
200 application/json — Estimate retrieved successfully
amount (integer) — required This Unit struct represents MinorUnit in which core amount works
currency (enum) — required The three-letter ISO 4217 currency code (e.g., "USD", "EUR") for the payment amount. This field is mandatory for creating a payment.
line_items (object[]) — required Array of line item objects. Showchild attributes.
Each line item object example:
item_id (string)
item_type (string)
description (string)
amount (integer)
currency (string)
quantity (integer)
plan_id (string | null) — optional Identifier for the associated plan_id.
item_price_id (string | null) — optional Identifier for the associated item_price_id for the subscription.
coupon_code (string | null) — optional Identifier for the coupon code for the subscription.
customer_id (string) — optional A type for customer_id that can be used for customer ids
Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v1/subscriptions/estimate.mdx Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v1/subscriptions/estimate