Comments are additional information that you can add to your resources. Comments can be added to provide context for any operation that was performed.
When you make an API call on any resource eg., Subscriptions -> Change term end, you can add more context to that operation by calling the comments API as a follow up call.
Besides the user generated comments, Chargebee also generates "System" comments when a change for a resource happens at the backend. These comments are all read-only.
Sample comment [ JSON ]
{
"added_by": "full_access_key_v1",
"created_at": 1517505963,
"entity_id": "__test__KyVnHhSBWm65N2rx",
"entity_type": "subscription",
"id": "cmt___test__KyVnHhSBWm69N2s4",
"notes": "This is a test comment",
"object": "comment",
"type": "user"
}
API Index URL GET
https://{site}.chargebee.com/api/v2/comments
string, max chars=40 Unique identifier for the comment.
enumerated string Type of the entity this comment generated for Possible values are
customerEntity that represents a customersubscriptionEntity that represents a subscription of a customerinvoiceInvoice descriptionquoteEntity that represents a quotecredit_noteCredit note descriptiontransactionEntity that represents a transaction.planEntity that represents a subscription planaddonEntity that represents an addoncouponEntity that represents a discount couponorderEntity that represents an orderbusiness_entityEntity that represents item of type business entityomnichannel_subscriptionEntity that represents omnichannel subscriptionomnichannel_subscription_itemEntity that represents omnichannel subscription itemomnichannel_transactionEntity that represents omnichannel subscription transactionrecorded_purchaseEntity that represents recorded purchasesomnichannel_subscription_item_scheduled_changeEntity that represents omnichannel subscription item scheduled changessales_orderEntity that represents sales order
customerEntity that represents a customersubscriptionEntity that represents a subscription of a customerinvoiceInvoice descriptionquoteEntity that represents a quote
credit_noteCredit note descriptiontransactionEntity that represents a transaction.planEntity that represents a subscription planaddonEntity that represents an addoncouponEntity that represents a discount couponorderEntity that represents an orderbusiness_entityEntity that represents item of type business entityomnichannel_subscriptionEntity that represents omnichannel subscriptionomnichannel_subscription_itemEntity that represents omnichannel subscription itemomnichannel_transactionEntity that represents omnichannel subscription transactionrecorded_purchaseEntity that represents recorded purchasesomnichannel_subscription_item_scheduled_changeEntity that represents omnichannel subscription item scheduled changessales_orderEntity that represents sales order
Show all values[+]
optional, string, max chars=100 The user who created the comment. If created via API, this contains the name given for the API key used.
string, max chars=1000 Actual notes for the comment.
timestamp(UTC) in seconds The time at which this comment was created
enumerated string, default=user Type of comment this is. Possible values are
userComment generated by user either via API or Admin console.systemComment generated by Chargebee when any backend changes happen for an entity
userComment generated by user either via API or Admin console.systemComment generated by Chargebee when any backend changes happen for an entity
Show all values[+]
string, max chars=100 Unique identifier of the entity.
string, max chars=40 Unique identifier for the comment.
enumerated string Type of the entity this comment generated for Possible values are
customerEntity that represents a customersubscriptionEntity that represents a subscription of a customerinvoiceInvoice descriptionquoteEntity that represents a quotecredit_noteCredit note descriptiontransactionEntity that represents a transaction.planEntity that represents a subscription planaddonEntity that represents an addoncouponEntity that represents a discount couponorderEntity that represents an orderbusiness_entityEntity that represents item of type business entityomnichannel_subscriptionEntity that represents omnichannel subscriptionomnichannel_subscription_itemEntity that represents omnichannel subscription itemomnichannel_transactionEntity that represents omnichannel subscription transactionrecorded_purchaseEntity that represents recorded purchasesomnichannel_subscription_item_scheduled_changeEntity that represents omnichannel subscription item scheduled changessales_orderEntity that represents sales order
customerEntity that represents a customersubscriptionEntity that represents a subscription of a customerinvoiceInvoice descriptionquoteEntity that represents a quote
credit_noteCredit note descriptiontransactionEntity that represents a transaction.planEntity that represents a subscription planaddonEntity that represents an addoncouponEntity that represents a discount couponorderEntity that represents an orderbusiness_entityEntity that represents item of type business entityomnichannel_subscriptionEntity that represents omnichannel subscriptionomnichannel_subscription_itemEntity that represents omnichannel subscription itemomnichannel_transactionEntity that represents omnichannel subscription transactionrecorded_purchaseEntity that represents recorded purchasesomnichannel_subscription_item_scheduled_changeEntity that represents omnichannel subscription item scheduled changessales_orderEntity that represents sales order
Show all values[+]
optional, string, max chars=100 The user who created the comment. If created via API, this contains the name given for the API key used.
string, max chars=1000 Actual notes for the comment.
timestamp(UTC) in seconds The time at which this comment was created
enumerated string, default=user Type of comment this is. Possible values are
userComment generated by user either via API or Admin console.systemComment generated by Chargebee when any backend changes happen for an entity
userComment generated by user either via API or Admin console.systemComment generated by Chargebee when any backend changes happen for an entity
Show all values[+]
string, max chars=100 Unique identifier of the entity. Create a new comment for an entity. The newly added comment will be shown in the web interface as well.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/comments \
-u {site_api_key}:\
-d entity_id="__test__KyVnHhSBWm65N2rx" \
-d entity_type="SUBSCRIPTION" \
-d notes="This is a test comment"
Sample Response [ JSON ]
Show more...
{
"comment": {
"added_by": "full_access_key_v1",
"created_at": 1517505963,
"entity_id": "__test__KyVnHhSBWm65N2rx",
"entity_type": "subscription",
"id": "cmt___test__KyVnHhSBWm69N2s4",
"notes": "This is a test comment",
"object": "comment",
"type": "user"
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/comments
required, enumerated string Type of the entity to create the comment for. Possible values are
customerEntity that represents a customersubscriptionEntity that represents a subscription of a customerinvoiceInvoice descriptionquoteEntity that represents a quotecredit_noteCredit note descriptiontransactionEntity that represents a transaction.planEntity that represents a subscription planaddonEntity that represents an addoncouponEntity that represents a discount couponorderEntity that represents an orderbusiness_entityEntity that represents item of type business entityomnichannel_subscriptionEntity that represents omnichannel subscriptionomnichannel_subscription_itemEntity that represents omnichannel subscription itemomnichannel_transactionEntity that represents omnichannel subscription transactionrecorded_purchaseEntity that represents recorded purchasesomnichannel_subscription_item_scheduled_changeEntity that represents omnichannel subscription item scheduled changessales_orderEntity that represents sales order
customerEntity that represents a customersubscriptionEntity that represents a subscription of a customerinvoiceInvoice descriptionquoteEntity that represents a quote
credit_noteCredit note descriptiontransactionEntity that represents a transaction.planEntity that represents a subscription planaddonEntity that represents an addoncouponEntity that represents a discount couponorderEntity that represents an orderbusiness_entityEntity that represents item of type business entityomnichannel_subscriptionEntity that represents omnichannel subscriptionomnichannel_subscription_itemEntity that represents omnichannel subscription itemomnichannel_transactionEntity that represents omnichannel subscription transactionrecorded_purchaseEntity that represents recorded purchasesomnichannel_subscription_item_scheduled_changeEntity that represents omnichannel subscription item scheduled changessales_orderEntity that represents sales order
Show all values[+]
required, string, max chars=100 Unique identifier of the entity.
required, string, max chars=1000 Actual notes for the comment.
optional, string, max chars=100 The user who created the comment. If created via API, this contains the name given for the API key used.
always returned required
Resource object representing comment
Sample admin console URL
https://{site}.chargebee.com/admin-console/comments/123x
Retrieve a comment for an entity identified by comment ID.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/comments/cmt___test__KyVnHhSBWm77N2sQ \
-u {site_api_key}:
Sample Response [ JSON ]
Show more...
{
"comment": {
"added_by": "full_access_key_v1",
"created_at": 1517505967,
"entity_id": "__test__KyVnHhSBWm74Q2sK",
"entity_type": "subscription",
"id": "cmt___test__KyVnHhSBWm77N2sQ",
"notes": "This is a no cost plan",
"object": "comment",
"type": "user"
}
}
URL Format
GET
https://{site}.chargebee.com/api/v2/comments/{comment-id}
always returned required
Resource object representing comment
Sample admin console URL
https://{site}.chargebee.com/admin-console/comments/123x
Retrieve the list of comments sorted by the recent ones on the top.
If you want to retrieve the list of comments for an entity, for example, subscription you can filter them by passing the entity type and unique identifier for that entity, for example, subscription ID.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/comments \
-G \
-u {site_api_key}:\
--data-urlencode limit=2 \
--data-urlencode "sort_by[asc]"=created_at
Sample Response [ JSON ]
Show more...
{
"list": [
{
"comment": {
"added_by": "full_access_key_v1",
"created_at": 1517505963,
"entity_id": "__test__KyVnHhSBWm65N2rx",
"entity_type": "subscription",
"id": "cmt___test__KyVnHhSBWm69N2s4",
"notes": "This is a test comment",
"object": "comment",
"type": "user"
}
},
{..}
],
"next_offset": "[\"1517505966000\",\"109000000148\"]"
}
URL Format
GET
https://{site}.chargebee.com/api/v2/comments
optional, integer, default=10, min=1, max=100 The number of resources to be returned.
optional, string, max chars=1000 Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set offset
to the value of next_offset
obtained in the previous iteration of the API call.
optional, enumerated string Type of the entity this comment generated for. Possible values are
customerEntity that represents a customersubscriptionEntity that represents a subscription of a customerinvoiceInvoice descriptionquoteEntity that represents a quotecredit_noteCredit note descriptiontransactionEntity that represents a transaction.planEntity that represents a subscription planaddonEntity that represents an addoncouponEntity that represents a discount couponorderEntity that represents an orderbusiness_entityEntity that represents item of type business entityomnichannel_subscriptionEntity that represents omnichannel subscriptionomnichannel_subscription_itemEntity that represents omnichannel subscription itemomnichannel_transactionEntity that represents omnichannel subscription transactionrecorded_purchaseEntity that represents recorded purchasesomnichannel_subscription_item_scheduled_changeEntity that represents omnichannel subscription item scheduled changessales_orderEntity that represents sales order
customerEntity that represents a customersubscriptionEntity that represents a subscription of a customerinvoiceInvoice descriptionquoteEntity that represents a quote
credit_noteCredit note descriptiontransactionEntity that represents a transaction.planEntity that represents a subscription planaddonEntity that represents an addoncouponEntity that represents a discount couponorderEntity that represents an orderbusiness_entityEntity that represents item of type business entityomnichannel_subscriptionEntity that represents omnichannel subscriptionomnichannel_subscription_itemEntity that represents omnichannel subscription itemomnichannel_transactionEntity that represents omnichannel subscription transactionrecorded_purchaseEntity that represents recorded purchasesomnichannel_subscription_item_scheduled_changeEntity that represents omnichannel subscription item scheduled changessales_orderEntity that represents sales order
Show all values[+]
optional, string, max chars=100 Unique identifier of the entity.
optional, string filter
Sorts based on the specified attribute.
Supported attributes : created_at
Supported sort-orders : asc, desc
Example → sort_by[asc] = "created_at"
This will sort the result based on the 'created_at'
attribute in ascending(earliest first) order.
optional, timestamp(UTC) in seconds filter
The time at which this comment was created. Possible values are :
Supported operators : after, before, on, between
Example → created_at[after] = "1456332678"
The time at which this comment was created.
pass parameters as created_at[<param name>][<operator>]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :
Example →
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :
Example →
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :
Example →
optional, string filter
Possible values are :
Supported operators :
Example →
always returned required
Resource object representing comment
always returned optional, string, max chars=1000
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.
Sample admin console URL
https://{site}.chargebee.com/admin-console/comments/123x
Delete a comment for an entity identified by comment ID.
Only the comments that are added via Admin console and API can be deleted. Chargebee generated "System" comments cannot be deleted.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Request
curl https://{site}.chargebee.com/api/v2/comments/cmt___test__KyVnHhSBWm6TD2sB/delete \
-X POST \
-u {site_api_key}:
Sample Response [ JSON ]
Show more...
{
"comment": {
"added_by": "full_access_key_v1",
"created_at": 1517505964,
"entity_id": "__test__KyVnHhSBWm6PK2s5",
"entity_type": "subscription",
"id": "cmt___test__KyVnHhSBWm6TD2sB",
"notes": "This is a no cost plan",
"object": "comment",
"type": "user"
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/comments/{comment-id}/delete
always returned required
Resource object representing comment
Sample admin console URL
https://{site}.chargebee.com/admin-console/comments/123x