Create Funding Source
POSThttps://api.immersve.com/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
Bodyrequired
- oneOf
- Login Wallet
- Wallet Signature
- Custodial Cardholder
- Simulator
The ID of the account to add this Funding Source to.
65a7e8ef0d230d0a6bf755e07d39eb02
The id of the Funding Channel that this Funding Source relates to.
315bad4e81ce0f26966a41b9d451638b
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.
0x1234567890123456789012345678901234567890
The ID of the account to add this Funding Source to.
65a7e8ef0d230d0a6bf755e07d39eb02
The id of the Funding Channel that this Funding Source relates to.
315bad4e81ce0f26966a41b9d451638b
The address in the challenge message to claim as a Funding Source.
0x1234567890123456789012345678901234567890
Id of challenge returned by Create challenge endpoint
d0d8e6571eae4392f696f2399213e485
Signature generated by signing message from challenge returned by Create challenge endpoint
3.356988409151797e+156
The ID of the cardholder account to add this Funding Source to.
65a7e8ef0d230d0a6bf755e07d39eb02
The id of the Funding Channel that this Funding Source relates to.
315bad4e81ce0f26966a41b9d451638b
Custodian cardholder account reference. This identifier will be included in all payment notifications related to cards connected with this funding source.
1234567890
The ID of the account to add this Funding Source to.
65a7e8ef0d230d0a6bf755e07d39eb02
The id of the Funding Channel that this Funding Source relates to.
315bad4e81ce0f26966a41b9d451638b
Responses
- 200
- 400
- 403
Successful operation
- application/json
- Schema
- Example (auto)
Schema
Funding Source primary identifier.
91ad6fea3b52ca58d60d7fd310f789ec
Account this Funding Source belongs to.
057aa15913a57f50577234c8426534c0
Timestamp of Funding Source creation.
2022-11-16T03:13:18.142Z
Current balance of Funding Source in minor units.
1000000
Currency of the balance.
USDC
The ID of the Funding Channel that this Funding Source relates to.
315bad4e81ce0f26966a41b9d451638b
Funding address for on-chain Funding, or customer specified ID for off-chain Funding.
0x1aD2B053b8c6b1592cB645DEfadf105F34d8C6e1
The purpose of the Funding Channel.
card-funding
Network of Funding Source with on-chain Funding.
polygon-mainnet
{
"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 (auto)
Schema
400
Bad Request
INVALID_REQUEST_INPUT
errors object[]
{
"statusCode": 400,
"statusName": "Bad Request",
"errorCode": "INVALID_REQUEST_INPUT",
"errors": [
{
"message": "Invalid type",
"path": "items[1].attributes.invalidField"
}
]
}
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 (auto)
Schema
403
Forbidden
FORBIDDEN
Unauthorized
{
"statusCode": 403,
"statusName": "Forbidden",
"errorCode": "FORBIDDEN",
"reason": "Unauthorized"
}
Authorization: http
name: Access Tokentype: httpscheme: bearerbearerFormat: JWT
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.immersve.com/api/funding-sources");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"accountId\": \"65a7e8ef0d230d0a6bf755e07d39eb02\",\n \"fundingChannelId\": \"315bad4e81ce0f26966a41b9d451638b\",\n \"fundingAddress\": \"0x1234567890123456789012345678901234567890\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());