Products
Products are abstract models for any goods or services you provide to your Customers, such as books, music, VIP memberships, etc. Products associated with a Price are primarily 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.
Product name.
Unique request identifier specified by the merchant.
true if the product is available for new purchases, false otherwise. Defaults to true.
Product description.
A set of key-value pairs that you can attach to this object for storing additional information.
Product unit.
true if the product is available for new purchases, false otherwise.
Product description.
Unique identifier of the Product object.
A set of key-value pairs that you can attach to this object for storing additional information.
Product name.
Unique request identifier specified by the merchant in the last operation.
Product unit.
| 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",> "unit": "month">}'
1{2 "active": true,3 "description": "The license to use software in one month.",4 "id": "prd_hkpd1x2gbgazzvcd42w",5 "metadata": {6 "foo": "bar"7 },8 "name": "Software License",9 "request_id": "ee939540-3203-4a2c-9172-89a566485dd9",10 "unit": "month"11}
Retrieve a product
GET /api/v1/billing/products/{id}
Retrieves the product details by the unique identifier.
Unique identifier of the Product object.
true if the product is available for new purchases, false otherwise.
Product description.
Unique identifier of the Product object.
A set of key-value pairs that you can attach to this object for storing additional information.
Product name.
Unique request identifier specified by the merchant in the last operation.
Product unit.
| 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 "description": "The license to use software in one month.",4 "id": "prd_hkpd1x2gbgazzvcd42w",5 "metadata": {6 "foo": "bar"7 },8 "name": "Software License",9 "request_id": "ee939540-3203-4a2c-9172-89a566485dd9",10 "unit": "month"11}
Update a product
POST /api/v1/billing/products/{id}/update
Updates the attributes of an existing Product by setting the values of the request parameters. Any request body parameters not provided will be left unchanged.
Unique identifier of the Product object.
Unique request identifier specified by the merchant.
true if the product is available for new purchases, false otherwise.
Product description.
A set of key-value pairs that you can attach to this object for storing additional information.
Product name.
Product unit.
true if the product is available for new purchases, false otherwise.
Product description.
Unique identifier of the Product object.
A set of key-value pairs that you can attach to this object for storing additional information.
Product name.
Unique request identifier specified by the merchant in the last operation.
Product unit.
| 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",> "unit": "month">}'
1{2 "active": true,3 "description": "The license to use software in one month.",4 "id": "prd_hkpd1x2gbgazzvcd42w",5 "metadata": {6 "foo": "bar"7 },8 "name": "Software License",9 "request_id": "ee939540-3203-4a2c-9172-89a566485dd9",10 "unit": "month"11}
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.
Page number starting from 0. Defaults to 0.
Number of Products to be listed per page. Defaults to 20.
A flag which identifies whether there are more results.
Paged results.
true if the product is available for new purchases, false otherwise.
Product description.
Unique identifier of the Product object.
A set of key-value pairs that you can attach to this object for storing additional information.
Product name.
Unique request identifier specified by the merchant in the last operation.
Product unit.
| 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 "has_more": true,3 "items": [4 {5 "active": true,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 "request_id": "ee939540-3203-4a2c-9172-89a566485dd9",13 "unit": "month"14 }15 ]16}