Products via API
This tutorial will guide you through the steps to create and manage products via Billing APIs.
Before you begin
- Obtain your access token API by authenticating to Airwallex using your unique Client ID and API key. You will need the access token to make API calls.
- Check out Supported currencies for supported regions and currencies.
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.
Shell1curl --request POST2--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.
Shell1curl --request POST2--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": false7}'
Manage products
After creating a product object, you can perform the following actions:
- Update product details such as
descriptionandmetadatausing Update a Product API. - Retrieve product details anytime using Retrieve a Product API .
- Retrieve the list of products you've created using Get list of Products API.
Was this page helpful?