Skip to content

Latest commit

 

History

History
1233 lines (888 loc) · 70.8 KB

README.md

File metadata and controls

1233 lines (888 loc) · 70.8 KB

V2

(Ledger.V2)

Overview

Available Operations

GetInfo

Show server information

Example Usage

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.Ledger.V2.GetInfoAsync();

// handle response

Response

V2GetInfoResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

ListLedgers

List ledgers

Example Usage

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.Ledger.V2.ListLedgersAsync(
    pageSize: 100,
    cursor: "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="
);

// handle response

Parameters

Parameter Type Required Description Example
PageSize long The maximum number of results to return per page.
100
Cursor string Parameter used in pagination requests. Maximum page size is set to 15.
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 this parameter is set.
aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==

Response

V2ListLedgersResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

GetLedger

Get a ledger

Example Usage

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.Ledger.V2.GetLedgerAsync(ledger: "ledger001");

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001

Response

Models.Requests.V2GetLedgerResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

CreateLedger

Create a ledger

Example Usage

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.Ledger.V2.CreateLedgerAsync(
    ledger: "ledger001",
    v2CreateLedgerRequest: new Models.Components.V2CreateLedgerRequest() {
        Metadata = new Dictionary<string, string>() {
            { "admin", "true" },
        },
    }
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
V2CreateLedgerRequest Models.Components.V2CreateLedgerRequest N/A

Response

V2CreateLedgerResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

UpdateLedgerMetadata

Update ledger metadata

Example Usage

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.Ledger.V2.UpdateLedgerMetadataAsync(
    ledger: "ledger001",
    requestBody: new Dictionary<string, string>() {
        { "admin", "true" },
    }
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
RequestBody Dictionary<String, string> N/A {
"admin": "true"
}

Response

V2UpdateLedgerMetadataResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

DeleteLedgerMetadata

Delete ledger metadata by key

Example Usage

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.Ledger.V2.DeleteLedgerMetadataAsync(
    ledger: "ledger001",
    key: "foo"
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
Key string ✔️ Key to remove. foo

Response

V2DeleteLedgerMetadataResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

GetLedgerInfo

Get information about a ledger

Example Usage

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.Ledger.V2.GetLedgerInfoAsync(ledger: "ledger001");

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001

Response

V2GetLedgerInfoResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

CreateBulk

Bulk request

Example Usage

using formance;
using formance.Models.Requests;
using System.Collections.Generic;
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.Ledger.V2.CreateBulkAsync(
    ledger: "ledger001",
    requestBody: new List<V2BulkElement>() {
        V2BulkElement.CreateV2BulkElementCreateTransaction(
            new V2BulkElementCreateTransaction() {
                Action = "<value>",
                Data = new V2PostTransaction() {
                    Postings = new List<V2Posting>() {
                        new V2Posting() {
                            Amount = 100,
                            Asset = "COIN",
                            Destination = "users:002",
                            Source = "users:001",
                        },
                    },
                    Script = new V2PostTransactionScript() {
                        Plain = "vars {
                        account $user
                        }
                        send [COIN 10] (
                        	source = @world
                        	destination = $user
                        )
                        ",
                        Vars = new Dictionary<string, object>() {
                            { "user", "users:042" },
                        },
                    },
                    Reference = "ref:001",
                    Metadata = new Dictionary<string, string>() {
                        { "admin", "true" },
                    },
                },
            }
        ),
    }
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
RequestBody List<V2BulkElement> N/A

Response

V2CreateBulkResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

CountAccounts

Count the accounts from a ledger

Example Usage

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.Ledger.V2.CountAccountsAsync(
    ledger: "ledger001",
    pit: System.DateTime.Parse("2022-10-10T12:32:37.688Z"),
    requestBody: new Dictionary<string, object>() {
        { "key", "<value>" },
    }
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
Pit DateTime N/A
RequestBody Dictionary<String, object> N/A

Response

V2CountAccountsResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

ListAccounts

List accounts from a ledger, sorted by address in descending order.

Example Usage

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>",
});

V2ListAccountsRequest req = new V2ListAccountsRequest() {
    Ledger = "ledger001",
    PageSize = 100,
    Cursor = "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
};

var res = await sdk.Ledger.V2.ListAccountsAsync(req);

// handle response

Parameters

Parameter Type Required Description
request V2ListAccountsRequest ✔️ The request object to use for the request.

Response

V2ListAccountsResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

GetAccount

Get account by its address

Example Usage

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.Ledger.V2.GetAccountAsync(
    ledger: "ledger001",
    address: "users:001",
    expand: "<value>",
    pit: System.DateTime.Parse("2022-06-03T07:35:25.500Z")
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
Address string ✔️ Exact address of the account. It must match the following regular expressions pattern:
<br/>^\w+(:\w+)*$<br/>
users:001
Expand string N/A
Pit DateTime N/A

Response

V2GetAccountResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

AddMetadataToAccount

Add metadata to an account

Example Usage

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>",
});

V2AddMetadataToAccountRequest req = new V2AddMetadataToAccountRequest() {
    Ledger = "ledger001",
    Address = "users:001",
    DryRun = true,
    RequestBody = new Dictionary<string, string>() {
        { "admin", "true" },
    },
};

var res = await sdk.Ledger.V2.AddMetadataToAccountAsync(req);

// handle response

Parameters

Parameter Type Required Description
request V2AddMetadataToAccountRequest ✔️ The request object to use for the request.

Response

V2AddMetadataToAccountResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

DeleteAccountMetadata

Delete metadata by key

Example Usage

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.Ledger.V2.DeleteAccountMetadataAsync(
    ledger: "ledger001",
    address: "96609 Cummings Canyon",
    key: "foo"
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
Address string ✔️ Account address
Key string ✔️ The key to remove. foo

Response

V2DeleteAccountMetadataResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

ReadStats

Get statistics from a ledger. (aggregate metrics on accounts and transactions)

Example Usage

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.Ledger.V2.ReadStatsAsync(ledger: "ledger001");

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ name of the ledger ledger001

Response

V2ReadStatsResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

CountTransactions

Count the transactions from a ledger

Example Usage

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.Ledger.V2.CountTransactionsAsync(
    ledger: "ledger001",
    pit: System.DateTime.Parse("2023-09-24T09:44:43.699Z"),
    requestBody: new Dictionary<string, object>() {
        { "key", "<value>" },
    }
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
Pit DateTime N/A
RequestBody Dictionary<String, object> N/A

Response

V2CountTransactionsResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

ListTransactions

List transactions from a ledger, sorted by id in descending order.

Example Usage

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>",
});

V2ListTransactionsRequest req = new V2ListTransactionsRequest() {
    Ledger = "ledger001",
    PageSize = 100,
    Cursor = "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
};

var res = await sdk.Ledger.V2.ListTransactionsAsync(req);

// handle response

Parameters

Parameter Type Required Description
request V2ListTransactionsRequest ✔️ The request object to use for the request.

Response

V2ListTransactionsResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

CreateTransaction

Create a new transaction to a ledger

Example Usage

using formance;
using formance.Models.Requests;
using formance.Models.Components;
using System.Collections.Generic;
using System.Numerics;

var sdk = new Formance(security: new Security() {
    ClientID = "<YOUR_CLIENT_ID_HERE>",
    ClientSecret = "<YOUR_CLIENT_SECRET_HERE>",
});

var res = await sdk.Ledger.V2.CreateTransactionAsync(
    ledger: "ledger001",
    v2PostTransaction: new V2PostTransaction() {
        Postings = new List<V2Posting>() {
            new V2Posting() {
                Amount = 100,
                Asset = "COIN",
                Destination = "users:002",
                Source = "users:001",
            },
        },
        Script = new V2PostTransactionScript() {
            Plain = "vars {
            account $user
            }
            send [COIN 10] (
            	source = @world
            	destination = $user
            )
            ",
            Vars = new Dictionary<string, object>() {
                { "user", "users:042" },
            },
        },
        Reference = "ref:001",
        Metadata = new Dictionary<string, string>() {
            { "admin", "true" },
        },
    },
    dryRun: true,
    idempotencyKey: "<value>"
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
V2PostTransaction V2PostTransaction ✔️ The request body must contain at least one of the following objects:
- postings: suitable for simple transactions
- script: enabling more complex transactions with Numscript
DryRun bool Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker. true
IdempotencyKey string Use an idempotency key

Response

Models.Requests.V2CreateTransactionResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

GetTransaction

Get transaction from a ledger by its ID

Example Usage

using formance;
using formance.Models.Requests;
using System.Numerics;
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.Ledger.V2.GetTransactionAsync(
    ledger: "ledger001",
    id: 1234,
    expand: "<value>",
    pit: System.DateTime.Parse("2023-08-22T15:58:06.771Z")
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
Id BigInteger ✔️ Transaction ID. 1234
Expand string N/A
Pit DateTime N/A

Response

Models.Requests.V2GetTransactionResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

AddMetadataOnTransaction

Set the metadata of a transaction by its ID

Example Usage

using formance;
using formance.Models.Requests;
using System.Numerics;
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>",
});

