Skip to main content
POST
/
subscriptions
/
{subscription_id}
/
confirm
Subscription - Confirm
curl --request POST \
  --url https://sandbox.hyperswitch.io/subscriptions/{subscription_id}/confirm \
  --header 'Content-Type: application/json' \
  --header 'X-Profile-Id: <x-profile-id>' \
  --header 'api-key: <api-key>' \
  --data '{
  "payment_details": {
    "billing": {
      "address": {
        "city": "San Fransico",
        "country": "US",
        "first_name": "joseph",
        "last_name": "Doe",
        "line1": "1467",
        "line2": "Harrison Street",
        "line3": "Harrison Street",
        "state": "California",
        "zip": "94122"
      },
      "phone": {
        "country_code": "+1",
        "number": "123456789"
      }
    },
    "customer_acceptance": {
      "acceptance_type": "online",
      "accepted_at": "1963-05-03T04:07:52.723Z",
      "online": {
        "ip_address": "127.0.0.1",
        "user_agent": "amet irure esse"
      }
    },
    "payment_method": "card",
    "payment_method_data": {
      "card": {
        "card_cvc": "737",
        "card_exp_month": "03",
        "card_exp_year": "2030",
        "card_holder_name": "CLBRW dffdg",
        "card_number": "4111111111111111"
      }
    },
    "payment_method_type": "credit",
    "shipping": {
      "address": {
        "city": "Banglore",
        "country": "US",
        "first_name": "joseph",
        "last_name": "doe",
        "line1": "sdsdfsdf",
        "line2": "hsgdbhd",
        "line3": "alsksoe",
        "state": "zsaasdas",
        "zip": "571201"
      },
      "phone": {
        "country_code": "+1",
        "number": "123456789"
      }
    }
  }
}'
{
  "id": "<string>",
  "merchant_reference_id": "<string>",
  "status": "active",
  "plan_id": "<string>",
  "item_price_id": "<string>",
  "profile_id": "<string>",
  "client_secret": "<string>",
  "merchant_id": "<string>",
  "coupon_code": "<string>",
  "customer_id": "<string>",
  "payment": {
    "payment_id": "<string>",
    "status": "succeeded",
    "amount": 123,
    "currency": "AED",
    "profile_id": "<string>",
    "connector": "<string>",
    "payment_method_id": "pm_01926c58bc6e77c09e809964e72af8c8",
    "return_url": "<string>",
    "next_action": {
      "redirect_to_url": "<string>",
      "type": "redirect_to_url"
    },
    "payment_experience": "redirect_to_url",
    "error_code": "<string>",
    "error_message": "<string>",
    "payment_method_type": "ach",
    "client_secret": "<string>",
    "billing": {
      "address": {
        "city": "New York",
        "country": "AF",
        "line1": "123, King Street",
        "line2": "Powelson Avenue",
        "line3": "Bridgewater",
        "zip": "08807",
        "state": "New York",
        "first_name": "John",
        "last_name": "Doe",
        "origin_zip": "08807"
      },
      "phone": {
        "number": "9123456789",
        "country_code": "+1"
      },
      "email": "<string>"
    },
    "shipping": {
      "address": {
        "city": "New York",
        "country": "AF",
        "line1": "123, King Street",
        "line2": "Powelson Avenue",
        "line3": "Bridgewater",
        "zip": "08807",
        "state": "New York",
        "first_name": "John",
        "last_name": "Doe",
        "origin_zip": "08807"
      },
      "phone": {
        "number": "9123456789",
        "country_code": "+1"
      },
      "email": "<string>"
    },
    "payment_type": "normal",
    "payment_token": "token_sxJdmpUnpNsJk5VWzcjl"
  },
  "invoice": {
    "id": "<string>",
    "subscription_id": "<string>",
    "merchant_id": "<string>",
    "profile_id": "<string>",
    "merchant_connector_id": "<string>",
    "payment_intent_id": "<string>",
    "payment_method_id": "pm_01926c58bc6e77c09e809964e72af8c8",
    "customer_id": "<string>",
    "amount": 123,
    "currency": "AED",
    "status": "invoice_created",
    "billing_processor_invoice_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

Path Parameters

subscription_id
string
required

The unique identifier for the subscription

Body

application/json
payment_details
object
required
client_secret
string | null

This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK

Response

Subscription confirmed successfully

Response payload returned after successfully creating a subscription.

Includes details such as subscription ID, status, plan, merchant, and customer info.

id
string
required

A type for subscription_id that can be used for subscription ids

status
enum<string>
required

Possible states of a subscription lifecycle.

  • Created: Subscription was created but not yet activated.
  • Active: Subscription is currently active.
  • InActive: Subscription is inactive.
  • Pending: Subscription is pending activation.
  • Trial: Subscription is in a trial period.
  • Paused: Subscription is paused.
  • Unpaid: Subscription is unpaid.
  • Onetime: Subscription is a one-time payment.
  • Cancelled: Subscription has been cancelled.
  • Failed: Subscription has failed.
Available options:
active,
created,
in_active,
pending,
trial,
paused,
unpaid,
onetime,
cancelled,
failed
profile_id
string
required

A type for profile_id that can be used for business profile ids

merchant_id
string
required

A type for merchant_id that can be used for merchant ids

customer_id
string
required

A type for customer_id that can be used for customer ids

merchant_reference_id
string | null

Merchant specific Unique identifier.

plan_id
string | null

Identifier for the associated subscription plan.

item_price_id
string | null

Identifier for the associated item_price_id for the subscription.

client_secret
string | null

This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK

coupon_code
string | null

Optional coupon code applied to this subscription.

payment
object
invoice
object