# Set an offer's price

Sets the price of one offer, in USD per 1 `unit` (see **Prices and units**). The price must be between 0.00001 and 10000
with at most 5 decimal places; more decimals are rejected, never rounded. Each offer's price can change at most once per
cooldown window (see **Price update cooldown**). Sending the price the offer already has succeeds with `changed: false`
and does not start a new window.

Endpoint: PUT /offers/{offerId}/price
Version: 1.0.0
Security: ApiKeyAuth

## Security:

  - `ApiKeyAuth` (unknown)
    apiKey in header x-api-key

## Path parameters:

  - `offerId` (integer, required)
    The offer id.

## Request fields (application/json):

  - `price` (number, required)
    USD per 1 `unit` of the offer's game currency. A JSON number with at most 5 decimal places; more decimals are rejected, never rounded.

## Response 200:

  - `200` (unknown)
    Price applied, or unchanged when the offer already had that price.

## Response 200 fields (application/json):

  - `changed` (boolean, required)
    False when nothing needed changing (already paused, already active, or the price was already this value). No cooldown started in that case.

  - `offer` (object, required)

  - `offer.id` (integer, required)
    The offer id.

  - `offer.gameId` (integer, required)
    The game the offer belongs to.

  - `offer.gameName` (string)

  - `offer.name` (string, required)
    Variant of the offer, for example server and faction.

  - `offer.status` (string, required)
    `active` = visible to buyers; `paused` = unlisted; `unavailable` = in any other state. An `unavailable` offer is read-only:
it cannot be activated or paused (`409 OFFER_NOT_ACTIVATABLE`).
    Enum: "active", "paused", "unavailable"

  - `offer.price` (number, required)
    USD per 1 `unit` of the offer's game currency. A JSON number with at most 5 decimal places; more decimals are rejected, never rounded.

  - `offer.currency` (string, required)
    Enum: "USD"

  - `offer.unit` (string | null, required)
    Unit symbol of the game currency, for example `M`, `K` or `G`.

  - `offer.quantity` (number, required)
    Units available, in `unit`. Managed on the ChicksGold website.

  - `offer.minimum` (number, required)
    Minimum units per order, in `unit`. Managed on the ChicksGold website.

  - `offer.deliveryTime` (integer)

  - `offer.deliveryPeriod` (string | null)
    The period `deliveryTime` is expressed in. Returned exactly as written here, with an initial capital letter (for example `Minutes`), or null.
    Enum: "Instant", "Minutes", "Hours", "Days", "Weeks", "Months", "null"

  - `offer.expiresAt` (string | null)

  - `offer.priceUpdatableAt` (string | null)
    Earliest instant the price can change again.

  - `offer.updatedAt` (string, required)

## Response 200 headers (application/json):

  - `X-Request-Id` (string)
    Unique id of this request. Include it when you contact support.

## Response 400:

  - `400` (unknown)
    The request is malformed, has unknown fields or has invalid values. `details.errors` lists each problem.

## Response 400 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Stable machine-readable code. See the table in **Errors**.
    Enum: "VALIDATION_FAILED", "BAD_REQUEST", "INVALID_API_KEY", "API_KEY_NOT_REGISTERED", "API_KEY_DISABLED", "SELLER_API_DISABLED", "SELLER_RESTRICTED", "FORBIDDEN", "NOT_FOUND", "OFFER_NOT_FOUND", "OFFER_OUT_OF_STOCK", "OFFER_NOT_ACTIVATABLE", "BATCH_TOO_LARGE", "PAYLOAD_TOO_LARGE", "RATE_LIMITED", "QUOTA_EXCEEDED", "PRICE_UPDATE_COOLDOWN", "INTERNAL_ERROR", "UPSTREAM_ERROR"

  - `error.message` (string, required)
    A human-readable explanation. Do not parse it.

  - `error.requestId` (string)
    Identifies the request. Include it when you contact support.

  - `error.details` (object)
    Extra information that depends on the code.

## Response 400 headers (application/json):

  - `X-Request-Id` (string)
    Unique id of this request. Include it when you contact support.

