Search…
Withdrawals
The following endpoints are used to insert and retrieve entries representing withdrawals from the database.
WITHDRAWALS ENDPOINTS
1
POST /withdrawals
2
POST /withdrawals/:id/submit
3
GET /withdrawals/:id
4
GET /withdrawals
Copied!

The withdrawal object

The withdrawal object represents a request for withdrawing fiat from the blockchain. You can create or retrieve an identityId's withdrawals via request to the API. Or, if you manage multiple identities in the network, you can also retrieve a list of withdrawals for all of them.
Withdrawals are identified by a unique, random id, and relate to a user's identityId.
WITHDRAWAL OBJECT
1
{
2
"id": "2642dedd-4fa0-40bf-8b15-7c0513bcdb38",
3
"identityId": "e65dde2c-4379-42c7-a665-3f476cebb691",
4
"transactionReference": "0xf6cce2d20d2714fa7be8e1bb8b8cf0abbb12ca3d34d000073742a4da954c1be5",
5
"blockchainAddress": "0x8ba13aB181E9F30e543C6376Cd408192E95bCD1C",
6
"amount": null,
7
"currency": "USD",
8
"transactionHash": null,
9
"transferInformation": {
10
"transferType": "wire",
11
"bankAccountName": "Jonh do bank",
12
"bankAccountNumber": "1321312312321312",
13
"routingNumber": "123456789"
14
},
15
"status": "prepared",
16
"createdAt": "2020-02-19T11:43:04.553Z",
17
"updatedAt": "2020-02-19T11:43:04.553Z"
18
}
Copied!
post
[ENVIRONMENT HOSTNAME]
/withdrawals
POST /withdrawals

Example Call

Request
Curl
Response
1
POST [ENVIRONMENT HOSTNAME]/withdrawals
2
3
{
4
"blockchainAddress": "0x8ba13aB181E9F30e543C6376Cd408192E95bCD1C",
5
"currency": "USD",
6
"identityId": "e65dde2c-4379-42c7-a665-3f476cebb691",
7
"transferInformation": {
8
"transferType": "wire",
9
"bankAccountName": "Jonh do bank",
10
"bankAccountNumber": "1321312312321312",
11
"routingNumber": "123456789"
12
}
13
}
Copied!
1
curl -X POST \
2
[ENVIRONMENT HOSTNAME]/withdrawals \
3
-H 'Content-Type: application/json' \
4
-H 'apikey: {INSERT API KEY HERE}' \
5
-d '{
6
"blockchainAddress": "0x8ba13aB181E9F30e543C6376Cd408192E95bCD1C",
7
"currency": "USD",
8
"identityId": "e65dde2c-4379-42c7-a665-3f476cebb691",
9
"transferInformation": {
10
"transferType": "wire",
11
"bankAccountName": "Jonh do bank",
12
"bankAccountNumber": "1321312312321312",
13
"routingNumber": "123456789"
14
}
15
}'
Copied!
1
{
2
"id": "2642dedd-4fa0-40bf-8b15-7c0513bcdb38",
3
"identityId": "e65dde2c-4379-42c7-a665-3f476cebb691",
4
"transactionReference": "0xf6cce2d20d2714fa7be8e1bb8b8cf0abbb12ca3d34d000073742a4da954c1be5",
5
"blockchainAddress": "0x8ba13aB181E9F30e543C6376Cd408192E95bCD1C",
6
"amount": null,
7
"currency": "USD",
8
"transactionHash": null,
9
"transferInformation": {
10
"transferType": "wire",
11
"bankAccountName": "Jonh do bank",
12
"bankAccountNumber": "1321312312321312",
13
"routingNumber": "123456789"
14
},
15
"status": "prepared",
16
"createdAt": "2020-02-19T11:43:04.553Z",
17
"updatedAt": "2020-02-19T11:43:04.553Z"
18
}
Copied!
On the Sandbox environment, you can use the settle withdrawal endpoint to simulate and settle the withdrawal request you created.
post
[ENVIRONMENT HOSTNAME]
/withdrawals/:id/submit
POST /withdrawals/:id/submit

Example Call

