PutThirdPartyCost
Adds or updates a seller-declared third-party (non-AWS) monthly cost for an app. Omit the cost identifier to create a new cost, or supply an existing cost identifier to update it in place. The amount is a flat monthly value, and currency defaults to USD when omitted.
Request Syntax
POST /apps/appId/third-party-cost HTTP/1.1
Content-type: application/json
{
"amount": "string",
"clientToken": "string",
"costId": "string",
"currency": "string",
"description": "string",
"effectiveFrom": "string",
"effectiveTo": "string",
"frequency": "string",
"label": "string"
}
URI Request Parameters
The request uses the following URI parameters.
- appId
-
The ID of the app the cost belongs to.
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
[A-Za-z0-9_-]+Required: Yes
Request Body
The request accepts the following data in JSON format.
- amount
-
A flat monthly amount as a decimal string (for example, "12.50").
Type: String
Length Constraints: Minimum length of 1. Maximum length of 32.
Pattern:
-?[0-9]+(\.[0-9]+)?Required: Yes
- clientToken
-
AWS App Monetization does not use this value for this operation. To retry without creating a duplicate cost, pass the
costIdreturned by the first call.Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
[!-~]+Required: No
- costId
-
The ID of the cost. Omit it to create a new cost, or supply an existing cost ID to update that cost in place.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
[0-9a-z]{1,64}Required: No
- currency
-
The currency of the amount. Defaults to USD when omitted (USD is the only supported currency).
Type: String
Valid Values:
USDRequired: No
- description
-
A free-form description of the cost.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 512.
Required: No
- effectiveFrom
-
First month (YYYY-MM) the cost applies in. Absent means the cost has no start month.
Type: String
Length Constraints: Fixed length of 7.
Pattern:
\d{4}-(0[1-9]|1[0-2])Required: No
- effectiveTo
-
Last month (YYYY-MM) the cost applies in. Absent means the cost has no end month. When both are present, effectiveFrom must not be after effectiveTo.
Type: String
Length Constraints: Fixed length of 7.
Pattern:
\d{4}-(0[1-9]|1[0-2])Required: No
- frequency
-
How often the cost recurs. MONTHLY is the only value today.
Type: String
Valid Values:
MONTHLYRequired: No
- label
-
A human-readable label for the cost (for example, "Anthropic API").
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Required: Yes
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"item": {
"amount": "string",
"appId": "string",
"costId": "string",
"createdAt": number,
"currency": "string",
"description": "string",
"effectiveFrom": "string",
"effectiveTo": "string",
"frequency": "string",
"label": "string",
"updatedAt": number
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- item
-
The third-party cost that was created or updated.
Type: ThirdPartyCostItem object
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
The caller does not have sufficient permission to perform this action.
- message
-
Human-readable description of the access-denied condition.
HTTP Status Code: 403
- ConflictException
-
The request conflicts with the current state of the resource, such as a duplicate identifier or a version mismatch. Retrieve the current state of the resource and retry the request.
- message
-
Human-readable description of the conflict.
- resourceId
-
Identifier of the resource in a conflicting state.
- resourceType
-
Type of the resource in a conflicting state.
HTTP Status Code: 409
- InternalServerException
-
An unexpected error occurred while processing the request.
- message
-
Human-readable description of the server error.
- retryAfterSeconds
-
Advice to clients on when the call can be safely retried.
HTTP Status Code: 500
- ResourceNotFoundException
-
The referenced resource does not exist.
- message
-
Human-readable description of the missing resource.
- resourceId
-
Identifier of the resource that was not found.
- resourceType
-
Type of the resource that was not found (for example, "App" or "Plan").
HTTP Status Code: 404
- ThrottlingException
-
The request was denied due to request throttling.
- message
-
Human-readable description of the throttling condition.
- quotaCode
-
Service Quotas identifier for the throttled quota.
- retryAfterSeconds
-
Advice to clients on when the call can be safely retried.
- serviceCode
-
Service Quotas identifier for the originating service.
HTTP Status Code: 429
- ValidationException
-
The request failed input validation.
- fieldList
-
The specific input fields that failed validation, when applicable.
- message
-
Human-readable description of what failed validation.
- reason
-
Machine-readable reason the request failed validation, so callers act without parsing the message.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: