Creates a subscription_event
object for the specified data_source
and customer
.
Examples
curl -X POST "https://api.chartmogul.com/v1/subscription_events" \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"subscription_event":
{
"external_id": "evnt_026",
"customer_external_id": "scus_022",
"data_source_uuid": "ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba",
"event_type": "subscription_start_scheduled",
"event_date": "2022-03-30",
"effective_date":"2022-04-01",
"subscription_external_id":"sub_0001",
"plan_external_id":"gold_monthly",
"currency":"USD",
"amount_in_cents":"1000"
}
}'
Result Format
{
"id": 23223966,
"data_source_uuid": "ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba",
"customer_external_id": "scus_022",
"subscription_set_external_id": null,
"subscription_external_id": "sub_0001",
"plan_external_id": "gold_monthly",
"event_date": "2022-03-30T00:00:00Z",
"effective_date": "2022-04-01T00:00:00Z",
"event_type": "subscription_start_scheduled",
"external_id": "evnt_026",
"errors":
{},
"created_at": "2022-03-31T11:42:18Z",
"updated_at": "2022-03-31T11:42:18Z",
"quantity": 1,
"currency": "USD",
"amount_in_cents": "1000",
"tax_amount_in_cents": 0,
"retracted_event_id": null
}
Subscription Event Types
The table below lists the subscription event types for the event_type
attribute.
Subscription Event Type | Description |
---|---|
| Event type that should be sent when a subscription is scheduled to start on a future date. |
| Event type that should be sent when a subscription gets canceled. |
| Event type that should be sent when a subscription cancellation is scheduled for a future date. |
| Event type that should be sent when an update of an existing subscription is scheduled for a future date. |
| Event type that should be sent when a scheduled event is retracted before it takes effect on the subscription. |
Our API has two additional immediate subscription event types: Started (
event_type:subscription_start
) and Updated (event_type:subscription_updated
). These events can be imported, however, they will not impact any metrics in ChartMogul.
Following the beta launch of CMRR on April 21, 2022, we’re testing different approaches and architectures for retracting scheduled subscription events to align our API behavior with common billing system retraction mechanisms. Note that the behavior of Retracted events may change in future Subscription Event API updates.