Products
A Product represents the good or service you offer to customers (e.g. books, memberships). When associated with Prices, they can be used in Invoice and Subscription APIs.
POST /api/v1/billing/products/createGET /api/v1/billing/products/{id}POST /api/v1/billing/products/{id}/updateGET /api/v1/billing/products
Create a product
POST /api/v1/billing/products/create
Creates a new Product object.
true if the product is available for new purchases, false otherwise. Defaults to true.
Product description. Used for internal classification and identification.
A set of string key-value pairs that you can attach to this object for storing additional information.
Product name.
Unique request ID specified by the merchant.
The tax category of the product. Select the category that best describes this product to ensure accurate tax calculation. Learn more about tax categories
Product unit.
true if the product is available for new purchases, false otherwise.
Time when this product was created.
Product description.
ID of the Product object.
A set of string key-value pairs that you can attach to this object for storing additional information.
Product name.
The tax category of the product.
Product unit.
Time when this product was last updated.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/billing/products/create' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "active": true,> "description": "The license to use software in one month.",> "metadata": {> "foo": "bar"> },> "name": "Software License",> "request_id": "ee939540-3203-4a2c-9172-89a566485dd9",> "tax_code": "pct_0504010000",> "unit": "month">}'
1{2 "active": true,3 "created_at": "2022-01-01T10:15:30+0000",4 "description": "The license to use software in one month.",5 "id": "prd_hkpd1x2gbgazzvcd42w",6 "metadata": {7 "foo": "bar"8 },9 "name": "Software License",10 "tax_code": "pct_0504010000",11 "unit": "month",12 "updated_at": "2022-01-01T10:15:30+0000"13}
Retrieve a product
GET /api/v1/billing/products/{id}
Retrieves the product details by the ID.
ID of the Product object.
true if the product is available for new purchases, false otherwise.
Time when this product was created.
Product description.
ID of the Product object.
A set of string key-value pairs that you can attach to this object for storing additional information.
Product name.
The tax category of the product.
Product unit.
Time when this product was last updated.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/billing/products/product_id' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "active": true,3 "created_at": "2022-01-01T10:15:30+0000",4 "description": "The license to use software in one month.",5 "id": "prd_hkpd1x2gbgazzvcd42w",6 "metadata": {7 "foo": "bar"8 },9 "name": "Software License",10 "tax_code": "pct_0504010000",11 "unit": "month",12 "updated_at": "2022-01-01T10:15:30+0000"13}
Update a product
POST /api/v1/billing/products/{id}/update
Updates a Product. Only fields provided in the request are updated, while omitted fields remain unchanged. Array fields are fully replaced if included. Set a field to null or an empty string (for strings) to clear its value.
ID of the Product object.
true if the product is available for new purchases, false otherwise.
Product description. Used for internal classification and identification.
A set of string key-value pairs that you can attach to this object for storing additional information.
Product name.
Unique request ID specified by the merchant.
The tax category of the product.
Product unit.
true if the product is available for new purchases, false otherwise.
Time when this product was created.
Product description.
ID of the Product object.
A set of string key-value pairs that you can attach to this object for storing additional information.
Product name.
The tax category of the product.
Product unit.
Time when this product was last updated.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/billing/products/product_id/update' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "active": true,> "description": "The license to use software in one month.",> "metadata": {> "foo": "bar"> },> "name": "Software License",> "request_id": "ee939540-3203-4a2c-9172-89a566485dd9",> "tax_code": "pct_0504010000",> "unit": "month">}'
1{2 "active": true,3 "created_at": "2022-01-01T10:15:30+0000",4 "description": "The license to use software in one month.",5 "id": "prd_hkpd1x2gbgazzvcd42w",6 "metadata": {7 "foo": "bar"8 },9 "name": "Software License",10 "tax_code": "pct_0504010000",11 "unit": "month",12 "updated_at": "2022-01-01T10:15:30+0000"13}
Get list of products
GET /api/v1/billing/products
Retrieves a list of Products based on the query parameters.
true if the product is available for new purchases, false otherwise.
A bookmark for use in pagination to retrieve either the next page or the previous page of results. You can fetch the value for this identifier from the response of the previous API call. To retrieve the next page of results, pass the value of page_after (if not null) from the response to a subsequent call. To retrieve the previous page of results, pass the value of page_before (if not null) from the response to a subsequent call.
Number of Products per page. Defaults to 20.
Paged results.
true if the product is available for new purchases, false otherwise.
Time when this product was created.
Product description.
ID of the Product object.
A set of string key-value pairs that you can attach to this object for storing additional information.
Product name.
The tax category of the product.
Product unit.
Time when this product was last updated.
The page cursor used for searching after page.
The page cursor used for search before page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/billing/products' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "items": [3 {4 "active": true,5 "created_at": "2022-01-01T10:15:30+0000",6 "description": "The license to use software in one month.",7 "id": "prd_hkpd1x2gbgazzvcd42w",8 "metadata": {9 "foo": "bar"10 },11 "name": "Software License",12 "tax_code": "pct_0504010000",13 "unit": "month",14 "updated_at": "2022-01-01T10:15:30+0000"15 }16 ],17 "page_after": "<string>",18 "page_before": "<string>"19}