## Response 401:

  - `401` (unknown)
    The `x-api-key` header is missing or the key is invalid.

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Stable machine-readable code. See the table in **Errors**.
    Enum: "VALIDATION_FAILED", "BAD_REQUEST", "INVALID_API_KEY", "API_KEY_NOT_REGISTERED", "API_KEY_DISABLED", "SELLER_API_DISABLED", "SELLER_RESTRICTED", "FORBIDDEN", "NOT_FOUND", "OFFER_NOT_FOUND", "OFFER_OUT_OF_STOCK", "OFFER_NOT_ACTIVATABLE", "BATCH_TOO_LARGE", "PAYLOAD_TOO_LARGE", "RATE_LIMITED", "QUOTA_EXCEEDED", "PRICE_UPDATE_COOLDOWN", "INTERNAL_ERROR", "UPSTREAM_ERROR"

  - `error.message` (string, required)
    A human-readable explanation. Do not parse it.

  - `error.requestId` (string)
    Identifies the request. Include it when you contact support.

  - `error.details` (object)
    Extra information that depends on the code.

## Response 401 headers (application/json):

  - `X-Request-Id` (string)
    Unique id of this request. Include it when you contact support.

## Response 403:

  - `403` (unknown)
    The request is understood but not allowed. `code` tells you why: `API_KEY_NOT_REGISTERED`, `API_KEY_DISABLED`,
`SELLER_API_DISABLED` or `FORBIDDEN`.

## Response 403 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Stable machine-readable code. See the table in **Errors**.
    Enum: "VALIDATION_FAILED", "BAD_REQUEST", "INVALID_API_KEY", "API_KEY_NOT_REGISTERED", "API_KEY_DISABLED", "SELLER_API_DISABLED", "SELLER_RESTRICTED", "FORBIDDEN", "NOT_FOUND", "OFFER_NOT_FOUND", "OFFER_OUT_OF_STOCK", "OFFER_NOT_ACTIVATABLE", "BATCH_TOO_LARGE", "PAYLOAD_TOO_LARGE", "RATE_LIMITED", "QUOTA_EXCEEDED", "PRICE_UPDATE_COOLDOWN", "INTERNAL_ERROR", "UPSTREAM_ERROR"

  - `error.message` (string, required)
    A human-readable explanation. Do not parse it.

  - `error.requestId` (string)
    Identifies the request. Include it when you contact support.

  - `error.details` (object)
    Extra information that depends on the code.

## Response 403 headers (application/json):

  - `X-Request-Id` (string)
    Unique id of this request. Include it when you contact support.

## Response 404:

  - `404` (unknown)
    The offer does not exist or is not yours.

## Response 404 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Stable machine-readable code. See the table in **Errors**.
    Enum: "VALIDATION_FAILED", "BAD_REQUEST", "INVALID_API_KEY", "API_KEY_NOT_REGISTERED", "API_KEY_DISABLED", "SELLER_API_DISABLED", "SELLER_RESTRICTED", "FORBIDDEN", "NOT_FOUND", "OFFER_NOT_FOUND", "OFFER_OUT_OF_STOCK", "OFFER_NOT_ACTIVATABLE", "BATCH_TOO_LARGE", "PAYLOAD_TOO_LARGE", "RATE_LIMITED", "QUOTA_EXCEEDED", "PRICE_UPDATE_COOLDOWN", "INTERNAL_ERROR", "UPSTREAM_ERROR"

  - `error.message` (string, required)
    A human-readable explanation. Do not parse it.

  - `error.requestId` (string)
    Identifies the request. Include it when you contact support.

  - `error.details` (object)
    Extra information that depends on the code.

## Response 404 headers (application/json):

  - `X-Request-Id` (string)
    Unique id of this request. Include it when you contact support.

## Response 429:

  - `429` (unknown)
    Either this offer's price was changed too recently (`PRICE_UPDATE_COOLDOWN`, a business rule, with the cooldown headers),
or a request limit was hit (`RATE_LIMITED` or `QUOTA_EXCEEDED`). Read `Retry-After` and retry after that many seconds.

