Skip to contentSkip to navigationSkip to topbar
On this page

Installed Add-ons Usage Subresource


(warning)

Migrate from Preview to v1

The Preview API for this resource is deprecated. To migrate from Preview to V1, refer to the Marketplace API migration guide for users or publishers.

The Installed Add-ons Usage subresource allows Twilio Marketplace Partners to manually report customer usage on Add-ons that they own.

(information)

Info

If you already have a published Add-on and would like access to this API resource, reach out to Twilio.


Prerequisite

prerequisite page anchor

The Installed Add-ons Usage subresource requires Twilio to turn on manual usage reporting for an Add-on that you own. To verify that manual usage reporting is turned on, go to Marketplace > Catalog > Add-on (select your add-on) in the Twilio Console. Check that "Manual Usage Reporting" is included as a category.


ParameterDescription
QuantityRequired. A number greater than or less than zero that represents usage of a specific add-on installation. When set to a value greater than zero, the update is reported as usage on the customer account, and the customer will be charged. See Charging a customer for Add-on Usage as an example. When set to a value less than zero, the update is reported as a credit on the customer account. Credits should only be used to correct a reporting error with a previous API call.

Charge a customer for add-on usage

charge-a-customer-for-add-on-usage page anchor
1
curl -X POST "https://preview.twilio.com/marketplace/InstalledAddOns/XExxxxxxxxxxxxxxxxxxxxxxx/Usage" \
2
--data-urlencode "Quantity=10" \
3
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Response

202 Accepted

Credit a customer for add-on usage previously posted

credit-a-customer-for-add-on-usage-previously-posted page anchor
1
curl -X POST "https://preview.twilio.com/marketplace/InstalledAddOns/XExxxxxxxxxxxxxxxxxxxxxxx/Usage" \
2
--data-urlencode "Quantity=-10" \
3
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Response

202 Accepted