Skip to main content

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.

info

This is a Tier 3 endpoint.

HTTP Endpoint

GET /v1/payments

Return value

The PaymentInformation corresponding to the given plugin payment token.

Query parametersDescription
plugin_payment_token
plugin_payment_tokenString

Short-lived token returned from "getPluginPaymentTokenAsync" in the plugin payments API and used to authenticate to this endpoint. Read more about generating this token through Calling the Payments REST API from a plugin or widget.

Error codesDescription
400Invalid parameter. The message parameter on the response will describe the error.
401Issue 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.

info

This is a Tier 3 endpoint.

HTTP Endpoint

GET /v1/payments

Return value

The PaymentInformation corresponding to the given user and resource IDs.

Query parametersDescription
user_id
Number
The ID of the user to query payment information about. You can get the user ID by having the user OAuth2 to the Figma REST API.
community_file_id
Number
The ID of the Community file to query a user's payment information on. You can get the Community file ID from the file's Community page (look for the number after file/ in the URL). Provide exactly one of community_file_id, plugin_id, or widget_id.
plugin_id
Number
The ID of the plugin to query a user's payment information on. You can get the plugin ID from the plugin's manifest, or from the plugin's Community page (look for the number after plugin/ in the URL). Provide exactly one of community_file_id, plugin_id, or widget_id.
widget_id
Number
The ID of the widget to query a user's payment information on. You can get the widget ID from the widget's manifest, or from the widget's Community page (look for the number after widget/ in the URL). Provide exactly one of community_file_id, plugin_id, or widget_id.
Error codesDescription
400Invalid parameter. The message parameter on the response will describe the error.
401Issue with authentication. The message parameter on the response will describe the error.