Create Withdrawal Intent
POST/api/funding-sources/:fundingSourceId/withdraw
Create a Withdrawal Intent for a given Funding Source.
For more information on Withdrawal Intents see the Card Funding guide
Request
Path Parameters
ID for the Funding Source.
- application/json
Body
required
Withdrawal amount in minor units.
Responses
- 200
- 403
Successful operation
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
Withdrawal amount in minor units.
ID of the Withdrawal Intent.
Creation date of the Withdrawal Intent.
Expiration date of the Withdrawal Intent.
The wallet address to which the funds will be sent.
execution
object
The address of smart contract to invoke.
The contract function to call.
abi
object[]
The JSON ABI of the function being executed (contains only required details. more details here https://docs.soliditylang.org/en/v0.8.19/abi-spec.html#json)
Possible values: [withdraw
]
The name of the function
Possible values: [function
]
params
object
Withdrawal amount in minor units.
The unix timestamp when the signature expires.
Unique identifier of current Withdrawal Intent.
The signed withdrawal approval.
{
"amount": 300000000,
"id": "91ad6fea3b52ca58d60d7fd310f789ec",
"createdAt": "2023-08-14T12:32:54",
"expiresAt": "2023-08-14T12:32:54",
"walletAddress": "0xA3058369d6A481B1ff08F62B352409c3D709De9b",
"execution": {
"contractAddress": "0xEe076427B04DDD26729889C869d3aE524A6362fD",
"method": "withdraw",
"abi": [
{
"name": "withdraw",
"type": "function",
"input": [],
"output": []
}
],
"params": {
"amount": 300000000,
"expiryDate": 12345,
"nonce": 1,
"signature": "0x30450221..."
}
}
}
FORBIDDEN Insufficient permissions to perform the action.
INSUFFICIENT_BALANCE Withdrawal amount exceeds funding source balance.
TOO_MANY_PENDING_WITHDRAWALS Maximum amount of intents exceeded (10).
FUNDING_STRATEGY_NOT_SUPPORTED Funding strategy is not supported.
- application/json
- Schema
- Example (from schema)
Schema
{
"statusCode": 403,
"statusName": "Forbidden",
"errorCode": "FORBIDDEN",
"reason": "Unauthorized"
}