Airwallex logo
Airwallex logoAirwallex logo

Products

Copy for LLMView as Markdown

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.

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
namerequiredstring

Product name.

request_idrequiredstring

Unique request identifier specified by the merchant.

activeboolean

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

descriptionstring

Product description.

metadataobject

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

unitstring

Product unit.

Response body - 201 Created
activeboolean

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

descriptionstring

Product description.

idstring

Unique identifier of the Product object.

metadataobject

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

namestring

Product name.

request_idstring

Unique request identifier specified by the merchant in the last operation.

unitstring

Product unit.

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

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",
> "unit": "month"
>}'
Response (201 Created)
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}
Was this section helpful?

Retrieve a product

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

Retrieves the product details by the unique identifier.

Parameters
idrequiredstring

Unique identifier of the Product object.

Response body - 200 OK
activeboolean

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

descriptionstring

Product description.

idstring

Unique identifier of the Product object.

metadataobject

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

namestring

Product name.

request_idstring

Unique request identifier specified by the merchant in the last operation.

unitstring

Product unit.

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 "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}
Was this section helpful?

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.

Parameters
idrequiredstring

Unique identifier of the Product object.

Request body
request_idrequiredstring

Unique request identifier specified by the merchant.

activeboolean

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

descriptionstring

Product description.

metadataobject

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

namestring

Product name.

unitstring

Product unit.

Response body - 200 OK
activeboolean

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

descriptionstring

Product description.

idstring

Unique identifier of the Product object.

metadataobject

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

namestring

Product name.

request_idstring

Unique request identifier specified by the merchant in the last operation.

unitstring

Product unit.

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",
> "unit": "month"
>}'
Response (200 OK)
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}
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.

page_numinteger

Page number starting from 0. Defaults to 0.

page_sizeinteger

Number of Products to be listed per page. Defaults to 20.

Response body - 200 OK
has_moreboolean

A flag which identifies whether there are more results.

itemsarray

Paged results.

items.activeboolean

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

items.descriptionstring

Product description.

items.idstring

Unique identifier of the Product object.

items.metadataobject

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

items.namestring

Product name.

items.request_idstring

Unique request identifier specified by the merchant in the last operation.

items.unitstring

Product unit.

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 "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}
Was this section helpful?