---
title: "Create a Subscription"
method: POST
path: "/subscriptions"
tags: ["Webhook Subscriptions"]
---

# Create a Subscription

`POST /subscriptions`

## Request

- Base URL: `https://sandbox.signup.nmi.com/api/v1`
- URL: `https://sandbox.signup.nmi.com/api/v1/subscriptions`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `/oauth/token` scopes: `subscriptions:write`

Creates a new subscription based on the provided data.
#### How signing requests work
When setting up, it's common to generate, store, and share a secret between your app and the app that wants to receive webhooks. The secret should be a random string, and how to create it is entirely up to you. The package will use the secret to sign a webhook call.
By default, the package will add a header called ```Signature``` that will contain a signature the receiving app can use if the payload hasn't been tampered with.

**Required scope:** `subscriptions:write`

## Headers

- `Idempotency-Key` string

## Request body

- CreateSubscription
  - `callback_url` string, required: The callback URL of the subscription.
  - `secret` string, required: The secret key is used to generate a secure signature with the **HMAC-SHA256** hashing algorithm, which is included in the webhook event `Signature` header.
  - `events` EventTypes[], required: Subscription events

## Response `200`

Subscription created successfully

- Subscription: Subscription object.
  - `id` string, required: The unique identifier of the subscription.
  - `callback_url` string: The callback URL of the subscription.
  - `status` 'active' | 'inactive', required
  - `events` EventTypes[], required: Subscription events
  - `created_at` string, date-time, required: The date and time when the application was created.
  - `updated_at` string, date-time, required: The date and time when the application was last updated.

## Other responses

- `400`: Invalid Subscription

---

[API](https://skmtc.dev/nmi/apis/payments-sign-up-api.md) - [All operations](https://skmtc.dev/nmi/apis/payments-sign-up-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nmi/apis/payments-sign-up-api/revisions/fb067f88923d?raw)
