> For the complete documentation index, see [llms.txt](https://docs.terragon.io/documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terragon.io/documents/terragon-api-document/withdraw.md).

# Withdraw

Player withdrawal operations

## List withdrawals

> Retrieve a list of player's withdrawal transactions

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Withdraw","description":"Player withdrawal operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PaginationMeta":{"type":"object","properties":{"current_page":{"type":"integer","description":"Current page number"},"last_page":{"type":"integer","description":"Last page number"},"per_page":{"type":"integer","description":"Number of items per page"},"total":{"type":"integer","description":"Total number of items"},"data":{"type":"array","description":"Collection of items for the current page","items":{"type":"object"}}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}}},"paths":{"/v1/withdraws":{"get":{"tags":["Withdraw"],"summary":"List withdrawals","description":"Retrieve a list of player's withdrawal transactions","operationId":"listWithdrawals","parameters":[{"name":"page","in":"query","required":false,"description":"Page number for pagination","schema":{"type":"integer","default":1}},{"name":"per_page","in":"query","required":false,"description":"Number of items per page","schema":{"type":"integer","default":10}},{"name":"status","in":"query","required":false,"description":"Filter by withdrawal status","schema":{"type":"string","enum":["pending","processing","completed","failed","cancelled"]}}],"responses":{"200":{"description":"Withdrawals retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginationMeta"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Create new withdrawal

> Initiate a new withdrawal transaction

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Withdraw","description":"Player withdrawal operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"WithdrawTransaction":{"type":"object","properties":{"id":{"type":"integer","description":"Withdrawal ID"},"player_id":{"type":"integer","description":"Player ID"},"payment_option_id":{"type":"integer","description":"ID of the payment option used"},"amount":{"type":"number","format":"float","description":"Withdrawal amount"},"currency_code":{"type":"string","description":"Currency code"},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled"],"description":"Withdrawal status"},"created_at":{"type":"string","format":"date-time","description":"Withdrawal creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Withdrawal last update timestamp"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}},"ValidationError":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Validation errors by field"}}}}},"paths":{"/v1/withdraws":{"post":{"tags":["Withdraw"],"summary":"Create new withdrawal","description":"Initiate a new withdrawal transaction","operationId":"createWithdrawal","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["payment_option_id","amount"],"properties":{"payment_option_id":{"type":"integer","description":"ID of the payment option to use"},"amount":{"type":"number","format":"float","description":"Withdrawal amount"},"currency_code":{"type":"string","description":"Currency code (if not using default)"},"bank_information":{"type":"object","description":"Bank account information for bank withdrawals"},"crypto_address":{"type":"string","description":"Crypto wallet address for crypto withdrawals"}}}}}},"responses":{"201":{"description":"Withdrawal initiated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawTransaction"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}}}}
```

## Get withdrawal details

> Retrieve details of a specific withdrawal

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Withdraw","description":"Player withdrawal operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"WithdrawTransaction":{"type":"object","properties":{"id":{"type":"integer","description":"Withdrawal ID"},"player_id":{"type":"integer","description":"Player ID"},"payment_option_id":{"type":"integer","description":"ID of the payment option used"},"amount":{"type":"number","format":"float","description":"Withdrawal amount"},"currency_code":{"type":"string","description":"Currency code"},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled"],"description":"Withdrawal status"},"created_at":{"type":"string","format":"date-time","description":"Withdrawal creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Withdrawal last update timestamp"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}}},"paths":{"/v1/withdraws/{id}":{"get":{"tags":["Withdraw"],"summary":"Get withdrawal details","description":"Retrieve details of a specific withdrawal","operationId":"getWithdrawalDetails","parameters":[{"name":"id","in":"path","required":true,"description":"Withdrawal ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"Withdrawal details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawTransaction"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Withdrawal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Cancel withdrawal

> Cancel a pending withdrawal

```json
{"openapi":"3.0.0","info":{"title":"Terragon API Document","version":"1.0.0"},"tags":[{"name":"Withdraw","description":"Player withdrawal operations"}],"servers":[{"url":"https://api.terragon.io/player/api","description":"Staging server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"WithdrawTransaction":{"type":"object","properties":{"id":{"type":"integer","description":"Withdrawal ID"},"player_id":{"type":"integer","description":"Player ID"},"payment_option_id":{"type":"integer","description":"ID of the payment option used"},"amount":{"type":"number","format":"float","description":"Withdrawal amount"},"currency_code":{"type":"string","description":"Currency code"},"status":{"type":"string","enum":["pending","processing","completed","failed","cancelled"],"description":"Withdrawal status"},"created_at":{"type":"string","format":"date-time","description":"Withdrawal creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Withdrawal last update timestamp"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}}}}},"paths":{"/v1/withdraws/{id}/cancel":{"put":{"tags":["Withdraw"],"summary":"Cancel withdrawal","description":"Cancel a pending withdrawal","operationId":"cancelWithdrawal","parameters":[{"name":"id","in":"path","required":true,"description":"Withdrawal ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"Withdrawal cancelled successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawTransaction"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Withdrawal not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unable to cancel withdrawal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
