Skip to main content

Actions

The ballerinax/aws.marketplace.mpe package exposes the following clients:

ClientPurpose
ClientRetrieves customer entitlements for AWS Marketplace products.

Client

Retrieves customer entitlements for AWS Marketplace products.

Configuration

FieldTypeDefaultDescription
regionRegionRequiredThe AWS region for the Marketplace Entitlement Service endpoint (e.g., US_EAST_1).
authAuthConfigRequiredAWS credentials including accessKeyId, secretAccessKey, and optional sessionToken.

Initializing the client

import ballerinax/aws.marketplace.mpe;

configurable string accessKeyId = ?;
configurable string secretAccessKey = ?;

mpe:Client mpeClient = check new (
region = mpe:US_EAST_1,
auth = {
accessKeyId,
secretAccessKey
}
);

Operations

Entitlements

getEntitlements

Retrieves the entitlement values for a given product, with optional filtering by customer identifier or dimension and pagination support.

Parameters:

NameTypeRequiredDescription
productCodestringYesThe AWS Marketplace product code (1–255 characters).
filterEntitlementFilterNoOptional filter with customerIdentifier and/or dimension string arrays to narrow results.
maxResultsintNoMaximum number of entitlements to return per request.
nextTokenstringNoPagination token from a previous response to retrieve the next page of results.

Returns: EntitlementsResponse|Error

Sample code:

mpe:EntitlementsResponse response = check mpeClient->getEntitlements(
productCode = "abc123def456"
);

Sample response:

{
"entitlements": [
{
"productCode": "abc123def456",
"dimension": "users",
"customerIdentifier": "CUST-abcdef123456",
"expirationDate": [1735689600, 0],
"value": 10
}
],
"nextToken": null
}
close

Closes the AWS MPE client and releases associated resources.

Returns: Error?

Sample code:

check mpeClient->close();

Filtered queries

getEntitlements (filtered by customer)

Retrieves entitlements filtered by a specific customer identifier.

Parameters:

NameTypeRequiredDescription
productCodestringYesThe AWS Marketplace product code.
filterEntitlementFilterYesFilter containing customerIdentifier array to filter by specific customers.

Returns: EntitlementsResponse|Error

Sample code:

mpe:EntitlementsResponse response = check mpeClient->getEntitlements(
productCode = "abc123def456",
filter = {
customerIdentifier: ["CUST-abcdef123456"]
}
);

Sample response:

{
"entitlements": [
{
"productCode": "abc123def456",
"dimension": "users",
"customerIdentifier": "CUST-abcdef123456",
"expirationDate": [1735689600, 0],
"value": 10
},
{
"productCode": "abc123def456",
"dimension": "storage_gb",
"customerIdentifier": "CUST-abcdef123456",
"expirationDate": [1735689600, 0],
"value": 50
}
],
"nextToken": null
}