Airwallex logo
Airwallex logo

Products via API

This tutorial will guide you through the steps to create and manage products via Billing APIs.

Before you begin

Create a product

Call Create a product API and provide as much information as possible about the product.

  • name: The name of the product.
  • description: Product description.
  • unit: The billing frequency for the product.

The example code shows how to create a one-off charge product.

Shell
1curl --request POST
2--url 'https://api-demo.airwallex.com/api/v1/products/create'
3--header 'Content-Type: application/json'
4--header 'Authorization: Bearer <your_bearer_token>'
5--data '{
6 "active": true,
7 "description": "Product for one-off charge",
8 "name": "One-off product",
9 "request_id": "89185d28-8e2d-4429-9df9-1e40eb707772"
10}'

Deactivate a product

You can retire products you no longer wish to use by setting the active field to false in Update a product API request.

Deactivating a product means it can no longer be selected when creating new subscriptions or invoices. Note that it will not affect existing subscriptions or invoices that have used this product.

Shell
1curl --request POST
2--url 'https://api-demo.airwallex.com/api/v1/products/prd_hkpd1x2gbgazzvcd42w/update'
3--header 'Content-Type: application/json'
4--header 'Authorization: Bearer <your_bearer_token>'
5--data '{
6 "active": false
7}'

Manage products

After creating a product object, you can perform the following actions:

Was this page helpful?