perform-transaction¶
curl -X 'POST' 'https://{api-domain}/v1/wallet-proxy/v1/{playerId}/transactions'
-H 'Authorization: {auth-token}'
-H 'X-Brand: {brand}'
-H 'X-Operator-Id: {operator}'
Request parameters:
| Param | Param location | Type | Required | Description |
|---|---|---|---|---|
| playerId | Route | string | + | Id of player |
| X-Brand | Header | string | + | key for tenant identification, provided by GR8-Tech |
| X-Operator-Id | Header | string | + | key for tenant identification, provided by GR8-Tech |
| Authorization | Header | string | + | Authorization token "{authResponse.token_type} {authResponse.access_token}" |
Note
transactions in our system exist for 3 days. During this period we guarantee idempotency of the transactions. After expiration of its TTL transaction with the same Id will be performed again.
Warning
Max length for TransactionId is 50.
Request¶
Request schema
{
"type": "object",
"properties": {
"currency": {
"type": "string"
},
"platform": {
"type": "string"
},
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"deposit",
"withdrawal",
"rollback"
]
},
"initiatedAt": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"context": {
"type": "object",
"properties": {
"product": {
"type": "string"
},
"reason": {
"type": "string"
},
"betId": {
"type": "string"
},
"parentId": {
"type": "string"
}
},
"additionalProperties": true
},
"amountBreakdown": {
"type": "object",
"properties": {
"cash": {
"type": "string"
},
"bonus": {
"type": "string"
},
"locked": {
"type": "string"
},
"retract": {
"type": "string"
}
},
"additionalProperties": true
}
},
"additionalProperties": true,
"required": [
"currency",
"platform",
"id",
"amountBreakdown",
"initiatedAt",
"createdAt",
"context"
]
}
```
```json title="Request example"
{
"currency": "USD",
"platform": "sport",
"id": "f0fc7fd9d4ea4d1297a9a6a6fd1638ed",
"type": "deposit",
"initiatedAt": "2024-09-18T14:13:04.088527Z",
"createdAt": "2024-09-18T14:13:04.088527Z",
"amountBreakdown": {
"cash": "1000.10",
"bonus": "0",
"locked": "0",
"retract": "0"
},
"context": {
"product": "sportsbook",
"reason": "external transfer",
"correlationId": "2a2364a1db7947fe9c9a0e0fbb2064c4"
}
}
Success response¶
Success response schema (Status code: 200)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"currency": {
"type": "string"
},
"platform": {
"type": "string"
},
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"deposit",
"withdrawal",
"rollback"
]
},
"balances": {
"type": "object",
"patternProperties": {
"^.*$": { // platform - "sport"
"^.*$": { // product - "sportsbook"/"main"
"^.*$": { // currency
"type": "object",
"properties": {
"cash": {
"type": "string"
},
"bonus": {
"type": "string"
},
"locked": {
"type": "string"
}
},
"required": [
"cash",
"bonus",
"locked"
],
"additionalProperties": false
}
}
}
}
},
"alreadyProcessed": {
"type": "boolean"
},
"initiatedAt": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"context": {
"type": "object",
"properties": {
"product": {
"type": "string"
},
"reason": {
"type": "string"
}
},
"additionalProperties": true
},
"amountBreakdown": {
"type": "object",
"properties": {
"cash": {
"type": "string"
},
"bonus": {
"type": "string"
},
"locked": {
"type": "string"
}
},
"additionalProperties": false
}
},
"required": [
"currency",
"platform",
"id",
"type",
"balances",
"alreadyProcessed",
"initiatedAt",
"createdAt",
"context",
"amountBreakdown"
]
}
```
```json title="Response example"
{
"balances": {
"USD": {
"cash": "1000.0",
"bonus": "0",
"locked": "0"
}
},
"alreadyProcessed": false,
"currency": "USD",
"platform": "sport",
"id": "f0fc7fd9d4ea4d1297a9a6a6fd1638ed",
"type": "deposit",
"initiatedAt": "2024-09-18T14:13:04.088Z",
"createdAt": "2024-09-18T14:13:04.088Z",
"context": {
"product": "sportsbook",
"reason": "external transfer",
"correlationId": "2a2364a1db7947fe9c9a0e0fbb2064c4"
},
"amountBreakdown": {
"cash": "1000.0",
"bonus": "0.0",
"locked": "0.0",
"retract": "0.0"
}
}
Error response¶
Error response schema
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"origin": {
"type": "string"
}
},
"additionalProperties": true,
"required": [
"code",
"message",
"origin"
]
},
"additionalProperties": true,
"required": [
"error"
]
}
}
Error response example
{
"error": {
"code": "error.user.not-found",
"message": "User with specified Id was not found",
"origin": "{source-of-error}"
},
"alreadyProcessed": false
}
Error response description¶
| Parameter | Type | Required? | Description |
|---|---|---|---|
| body | object | + | Error response object |
| body.error | object | + | Error object description |
| body.error.code | string | + | Error code. Possible wallet error codes list |
| body.error.message | string | + | Error message |
| body.error.origin | string | - | Source of error. Is using for debugging and bugs investigation |