View a markdown version of this page

CustomCharge - AWS App Monetization

CustomCharge

One developer-computed charge.

Contents

amount

The charge, as a decimal string in major currency units (for example, "12.50").

Type: String

Length Constraints: Minimum length of 1. Maximum length of 20.

Pattern: (0|[1-9][0-9]*)(\.[0-9]+)?

Required: Yes

chargeId

Caller-chosen stable id for THIS charge. It is the idempotency and replace key: re-submitting the same chargeId within its assigned period upserts the charge in place. A chargeId is bound to the first period it is accepted into; re-submitting it after that period rolls over is refused (ConflictException) rather than billing it again, so it must be unique per charge for this user across all periods — use a UUID or your own invoice-line id (the caller does not know the billing period, so it cannot be encoded in the id).

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [A-Za-z0-9._:-]+

Required: Yes

currency

The ISO 4217 currency of the amount. Only USD is supported; a non-USD value is rejected.

Type: String

Pattern: [A-Z]{3}

Required: Yes

description

Human-readable description, surfaced on the invoice line.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 512.

Required: Yes

metricId

Optional metric this charge derives from. Omitted for a charge not tied to a metric (a flat or custom fee).

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [A-Za-z0-9_-]+

Required: No

taxCode

Optional product tax code; defaults to the service default when omitted.

Type: String

Length Constraints: Fixed length of 13.

Pattern: taas_[0-9]{8}

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: