---
title: "Update Order"
method: PATCH
path: "/v1/orders/{order_id}"
tags: ["Orders"]
---

# Update Order

`PATCH /v1/orders/{order_id}`

Updates the order.

## Path parameters

- `order_id` string, required

## Request body

- OrderUpdate
  - `handled_by_client` boolean — Whether the order was handled/consumed by the client or not.

## Response `200`

Successful Response

- OrderRead
  - `id` string, required — The unique ID of the order.
  - `receipt_number` string — The number of the payment in receipt
  - `amount` integer, required — The amount of the order.
  - `amount_before_discount` integer, required — The amount of the order before discount.
  - `currency` 'USD' | 'EUR' | 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'UYU' | 'UZS' | 'VED' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XCG' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW' | 'ZWG' | 'ZWL' | 'RP' | 'VC', required
  - `player_id` string, required — The unique identifier for the player making the purchase.
  - `email` string — The player's email address.
  - `player_info` PlayerInfo
    - `attributes` PlayerAttributes
      - `level` integer
      - `platform` 'any' | 'ios' | 'android' | 'other'
      - `marketplace` 'none' | 'app_store' | 'google_play' | 'aghanim' | 'other' | 'one_store' | 'galaxy_store'
      - `device_type` 'Apple' | 'Android' | 'Unknown' | 'Other'
      - `tags` PlayerTag[]
      - `soft_currency_amount` integer
      - `hard_currency_amount` integer
      - `appsflyer_id` string
      - `appsflyer_app_id` string
      - `appsflyer_meta` object
      - `appsflyer_event_params` object
      - `appsflyer_customer_user_id` string
      - `adjust_device_id` object
      - `adjust_adid` string
      - `adjust_app_token` string
      - `adjust_authorization_token` string
      - `adjust_purchase_event_token` string
      - `adjust_callback_params` object
      - `adjust_partner_params` object
      - `singular_device_id` object
      - `singular_app_id` string
      - `devtodev_appid` string
      - `devtodev_apikey` string
      - `devtodev_device_id` DevtodevDeviceId
        - `deviceId` string
        - `devtodevId` integer
        - `userId` string
        - `advertisingId` string
      - `ga4_client_id` string — GA4 web `client_id` from the `_ga` cookie.
      - `ga4firebase_app_instance_id` string — Firebase mobile `app_instance_id` from the SDK.
      - `ga4_user_id` string — Partner-set GA4 cross-device `user_id`; falls back to `User.player_id` when unset.
    - `custom_attributes` object — The player's custom attributes.
    - `name` string — The player's name.
    - `avatar_url` string — The player's avatar URL.
  - `items` OrderItemRead[], required — The list of items the player wants to purchase included bonus items.
    - `id` string, required — The unique ID of the item.
    - `sku` string, required — Stock Keeping Unit (SKU) identifier.
    - `name` string, required — The name of the item.
    - `source` 'order' | 'bonus' | 'bundle' | 'coupon' | 'lootbox' | 'free_item' | 'liveops' | 'daily_reward' | 'loyalty_reward' | 'progression_program' | 'rolling_offer' | 'pick_one_offer', required
    - `description` string, nullable — The description of the item
    - `image_url` string — The URL of the image for the item
    - `quantity` integer, required — The quantity of the item.
    - `nested_items` Item[] — Nested items of the bundle.
      - `id` string, required — The unique ID of the item.
      - `sku` string, required — Stock Keeping Unit (SKU) identifier.
      - `name` string, required — The name of the item.
      - `source` 'order' | 'bonus' | 'bundle' | 'coupon' | 'lootbox' | 'free_item' | 'liveops' | 'daily_reward' | 'loyalty_reward' | 'progression_program' | 'rolling_offer' | 'pick_one_offer', required
      - `description` string, nullable — The description of the item
      - `image_url` string — The URL of the image for the item
      - `quantity` integer, required — The quantity of the item.
      - `nested_items` Item[] — Nested items of the bundle.
    - `selected_plan_key` string, nullable — The key of the subscription plan to pre-select on the checkout page. Only applicable to subscription SKUs.
    - `currency` 'USD' | 'EUR' | 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'UYU' | 'UZS' | 'VED' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XCG' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW' | 'ZWG' | 'ZWL' | 'RP' | 'VC', required
    - `price` integer — The price of the item in minor [currency units](https://docs.aghanim.com/currencies/)
    - `price_point` integer — The price point for local prices
    - `price_decimal` number — price in decimal units
  - `status` 'created' | 'captured' | 'paid' | 'canceled' | 'refunded' | 'refund_requested' | 'reattempted' | 'disputed', required — An enumeration.
  - `created_at` integer, required — Order creation date in Unix epoch time.
  - `paid_at` integer — Order payment date in Unix epoch time.
  - `metadata` object — The metadata object structured as key-value pairs to store additional information about the order.
  - `expires_at` integer — Order expiration date in Unix epoch time (seconds). Orders cannot be paid after this date.
  - `checkout_url` string, uri, required — The URL to redirect the player to complete the purchase.
  - `redirect_settings` RedirectSettings
    - `mode` 'no_redirect' | 'immediate' | 'delayed' — An enumeration.
    - `delay_seconds` number — The redirect delay in seconds when `mode` is set to `delayed`. If not specified, defaults to 5 seconds.
    - `target` 'game' | 'store' — An enumeration.
  - `ui_settings` UISettings
    - `mode` 'dark' | 'light' | 'auto' — An enumeration.
    - `show_player_info` boolean — Whether to display player information on checkout page
  - `coupons_enabled` boolean — Whether coupons are enabled for the order.
  - `applied_reward_points` integer — The applied reward points for the order that allowed you to receive a discount.
  - `coupons` Coupon[] — The list of coupons applied to the order.
    - `id` string, required — The unique ID of the coupon.
    - `code` string, required — The coupon code.
    - `name` string, required — The name of the coupon.
    - `type` 'bonus' | 'discount' | 'free_item' | 'vc' | 'non_benefit' | 'discount_fixed' | 'discount_reward_point', required — An enumeration.
    - `discount_percent` integer — Discount percent for `discount` coupons.
    - `bonus_percent` integer — Bonus percent for `bonus` coupons.
    - `bonus_fixed` integer — Fixed bonus quantity for `bonus` coupons.
  - `eligible_for_reward_points` integer — The number of reward points the player is eligible to receive for this order.
  - `eligible_for_loyalty_points` integer — The number of loyalty points the player is eligible to receive for this order.
  - `rewards` OrderRewards
    - `available` OrderVirtualCurrencyReward[], required
      - `type` 'virtual_currency'
      - `name` string
      - `virtual_currency_id` string, required
      - `amount` integer, required
      - `issue_status` 'issued' | 'revoked' | 'issue_failed' | 'revoke_failed' — An enumeration.
      - `icon_url` string
      - `sku` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/aghanim/apis/aghanim-server-to-server-api.md) · [All operations](https://skmtc.net/aghanim/apis/aghanim-server-to-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aghanim/aghanim-server-to-server-api/versions/0c1b4ac1865b/schema)
