> For the complete documentation index, see [llms.txt](https://docs.ggwp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ggwp.com/api-docs-contextual-information/player-spend.md).

# Player Spend

\[ Base URL: `api.ggwp.com`]

`POST` /users/v1/player-spend

## **Description**

Reports any real currency spent on in-game purchases by an individual player. This information is used to provide additional context in GGWP’s moderation workflow panel, so that community managers and moderation teams can make the best possible decisions when evaluating a player’s behavior.

## **Parameters**

`body`: Dictionary containing the following fields:

* **user\_id**: unique identifier of the player.
* **(OPTIONAL) platform:** where the purchase occurred (e.g., Xbox, PlayStation, Android, etc.)
* **currency**: type of currency used (eg: “USD”, “EUR”, “JPY”, “BTC”, etc.)
* **transaction\_amount**: numeric value of the completed transaction.
* **item\_category**: `game_purchase` / `battlepass` / `cosmetic`.
* **item\_id**: identifier for the type of item purchased.
* **(OPTIONAL)lifetime\_spend**: total cumulative value spent over the player’s lifetime.
* **(OPTIONAL) timestamp:** time when the transaction was executed in *YYYY-MM-DD HH:MM:SS* format, in UTC. If empty, then server side UTC timestamp is used in its place.
* Sample Call

  ```bash
  curl --request POST 'https://api.ggwp.com/users/v1/player-spend' \
  --header 'x-api-key: api_key' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "user_id": "<id1>",
    "platform": "android",
    "currency": "USD",
    "transaction_amount": 6.50,
    "item_category": "cosmetic",
    "item_id": "skin",
    "lifetime_spend": 124.75,
    "timestamp": "2022-01-25 09:44:00"
  }'
  ```

## **Output**

* 200 - successful operation

  ```json
  {
    "status": "success"
  }
  ```
* 400
  * Error response. The event has not been inserted into the system. This error is thrown in the following cases:
    * `Invalid Body. Expected JSON input`
      * Data payload is not JSON format
    * `Data payload too large`
      * Data payload exceeds 1MB in size
* 403
  * Invalid or missing API key.
* 500
  * Error response. The event has not been inserted into the system. There was some error on the server while processing the request.