Request
Curl
Response
1
POST [ENVIRONMENT HOSTNAME]/withdrawals/37e2b53c-f938-4dce-90ef-7614f7e338f5/submit
Copied!
1
curl --location --request POST 'localhost:3000/withdrawals/37e2b53c-f938-4dce-90ef-7614f7e338f5/submit' \
2
--header 'Content-Type: application/json' \
3
--header 'apikey: {{INSERT YOUR API KEY HERE}}' \
4
--data-raw '{
5
"transactionHash": "0xfa7102053dceb6cdc59b1580706a9fec7b14333d30d041ad4f03b0d8359f63c8"
6
}'
Copied!
1
{
2
"id": "37e2b53c-f938-4dce-90ef-7614f7e338f5",
3
"identityId": "80d82e03-527e-46ff-b5a2-6e5d7d34115c",
4
"transferType": "wire",
5
"transactionReference": "0x8722597478bb2ab2964576b9509941269642c2d960ac7bc452cd8cd5f9e64f2e",
6
"blockchainAddress": "0x8ba13aB181E9F30e543C6376Cd408192E95bCD1C",
7
"amount": "10",
8
"currency": "USD",
9
"transactionHash": "0xfa7102053dceb6cdc59b1580706a9fec7b14333d30d041ad4f03b0d8359f63c8",
10
"transferMethodId": null,
11
"status": "submitted",
12
"createdAt": "2020-02-19T17:20:35.948Z",
13
"updatedAt": "2020-02-19T17:23:21.068Z"
14
}
Copied!
On the Sandbox environment, you can use the settle withdrawal endpoint to simulate and settle the withdrawal request you created.
get
[ENVIRONMENT HOSTNAME]
/withdrawals/:id
GET /withdrawals/:id

Example Call

Request
Curl
Response
1
GET [ENVIRONMENT HOSTNAME]/withdrawals/6f0c5931-326d-431a-87b8-5368dcdf6d61
Copied!
1
curl -X GET \
2
[ENVIRONMENT HOSTNAME]/withdrawals/6f0c5931-326d-431a-87b8-5368dcdf6d61 \
3
-H 'apikey: {INSERT API KEY HERE}'
4
Copied!
1
{
2
"id": "6f0c5931-326d-431a-87b8-5368dcdf6d61",
3
"identityId": "28961623-68b4-4fe3-bb16-9636eac5aab2",
4
"transferInformation": {
5
"transferType": "wire",
6
"bankAccountName": "Jonh do bank",
7
"bankAccountNumber": "1321312312321312",
8
"routingNumber": "123456789"
9
},
10
"transactionReference": "0xd570c59208bd0cd8b5f29d7df86015aa31e0c978e38b6695cf309e0bd77e2764",
11
"blockchainAddress": "0x8ba13aB181E9F30e543C6376Cd408192E95bCD1C",
12
"amount": null,
13
"currency": "USD",
14
"transactionHash": null,
15
"status": "prepared",
16
"createdAt": "2020-02-18T14:41:01.757Z",
17
"updatedAt": "2020-02-18T14:41:01.757Z"
18
}
Copied!
get
[ENVIRONMENT HOSTNAME]
/withdrawals/
GET /withdrawals

Example call

Request
Curl
Response
1
GET [ENVIRONMENT HOSTNAME]/withdrawals
2
3
// PAGINATED
4
5
GET [ENVIRONMENT HOSTNAME]/withdrawals?page[number]=1&page[size]=1
Copied!
1
curl -X GET \
2
[ENVIRONMENT HOSTNAME]/withdrawals \
3
-H 'apikey: {INSERT API KEY HERE}'
Copied!
1
{
2
"total": 1,
3
"data": [
4
{
5
"id": "6f0c5931-326d-431a-87b8-5368dcdf6d61",
6
"identityId": "28961623-68b4-4fe3-bb16-9636eac5aab2",
7
"transferInformation": {
8
"transferType": "wire",
9
"bankAccountName": "Jonh do bank",
10
"bankAccountNumber": "1321312312321312",
11
"routingNumber": "123456789"
12
},
13
"transactionReference": "0xd570c59208bd0cd8b5f29d7df86015aa31e0c978e38b6695cf309e0bd77e2764",
14
"blockchainAddress": "0x8ba13aB181E9F30e543C6376Cd408192E95bCD1C",
15
"amount": null,
16
"currency": "USD",
17
"transactionHash": null,
18
"status": "prepared",
19
"createdAt": "2020-02-18T14:41:01.757Z",
20
"updatedAt": "2020-02-18T14:41:01.757Z"
21
}
22
]
23
}
Copied!