v1

latestOpenAPI 3.0.02026-07-26168846732.2 KB
Subscriptions

Subscription - Create

Creates a subscription that requires separate confirmation.

post/subscriptions/create

Headers

X-Profile-Idstring required

Profile ID for authentication

Request body

merchant_reference_idstring nullable

Merchant specific Unique identifier.

item_price_idstring required

Identifier for the associated item_price_id for the subscription.

plan_idstring nullable

Identifier for the subscription plan.

coupon_codestring nullable

Optional coupon code applied to the subscription.

customer_idstring required

A type for customer_id that can be used for customer ids

Example request

{
  "billing": {
    "address": {
      "city": "New York",
      "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"
    }
  },
  "shipping": {
    "address": {
      "city": "New York",
      "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"
    }
  }
}

Response

Subscription created successfully

idstring required

A type for subscription_id that can be used for subscription ids

merchant_reference_idstring nullable

Merchant specific Unique identifier.

status'active' | 'created' | 'in_active' | 'pending' | 'trial' | 'paused' | 'unpaid' | 'onetime' | 'cancelled' | 'failed' 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.
plan_idstring nullable

Identifier for the associated subscription plan.

item_price_idstring nullable

Identifier for the associated item_price_id for the subscription.

profile_idstring required

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

client_secretstring nullable

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

merchant_idstring required

A type for merchant_id that can be used for merchant ids

coupon_codestring nullable

Optional coupon code applied to this subscription.

customer_idstring required

A type for customer_id that can be used for customer ids

Example response

{
  "payment": {
    "payment_method_id": "pm_01926c58bc6e77c09e809964e72af8c8",
    "next_action": {
      "redirect_to_url": "https://example.com/redirect"
    },
    "billing": {
      "address": {
        "city": "New York",
        "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"
      }
    },
    "shipping": {
      "address": {
        "city": "New York",
        "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"
      }
    },
    "payment_token": "token_sxJdmpUnpNsJk5VWzcjl"
  },
  "invoice": {
    "payment_method_id": "pm_01926c58bc6e77c09e809964e72af8c8"
  }
}