Create Funding Source
POST/api/funding-sources
Funding Sources define the mechanism for how card payments will be funded. A Funding Source's Funding Channel defines its purpose, protocol, and asset type as well as any other common parameters. Other parameters vary depending on the type of Funding Channel and also vary by the funding address validation mode if applicable.
Funding Sources with on-chain Funding will have a fundingAddress attribute. The address will vary depending on the protocol variant in use. For a universal protocol variant it will be the deposit sender address. For flexi protocol variants it will be the deposit recipient address. See Funding Protocols for more details about funding protocols.
The purpose of a Funding Source is inherited from its Funding Channel. If the Funding Source has a "billing" purpose, then it cannot be used to fund cards directly. Rather, it will be used to create a custodial Funding Channel.
Request Variants
Login Wallet Create a Funding Source using a funding address which is already connected with a verified login wallet for the owner account.
Wallet Signature Create a Funding Source using funding address which can be verified with a separate signing challenge. The Create challenge endpoint can be used to generate the signing challenge required to prove ownership of a web3 address.
Custodial Cardholder Create a Funding Source that uses the Custodial Funding Protocol. The external id parameter is required.
Simulator Create a Funding Source that uses the Simulator Funding Protocol. No additional parameters are required.
Request
- application/json
Body
required
- Login Wallet
- Wallet Signature
- Custodial Cardholder
- Simulator
oneOf
The ID of the account to add this Funding Source to.
The address to claim as a Funding Source. For universal protocol variants this would be the sender address for deposits. For flexi protocol variants this would be recipient address for deposits.
The id of the Funding Channel that this Funding Source relates to.
The ID of the account to add this Funding Source to.
The address in the challenge message to claim as a Funding Source.
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
The ID of the cardholder account to add this Funding Source to.
The id of the Funding Channel that this Funding Source relates to.
Custodian cardholder account reference. This identifier will be included in all payment notifications related to cards connected with this funding source.
The ID of the account to add this Funding Source to.
The id of the Funding Channel that this Funding Source relates to.
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.
Funding address for on-chain Funding, or customer specified ID for off-chain Funding.
The purpose of the Funding Channel.
Network of Funding Source with on-chain Funding.
{
"id": "91ad6fea3b52ca58d60d7fd310f789ec",
"accountId": "057aa15913a57f50577234c8426534c0",
"createdAt": "2022-11-16T03:13:18.142Z",
"balance": "1000000",
"balanceCurrency": "USDC",
"fundingChannelId": "315bad4e81ce0f26966a41b9d451638b",
"externalId": "0x1aD2B053b8c6b1592cB645DEfadf105F34d8C6e1",
"purpose": "card-funding",
"network": "polygon-mainnet"
}
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.
- application/json
- Schema
- Example (from schema)
Schema
{
"statusCode": 403,
"statusName": "Forbidden",
"errorCode": "FORBIDDEN",
"reason": "Unauthorized"
}