Update Custom Attributes of a Subscription
PUT https://api.chartmogul.com/v1/subscriptions/{SUBSCRIPTION_UUID}/attributes/custom
Updates the custom attributes of a given subscription or subscription set. Attributes must already be defined for the account.
curl -X PUT "https://api.chartmogul.com/v1/subscriptions/sub_d1c0c885-add0-48db-8fa9-0bdf5017d6b0/attributes/custom" \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"custom": {
"pre_sold": true,
"renewal_owner": "[email protected]"
}
}'
{
"custom": {
"pre_sold": true,
"renewal_owner": "[email protected]"
}
}
Subscription set custom attributes. Subscription custom attributes can be added to either subscriptions or subscription sets. For subscription sets, use /subscription_sets/ as the URL.
If your subscriptions belong to a set, consider managing custom attributes at the set level. Set-level attributes are inherited by all subscriptions in the set and persist when subscriptions change (for example, on a plan switch).
Path parameters
subscription_uuidstring required- The ChartMogul UUID of the subscription or subscription set. Both can be retrieved using the List Customer Subscriptions endpoint.
Body parameters
customobject required-
An object of custom attributes to update. Each key is an attribute name and each value is the new value to set. Attributes must already be defined for the account.
keystring required-
The name of the custom attribute to update.
valuestring required-
The new value for the custom attribute. Must be 255 characters or fewer.
Supported data types and their accepted formats.
String– Accepts alphanumeric characters. Maximum of 255 characters allowed.Integer– Accepts only numeric characters.Decimal– Accepts floating point numbers.Timestamp– In the ISO 8601 format.Boolean– Can be one ofTRUE,true,t,1,FALSE,false,f, or0.
Response
custom- A JSON object containing the custom attributes on this subscription or subscription set after updating.