Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

InstalledAddons Usage Subresource (Preview)


(information)

Info

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


Base URL

base-url page anchor

_10
https://preview.twilio.com/marketplace


The Module resource uses the same HTTP Basic Authentication as other Twilio APIs. Use your Twilio account SID as your username and your Auth Token as your password.


This APi endpoint requires Twilio to enable manual usage reporting for an add-on that you own. To verify that it's been enabled, navigate to Marketplace > Catalog > Add-on (select your add-on) in the Twilio Console. Check that "Manual Usage Reporting" is added as a category.


Installed Add-ons Usage subresource

installed-add-ons-usage-subresource page anchor

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


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. This should only be used to correct a reporting error with a previous API call.

Charging a customer for add-on usage

charging-a-customer-for-add-on-usage page anchor

_10
curl -X POST "https://preview.twilio.com/marketplace/InstalledAddOns/XExxxxxxxxxxxxxxxxxxxxxxx/Usage" \
_10
--data-urlencode "Quantity=10" \
_10
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Response


_10
202 Accepted

Crediting a customer for add-on usage previously posted

crediting-a-customer-for-add-on-usage-previously-posted page anchor

_10
curl -X POST "https://preview.twilio.com/marketplace/InstalledAddOns/XExxxxxxxxxxxxxxxxxxxxxxx/Usage" \
_10
--data-urlencode "Quantity=-10" \
_10
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Response


_10
202 Accepted


Here is a list of common scenarios along with associated HTTP response codes, Twilio Debugger notifications, and messages that the API may return.

HTTP response codeDebugger notificationDescription
404WarningThe Add-on is not installed on the customer account or no Module is found with the Installation SID.
403WarningThe Account Sid in the API request does not match with the Partner Account Sid attached to the Add-on.
403WarningThe Add-on is not set up to accept Manual Usage Reporting .
403WarningThe Add-on is not in one of the Marketing Preview, Private Beta, or Active state.
400WarningQuantity is either null, empty, or 0.
500ErrorError received while generating a billing event.
202N/AThe request is successful, and a billing event is generated.

Rate this page: