patch https://api.chartmogul.com/v1/subscription_events
Update an existing subscription_event
object.
Examples
curl -X PATCH "https://api.chartmogul.com/v1/subscription_events" \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"subscription_event":
{
"external_id": "evnt_026",
"data_source_uuid": "ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba",
"effective_date":"2022-04-30",
"currency":"USD",
"amount_in_cents":"100"
}
}'
ChartMogul::SubscriptionEvent.new.update!(
external_id: "evnt_026",
data_source_uuid: "ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba",
effective_date: "2022-04-30",
currency: "USD",
amount_in_cents: 100
)
chartmogul.SubscriptionEvent.modify_with_params(config, data={
'subscription_event' : {
'external_id' : "evnt_026",
'data_source_uuid' : "ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba",
'effective_date' : "2022-04-30",
'currency' : 'USD',
'amount_in_cents' : 100
}})
ChartMogul.SubscriptionEvent.updateWithParams(config, {
subscription_event: {
external_id: "evnt_026",
data_source_uuid: "ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba",
effective_date: "2022-04-30",
currency: "USD",
amount_in_cents: 100
}
})
api.UpdateSubscriptionEvent(&cm.SubscriptionEvent{
ExternalID: "evnt_026",
DataSourceUUID: "ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba",
EffectiveDate: "2022-04-30",
Currency: "USD",
AmountInCents: 100
})
ChartMogul\SubscriptionEvent::updateWithParams(['subscription_event' => [
"external_id" => "some_event_id",
"data_source_uuid" => "ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba",
"effective_date" => "2022-04-30",
"currency" => "USD",
"amount_in_cents" => "100"
]]);
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-30T00:00:00Z",
"event_type": "subscription_start_scheduled",
"external_id": "evnt_026",
"errors":
{},
"created_at": "2022-03-31T14:30:48Z",
"updated_at": "2022-04-12T09:58:06Z",
"quantity": 1,
"currency": "USD",
"amount_in_cents": "100",
"tax_amount_in_cents": 0,
"retracted_event_id": null,
}
<ChartMogul::SubscriptionEvent:0x00000001313bf858
@data_source_uuid='ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba',
@customer_external_id='scus_022',
@subscription_set_external_id='',
@subscription_external_id='sub_0001',
@plan_external_id='gold_monthly',
@event_date='2022-03-30T00:00:00Z',
@effective_date='2022-04-30T00:00:00Z',
@event_type='subscription_start_scheduled',
@external_id='evnt_026',
@quantity=1,
@currency='USD',
@amount_in_cents='100',
@id=23223966,
@errors={},
@created_at='2022-03-31T11:42:18Z',
@updated_at='2022-04-12T09:58:06Z',
@tax_amount_in_cents=nil,
@retracted_event_id=nil
>
<SubscriptionEvent{
data_source_uuid='ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba',
customer_external_id='scus_022',
subscription_set_external_id='',
subscription_external_id='sub_0001',
plan_external_id='gold_monthly',
event_date='2022-03-30T00:00:00Z',
effective_date='2022-04-30T00:00:00Z',
event_type='subscription_start_scheduled',
external_id='evnt_026',
quantity=1,
currency='USD',
amount_in_cents='100',
id=23223966,
errors={},
created_at='2022-03-31T11:42:18Z',
updated_at='2022-04-12T09:58:06Z',
tax_amount_in_cents=None,
retracted_event_id=None
}>
{
"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-30T00:00:00Z",
"event_type": "subscription_start_scheduled",
"external_id": "evnt_026",
"errors":
{},
"created_at": "2022-03-31T14:30:48Z",
"updated_at": "2022-04-12T09:58:06Z",
"quantity": 1,
"currency": "USD",
"amount_in_cents": "100",
"tax_amount_in_cents": 0,
"retracted_event_id": null,
}
(*chartmogul.SubscriptionEvent)(0xc03201e5a1)({
ID: (uint64) 23223966
DataSourceUUID: (string) (len=39) "ds_1fm3eaac-62d0-31ec-clf4-4bf0mbe81aba"
CustomerExternalID: (string) (len=8) "scus_022"
SubscriptionSetExternalID: (string) ""
SubscriptionExternalID: (string) (len=8) "sub_0001")
PlanExternalID: (string) (len=12) "gold_monthly"
EventDate: (string) (len=20) "2022-03-30T00:00:00Z")
EffectiveDate: (string) (len=20) "2022-04-30T00:00:00Z"
EventType: (string) (len=28) "subscription_start_scheduled"
ExternalID: (string) (len=8) "evnt_026"
Errors: (interface{}) {}
CreatedAt: (string) (len=20) "2022-03-31T11:42:18Z"
UpdatedAt: (string) (len=20) "2022-04-12T09:58:06Z"
Quantity: (int32) 1
Currency: (string) (len=3) "USD")
AmountInCents: (int32) 100
TaxAmountInCents: (int32) 0
RetractedEventId: (string) ""
})
<?php
ChartMogul\SubscriptionEvent::__set_state(array(
"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-30T00:00:00Z",
"event_type" => "subscription_start_scheduled",
"external_id" => "evnt_026",
"errors" => array(),
"created_at" => "2022-03-31T11:42:18Z",
"updated_at" => "2022-04-12T09:58:06Z",
"quantity" => 1,
"currency" => "USD",
"amount_in_cents" => "100",
"tax_amount_in_cents" => 0,
"retracted_event_id" => NULL
));
?>
To update a subscription event the required params are either:
external_id
anddata_source_uuid
orid