---
title: "Create Subscription Record"
method: POST
path: "/data-in/subscriptions"
tags: ["Data In"]
---

# Create Subscription Record

`POST /data-in/subscriptions`

Ingest subscription data into Triple Whale. This endpoint allows users to upload detailed subscription information, including customer details, items, status, and metadata.

## Request body

- object
  - `shop` string, required — The exact Shop URL (e.g., 'example.myshopify.com'). Must match the Shop URL value shown in [Settings → Store](https://app.triplewhale.com/store-settings/general). The API key owner must also have access to the shop, otherwise the request will return 403.
  - `subscription_id` string, required — The unique identifier for the subscription.
  - `platform` string — The platform where the subscription was processed.
  - `platform_account_id` string — The account ID associated with the platform. Can be used to segment parts of the data coming from different platform accounts, e.g. `facebook_account_a` vs. `facebook_account_b`.
  - `created_at` string, date-time, required — The time at which the subscription record was created. Must be provided in ISO 8601 format, with explicit timezone information (`Z` or `+/-HH:mm` offset). Offsets are supported (e.g., `2024-11-29T12:00:00+02:00`).
  - `canceled_at` string, date-time — The time the subscription was canceled, if applicable. Must be provided in ISO 8601 format, with explicit timezone information (`Z` or `+/-HH:mm` offset). Offsets are supported (e.g., `2024-11-29T12:00:00+02:00`).
  - `ended_at` string, date-time — The time the subscription ended (canceled or expired), if applicable. Must be provided in ISO 8601 format, with explicit timezone information (`Z` or `+/-HH:mm` offset). Offsets are supported (e.g., `2024-11-29T12:00:00+02:00`).
  - `cancellation_reason` string — The reason for the subscription's cancellation.
  - `cancellation_comments` string — Additional comments regarding the cancellation.
  - `currency` string, required — The currency of the subscription (e.g., 'USD').
  - `customer` object, required — Details of the customer associated with the subscription.
    - `id` string, required — The unique identifier for the customer. Maps to `customer_id` in the Subscriptions table.
    - `email` string, email — The customer's email address. At least one of email or phone is required.
    - `phone` string — The customer's phone number. At least one of email or phone is required.
    - `first_name` string — The customer's first name.
    - `last_name` string — The customer's last name.
  - `subscription_items` object[], required — Details of the items included in the subscription. At least one is required.
    - `subscription_item_id` string, required — The unique identifier for the subscription item.
    - `created_at` string, date-time, required — The date and time the subscription item was created. Must be provided in ISO 8601 format, with explicit timezone information (`Z` or `+/-HH:mm` offset). Offsets are supported (e.g., `2024-11-29T12:00:00+02:00`).
    - `canceled_at` string, date-time — The date and time the subscription item was canceled, if applicable. Must be provided in ISO 8601 format, with explicit timezone information (`Z` or `+/-HH:mm` offset). Offsets are supported (e.g., `2024-11-29T12:00:00+02:00`).
    - `ended_at` string, date-time — The date and time the subscription item ended, if applicable. Must be provided in ISO 8601 format, with explicit timezone information (`Z` or `+/-HH:mm` offset). Offsets are supported (e.g., `2024-11-29T12:00:00+02:00`).
    - `status` 'active' | 'canceled' | 'expired' | 'deleted', required — The current status of the subscription item.
    - `interval` 'day' | 'week' | 'month' | 'year', required — The billing interval for the subscription item.
    - `interval_count` integer, required — The number of intervals for each billing cycle.
    - `product_id` string — The unique identifier for the product associated with this item.
    - `price` number, float, required — The price of the subscription item.
    - `quantity` integer, required — The quantity of the subscription item.
    - `variant_id` string — The unique identifier for the product variant, if applicable.
    - `discount` object — Discounts applied to the subscription item.
      - `amount_off` number, float — The amount of discount applied to the subscription item.
      - `percent_off` number, float — The percentage of discount applied to the subscription item.
  - `status` string, required — The status of the subscription (e.g., active, canceled).
  - `metadata` string — Additional metadata or notes related to the subscription.
  - `updated_at` string, date-time — The time at which the subscription record was last updated. Must be provided in ISO 8601 format, with explicit timezone information (`Z` or `+/-HH:mm` offset). Offsets are supported (e.g., `2024-11-29T12:00:00+02:00`). Defaults to the current time.

## Response `200`

Subscription record successfully received.

- object
  - `success` boolean
  - `message` string

## Other responses

- `400` — Bad Request
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/triplewhale/apis/triple-whale-api.md) · [All operations](https://skmtc.net/triplewhale/apis/triple-whale-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/triplewhale/triple-whale-api/revisions/96b22ac9b5a7/schema)
