Airwallex logo
Airwallex logoAirwallex logo

Products

Copy for LLMView as Markdown

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.

Endpoints
POST /api/v1/billing/products/create
GET /api/v1/billing/products/{id}
POST /api/v1/billing/products/{id}/update
GET /api/v1/billing/products

Create a product

POST /api/v1/billing/products/create

Creates a new Product object.

Request body
activeboolean

true if the product is available for new purchases, false otherwise. Defaults to true.

descriptionstring

Product description. Used for internal classification and identification.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

namerequiredstring

Product name.

request_idrequiredstring

Unique request ID specified by the merchant.

tax_codestring

The tax category of the product. Select the category that best describes this product to ensure accurate tax calculation. Learn more about tax categories

unitstring

Product unit.

Response body - 201 Created
activeboolean

true if the product is available for new purchases, false otherwise.

created_atstring

Time when this product was created.

descriptionstring

Product description.

idstring

ID of the Product object.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

namestring

Product name.

tax_codestring

The tax category of the product.

unitstring

Product unit.

updated_atstring

Time when this product was last updated.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error, duplicate_request_id

401

Unauthorized. Possible error codes: unauthorized

500

Server Error. Possible error codes: internal_error

POST /api/v1/billing/products/create
$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"
>}'
Response (201 Created)
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}
Was this section helpful?

Retrieve a product

GET /api/v1/billing/products/{id}

Retrieves the product details by the ID.

Parameters
idrequiredstring

ID of the Product object.

Response body - 200 OK
activeboolean

true if the product is available for new purchases, false otherwise.

created_atstring

Time when this product was created.

descriptionstring

Product description.

idstring

ID of the Product object.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

namestring

Product name.

tax_codestring

The tax category of the product.

unitstring

Product unit.

updated_atstring

Time when this product was last updated.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error

401

Unauthorized. Possible error codes: unauthorized

404

Not Found. Possible error codes: resource_not_found

500

Server Error. Possible error codes: internal_error

GET /api/v1/billing/products/{id}
$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'
Response (200 OK)
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}
Was this section helpful?

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.

Parameters
idrequiredstring

ID of the Product object.

Request body
activeboolean

true if the product is available for new purchases, false otherwise.

descriptionstring

Product description. Used for internal classification and identification.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

namestring

Product name.

request_idstring

Unique request ID specified by the merchant.

tax_codestring

The tax category of the product.

unitstring

Product unit.

Response body - 200 OK
activeboolean

true if the product is available for new purchases, false otherwise.

created_atstring

Time when this product was created.

descriptionstring

Product description.

idstring

ID of the Product object.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

namestring

Product name.

tax_codestring

The tax category of the product.

unitstring

Product unit.

updated_atstring

Time when this product was last updated.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error

401

Unauthorized. Possible error codes: unauthorized

404

Not Found. Possible error codes: resource_not_found

500

Server Error. Possible error codes: internal_error

POST /api/v1/billing/products/{id}/update
$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"
>}'
Response (200 OK)
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}
Was this section helpful?

Get list of products

GET /api/v1/billing/products

Retrieves a list of Products based on the query parameters.

Parameters
activeboolean

true if the product is available for new purchases, false otherwise.

pagestring

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.

page_sizeinteger

Number of Products per page. Defaults to 20.

Response body - 200 OK
itemsarray

Paged results.

items.activeboolean

true if the product is available for new purchases, false otherwise.

items.created_atstring

Time when this product was created.

items.descriptionstring

Product description.

items.idstring

ID of the Product object.

items.metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

items.namestring

Product name.

items.tax_codestring

The tax category of the product.

items.unitstring

Product unit.

items.updated_atstring

Time when this product was last updated.

page_afterstring

The page cursor used for searching after page.

page_beforestring

The page cursor used for search before page.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error

401

Unauthorized. Possible error codes: unauthorized

500

Server Error. Possible error codes: internal_error

GET /api/v1/billing/products
$curl --request GET \
> --url 'https://api-demo.airwallex.com/api/v1/billing/products' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
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}
Was this section helpful?