(Wallets.V1)
- WalletsgetServerInfo - Get server info
- GetTransactions
- ListWallets - List all wallets
- CreateWallet - Create a new wallet
- GetWallet - Get a wallet
- UpdateWallet - Update a wallet
- GetWalletSummary - Get wallet summary
- ListBalances - List balances of a wallet
- CreateBalance - Create a balance
- GetBalance - Get detailed balance
- DebitWallet - Debit a wallet
- CreditWallet - Credit a wallet
- GetHolds - Get all holds for a wallet
- GetHold - Get a hold
- ConfirmHold - Confirm a hold
- VoidHold - Cancel a hold
Get server info
using formance;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.WalletsgetServerInfoAsync();
// handle response
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
using formance;
using formance.Models.Requests;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.GetTransactionsAsync(
pageSize: 100,
walletID: "wallet1",
cursor: "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="
);
// handle response
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PageSize |
long | ➖ | The maximum number of results to return per page | 100 |
WalletID |
string | ➖ | A wallet ID to filter on | wallet1 |
Cursor |
string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when the cursor is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
Models.Requests.GetTransactionsResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
List all wallets
using formance;
using formance.Models.Requests;
using System.Collections.Generic;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
ListWalletsRequest req = new ListWalletsRequest() {
Name = "wallet1",
Metadata = new Dictionary<string, string>() {
{ "admin", "true" },
},
PageSize = 100,
Cursor = "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
Expand = "balances",
};
var res = await sdk.Wallets.V1.ListWalletsAsync(req);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
request |
ListWalletsRequest | ✔️ | The request object to use for the request. |
Models.Requests.ListWalletsResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Create a new wallet
using formance;
using formance.Models.Requests;
using formance.Models.Components;
using System.Collections.Generic;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.CreateWalletAsync(
idempotencyKey: "<value>",
createWalletRequest: new Models.Components.CreateWalletRequest() {
Metadata = new Dictionary<string, string>() {
{ "key", "<value>" },
},
Name = "<value>",
}
);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
IdempotencyKey |
string | ➖ | Use an idempotency key |
CreateWalletRequest |
Models.Components.CreateWalletRequest | ➖ | N/A |
Models.Requests.CreateWalletResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Get a wallet
using formance;
using formance.Models.Requests;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.GetWalletAsync(id: "<id>");
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
Id |
string | ✔️ | N/A |
Models.Requests.GetWalletResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Update a wallet
using formance;
using formance.Models.Requests;
using System.Collections.Generic;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.UpdateWalletAsync(
id: "<id>",
idempotencyKey: "<value>",
requestBody: new UpdateWalletRequestBody() {
Metadata = new Dictionary<string, string>() {
{ "key", "<value>" },
},
}
);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
Id |
string | ✔️ | N/A |
IdempotencyKey |
string | ➖ | Use an idempotency key |
RequestBody |
UpdateWalletRequestBody | ➖ | N/A |
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Get wallet summary
using formance;
using formance.Models.Requests;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.GetWalletSummaryAsync(id: "<id>");
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
Id |
string | ✔️ | N/A |
Models.Requests.GetWalletSummaryResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
List balances of a wallet
using formance;
using formance.Models.Requests;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.ListBalancesAsync(id: "<id>");
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
Id |
string | ✔️ | N/A |
Models.Requests.ListBalancesResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Create a balance
using formance;
using formance.Models.Requests;
using formance.Models.Components;
using System.Numerics;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.CreateBalanceAsync(
id: "<id>",
idempotencyKey: "<value>",
createBalanceRequest: new Models.Components.CreateBalanceRequest() {
Name = "<value>",
}
);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
Id |
string | ✔️ | N/A |
IdempotencyKey |
string | ➖ | Use an idempotency key |
CreateBalanceRequest |
Models.Components.CreateBalanceRequest | ➖ | N/A |
Models.Requests.CreateBalanceResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Get detailed balance
using formance;
using formance.Models.Requests;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.GetBalanceAsync(
id: "<id>",
balanceName: "<value>"
);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
Id |
string | ✔️ | N/A |
BalanceName |
string | ✔️ | N/A |
Models.Requests.GetBalanceResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Debit a wallet
using formance;
using formance.Models.Requests;
using formance.Models.Components;
using System.Numerics;
using System.Collections.Generic;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.DebitWalletAsync(
id: "<id>",
idempotencyKey: "<value>",
debitWalletRequest: new Models.Components.DebitWalletRequest() {
Amount = new Monetary() {
Asset = "USD/2",
Amount = 100,
},
Pending = true,
Metadata = new Dictionary<string, string>() {
{ "key", "" },
},
}
);
// handle response
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Id |
string | ✔️ | N/A | |
IdempotencyKey |
string | ➖ | Use an idempotency key | |
DebitWalletRequest |
Models.Components.DebitWalletRequest | ➖ | N/A | { "amount": { "asset": "USD/2", "amount": 100 }, "metadata": { "key": "" }, "pending": true } |
Models.Requests.DebitWalletResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Credit a wallet
using formance;
using formance.Models.Requests;
using formance.Models.Components;
using System.Numerics;
using System.Collections.Generic;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.CreditWalletAsync(
id: "<id>",
idempotencyKey: "<value>",
creditWalletRequest: new Models.Components.CreditWalletRequest() {
Amount = new Monetary() {
Asset = "USD/2",
Amount = 100,
},
Metadata = new Dictionary<string, string>() {
{ "key", "" },
},
Sources = new List<Subject>() {
Subject.CreateLedgerAccountSubject(
new LedgerAccountSubject() {
Type = "<value>",
Identifier = "<value>",
}
),
},
}
);
// handle response
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Id |
string | ✔️ | N/A | |
IdempotencyKey |
string | ➖ | Use an idempotency key | |
CreditWalletRequest |
Models.Components.CreditWalletRequest | ➖ | N/A | { "amount": { "asset": "USD/2", "amount": 100 }, "metadata": { "key": "" }, "sources": [] } |
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Get all holds for a wallet
using formance;
using formance.Models.Requests;
using System.Collections.Generic;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.GetHoldsAsync(
pageSize: 100,
walletID: "wallet1",
metadata: new Dictionary<string, string>() {
{ "admin", "true" },
},
cursor: "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="
);
// handle response
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PageSize |
long | ➖ | The maximum number of results to return per page | 100 |
WalletID |
string | ➖ | The wallet to filter on | wallet1 |
Metadata |
Dictionary<String, string> | ➖ | Filter holds by metadata key value pairs. Nested objects can be used as seen in the example below. | { "admin": "true" } |
Cursor |
string | ➖ | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when the pagination token is set. |
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== |
Models.Requests.GetHoldsResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Get a hold
using formance;
using formance.Models.Requests;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.GetHoldAsync(holdID: "<id>");
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
HoldID |
string | ✔️ | The hold ID |
Models.Requests.GetHoldResponse
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Confirm a hold
using formance;
using formance.Models.Requests;
using formance.Models.Components;
using System.Numerics;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.ConfirmHoldAsync(
holdId: "<id>",
idempotencyKey: "<value>",
confirmHoldRequest: new Models.Components.ConfirmHoldRequest() {
Amount = 100,
Final = true,
}
);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
HoldId |
string | ✔️ | N/A |
IdempotencyKey |
string | ➖ | Use an idempotency key |
ConfirmHoldRequest |
Models.Components.ConfirmHoldRequest | ➖ | N/A |
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |
Cancel a hold
using formance;
using formance.Models.Requests;
using formance.Models.Components;
var sdk = new Formance(security: new Security() {
ClientID = "<YOUR_CLIENT_ID_HERE>",
ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});
var res = await sdk.Wallets.V1.VoidHoldAsync(
holdId: "<id>",
idempotencyKey: "<value>"
);
// handle response
Parameter | Type | Required | Description |
---|---|---|---|
HoldId |
string | ✔️ | N/A |
IdempotencyKey |
string | ➖ | Use an idempotency key |
Error Type | Status Code | Content Type |
---|---|---|
formance.Models.Errors.WalletsErrorResponse | default | application/json |
formance.Models.Errors.SDKException | 4XX, 5XX | */* |