Create a funding source for an account
POST/api/funding-sources
This endpoint can be used to claim a web3 address as a source of funds. The funding address may be an EOA or a smart contract implementing the ERC-1271 interface. If the address is a smart contract, the ownerAddress
, message
, and signature
fields are required.
The Create challenge endpoint can be used to prove ownership of a web3 address by signing the returned message.
Request
- application/json
Body
required
- create-funding-source-eoa
- create-funding-source-erc-1271
- create-funding-source-challenge
oneOf
The ID of the cardholder account to add this Funding Source to.
The address to claim as a Funding Source. This can be a smart contract implementing ERC-1271 or an EOA address.
The id of the Funding Channel that this Funding Source relates to.
The ID of the cardholder account to add this Funding Source to.
The address to claim as a Funding Source. This can be a smart contract implementing ERC-1271 or an EOA address.
EOA address that matches a login wallet.
The id of the Funding Channel that this Funding Source relates to.
An EIP-4361 message which is signed by the ownerAddress. This is used to verify ownership of the owner address.
The signature of the message.
The ID of the cardholder account to add this Funding Source to.
The address to claim as a Funding Source. This can be a smart contract implementing ERC-1271 or an EOA address.
The id of the Funding Channel that this Funding Source relates to.
Id of challenge returned by Create challenge endpoint
Signature generated by signing message from challenge returned by Create challenge endpoint
Responses
- 200
- 400
- 403
Successful operation
- application/json
- Schema
- Example (from schema)
Schema
Funding Source primary identifier
Cardholder account this Funding Source belongs to
Timestamp of Funding Source creation
Current balance of Funding Source in minor units
Currency of the balance
The id of the Funding Channel that this Funding Source relates to.
{
"id": "91ad6fea3b52ca58d60d7fd310f789ec",
"accountId": "057aa15913a57f50577234c8426534c0",
"createdAt": "2022-11-16T03:13:18.142Z",
"balance": "1000000",
"balanceCurrency": "USDC",
"fundingChannelId": "315bad4e81ce0f26966a41b9d451638b"
}
Request fields are invalid
- application/json
- Schema
- Example (from schema)
Schema
{
"statusCode": 400,
"statusName": "Bad Request",
"errorCode": "BAD_REQUEST",
"errors": [
"Expected string, received number"
]
}
User is not allowed to perform the action with the reason stated in the errorCode
FORBIDDEN Insufficient permissions to perform the action.
SIGNATURE_DENIED
The signature was rejected by the ERC-1271 contract isValidSignature
function.
SIGNATURE_INVALID The message signature was invalid.
ADDRESS_MISMATCH
The ownerAddress
does not match the EIP-4361 message address.
- application/json
- Schema
- Example (from schema)
Schema
{
"statusCode": 403,
"statusName": "Forbidden",
"errorCode": "FORBIDDEN",
"reason": "Unauthorized"
}