Endpoints
There are two methods to query for a user's payment information on a plugin, widget, or Community file. The first method, using plugin payment tokens, is typically used when making queries from a plugin's or widget's code. The second method, providing a user ID and resource ID, is typically used when making queries from anywhere else.
Note that you can only query for resources that you own. In most cases, this means that you can only query resources that you originally created.
GET payments via plugin payment token
Fetch the payment information of a user from your plugin or widget.
This is a Tier 3 endpoint.
HTTP Endpoint
GET /v1/payments
Return value
The PaymentInformation corresponding to the given plugin payment token.
Query parameters | Description |
---|---|
plugin_payment_token |
|
Error codes | Description |
---|---|
400 | Invalid parameter. The message parameter on the response will describe the error. |
401 | Issue with authentication. The message parameter on the response will describe the error. |
Calling the Payments REST API from a plugin or widget
We offer a method in our plugin payments API that enables you to securely query for the payment status of a user of your plugin or widget. You should use this method if your plugin or widget makes a call to a server endpoint. Follow the Getting Started guide to set up the plugin payments API in your plugin or widget.
Once you have enabled the plugin payments API in your plugin's or widget's code, you can call the getPluginPaymentTokenAsync method to generate a secure plugin payment token to provide to this endpoint.
GET payments via user and resource ID
Fetch the payment information of a user on your resource using IDs.
This is a Tier 3 endpoint.
HTTP Endpoint
GET /v1/payments
Return value
The PaymentInformation corresponding to the given user and resource IDs.
Query parameters | Description |
---|---|
user_id |
|
community_file_id |
|
plugin_id |
|
widget_id |
|
Error codes | Description |
---|---|
400 | Invalid parameter. The message parameter on the response will describe the error. |
401 | Issue with authentication. The message parameter on the response will describe the error. |