## Response 429 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Stable machine-readable code. See the table in **Errors**.
    Enum: "VALIDATION_FAILED", "BAD_REQUEST", "INVALID_API_KEY", "API_KEY_NOT_REGISTERED", "API_KEY_DISABLED", "SELLER_API_DISABLED", "SELLER_RESTRICTED", "FORBIDDEN", "NOT_FOUND", "OFFER_NOT_FOUND", "OFFER_OUT_OF_STOCK", "OFFER_NOT_ACTIVATABLE", "BATCH_TOO_LARGE", "PAYLOAD_TOO_LARGE", "RATE_LIMITED", "QUOTA_EXCEEDED", "PRICE_UPDATE_COOLDOWN", "INTERNAL_ERROR", "UPSTREAM_ERROR"

  - `error.message` (string, required)
    A human-readable explanation. Do not parse it.

  - `error.requestId` (string)
    Identifies the request. Include it when you contact support.

  - `error.details` (object)
    Extra information that depends on the code.

## Response 429 headers (application/json):

  - `X-Request-Id` (string)
    Unique id of this request. Include it when you contact support.

  - `Retry-After` (integer)
    Seconds to wait before retrying.

  - `RateLimit-Limit` (integer)
    Price updates allowed per offer per window (always 1).

  - `RateLimit-Remaining` (integer)
    Price updates left for this offer in the current window.

  - `RateLimit-Reset` (integer)
    Seconds until this offer's price can change again.

## Response 500:

  - `500` (unknown)
    Unexpected error. Contact support with the `requestId` if it persists.

## Response 500 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Stable machine-readable code. See the table in **Errors**.
    Enum: "VALIDATION_FAILED", "BAD_REQUEST", "INVALID_API_KEY", "API_KEY_NOT_REGISTERED", "API_KEY_DISABLED", "SELLER_API_DISABLED", "SELLER_RESTRICTED", "FORBIDDEN", "NOT_FOUND", "OFFER_NOT_FOUND", "OFFER_OUT_OF_STOCK", "OFFER_NOT_ACTIVATABLE", "BATCH_TOO_LARGE", "PAYLOAD_TOO_LARGE", "RATE_LIMITED", "QUOTA_EXCEEDED", "PRICE_UPDATE_COOLDOWN", "INTERNAL_ERROR", "UPSTREAM_ERROR"

  - `error.message` (string, required)
    A human-readable explanation. Do not parse it.

  - `error.requestId` (string)
    Identifies the request. Include it when you contact support.

  - `error.details` (object)
    Extra information that depends on the code.

## Response 500 headers (application/json):

  - `X-Request-Id` (string)
    Unique id of this request. Include it when you contact support.

## Response 502:

  - `502` (unknown)
    A temporary problem on our side. Retry with exponential backoff. Other `5xx` statuses use the same envelope.

## Response 502 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Stable machine-readable code. See the table in **Errors**.
    Enum: "VALIDATION_FAILED", "BAD_REQUEST", "INVALID_API_KEY", "API_KEY_NOT_REGISTERED", "API_KEY_DISABLED", "SELLER_API_DISABLED", "SELLER_RESTRICTED", "FORBIDDEN", "NOT_FOUND", "OFFER_NOT_FOUND", "OFFER_OUT_OF_STOCK", "OFFER_NOT_ACTIVATABLE", "BATCH_TOO_LARGE", "PAYLOAD_TOO_LARGE", "RATE_LIMITED", "QUOTA_EXCEEDED", "PRICE_UPDATE_COOLDOWN", "INTERNAL_ERROR", "UPSTREAM_ERROR"

  - `error.message` (string, required)
    A human-readable explanation. Do not parse it.

  - `error.requestId` (string)
    Identifies the request. Include it when you contact support.

  - `error.details` (object)
    Extra information that depends on the code.

## Response 502 headers (application/json):

  - `X-Request-Id` (string)
    Unique id of this request. Include it when you contact support.

## Response 200 examples:

  - `Price changed` (unknown)

  - `The offer already had this price` (unknown)

## Response 403 examples:

  - `Key not registered` (unknown)

  - `Key disabled` (unknown)

  - `Access not enabled for the account` (unknown)

## Response 429 examples:

  - `Price changed too recently` (unknown)

  - `Too many requests per second` (unknown)