V2AddMetadataOnTransactionRequest req = new V2AddMetadataOnTransactionRequest() {
    Ledger = "ledger001",
    Id = 1234,
    DryRun = true,
    RequestBody = new Dictionary<string, string>() {
        { "admin", "true" },
    },
};

var res = await sdk.Ledger.V2.AddMetadataOnTransactionAsync(req);

// handle response

Parameters

Parameter Type Required Description
request V2AddMetadataOnTransactionRequest ✔️ The request object to use for the request.

Response

V2AddMetadataOnTransactionResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

DeleteTransactionMetadata

Delete metadata by key

Example Usage

using formance;
using formance.Models.Requests;
using System.Numerics;
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.Ledger.V2.DeleteTransactionMetadataAsync(
    ledger: "ledger001",
    id: 1234,
    key: "foo"
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
Id BigInteger ✔️ Transaction ID. 1234
Key string ✔️ The key to remove. foo

Response

V2DeleteTransactionMetadataResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

RevertTransaction

Revert a ledger transaction by its ID

Example Usage

using formance;
using formance.Models.Requests;
using System.Numerics;
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.Ledger.V2.RevertTransactionAsync(
    ledger: "ledger001",
    id: 1234,
    force: false,
    atEffectiveDate: false
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
Id BigInteger ✔️ Transaction ID. 1234
Force bool Force revert
AtEffectiveDate bool Revert transaction at effective date of the original tx

Response

Models.Requests.V2RevertTransactionResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

GetBalancesAggregated

Get the aggregated balances from selected accounts

Example Usage

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.Ledger.V2.GetBalancesAggregatedAsync(
    ledger: "ledger001",
    pit: System.DateTime.Parse("2023-02-24T06:23:10.848Z"),
    useInsertionDate: false,
    requestBody: new Dictionary<string, object>() {
        { "key", "<value>" },
    }
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
Pit DateTime N/A
UseInsertionDate bool Use insertion date instead of effective date
RequestBody Dictionary<String, object> N/A

Response

V2GetBalancesAggregatedResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

GetVolumesWithBalances

Get list of volumes with balances for (account/asset)

Example Usage

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>",
});

V2GetVolumesWithBalancesRequest req = new V2GetVolumesWithBalancesRequest() {
    PageSize = 100,
    Cursor = "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
    Ledger = "ledger001",
    GroupBy = 3,
};

var res = await sdk.Ledger.V2.GetVolumesWithBalancesAsync(req);

// handle response

Parameters

Parameter Type Required Description
request V2GetVolumesWithBalancesRequest ✔️ The request object to use for the request.

Response

V2GetVolumesWithBalancesResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

ListLogs

List the logs from a ledger, sorted by ID in descending order.

Example Usage

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>",
});

V2ListLogsRequest req = new V2ListLogsRequest() {
    Ledger = "ledger001",
    PageSize = 100,
    Cursor = "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
};

var res = await sdk.Ledger.V2.ListLogsAsync(req);

// handle response

Parameters

Parameter Type Required Description
request V2ListLogsRequest ✔️ The request object to use for the request.

Response

V2ListLogsResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

ImportLogs

Example Usage

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.Ledger.V2.ImportLogsAsync(
    ledger: "ledger001",
    requestBody: "<value>"
);

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001
RequestBody string N/A

Response

V2ImportLogsResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.V2ErrorResponse default application/json
formance.Models.Errors.SDKException 4XX, 5XX */*

ExportLogs

Export logs

Example Usage

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.Ledger.V2.ExportLogsAsync(ledger: "ledger001");

// handle response

Parameters

Parameter Type Required Description Example
Ledger string ✔️ Name of the ledger. ledger001

Response

V2ExportLogsResponse

Errors

Error Type Status Code Content Type
formance.Models.Errors.SDKException 4XX, 5XX */*