Skip to content

Latest commit

 

History

History
373 lines (259 loc) · 35.4 KB

File metadata and controls

373 lines (259 loc) · 35.4 KB

Reconciliation

(reconciliation)

Available Operations

createPolicy

Create a policy

Example Usage

import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
  authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
  const result = await sdk.reconciliation.createPolicy({
    ledgerName: "default",
    ledgerQuery: {
      "key": "<value>",
    },
    name: "XXX",
    paymentsPoolID: "XXX",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request shared.PolicyRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.CreatePolicyResponse>

Errors

Error Object Status Code Content Type
errors.ReconciliationErrorResponse default application/json
errors.SDKError 4xx-5xx /

deletePolicy

Delete a policy by its id.

Example Usage

import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
  authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
  const result = await sdk.reconciliation.deletePolicy({
    policyID: "XXX",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.DeletePolicyRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.DeletePolicyResponse>

Errors

Error Object Status Code Content Type
errors.ReconciliationErrorResponse default application/json
errors.SDKError 4xx-5xx /

getPolicy

Get a policy

Example Usage

import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
  authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
  const result = await sdk.reconciliation.getPolicy({
    policyID: "XXX",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetPolicyRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetPolicyResponse>

Errors

Error Object Status Code Content Type
errors.ReconciliationErrorResponse default application/json
errors.SDKError 4xx-5xx /

getReconciliation

Get a reconciliation

Example Usage

import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
  authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
  const result = await sdk.reconciliation.getReconciliation({
    reconciliationID: "XXX",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetReconciliationRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetReconciliationResponse>

Errors

Error Object Status Code Content Type
errors.ReconciliationErrorResponse default application/json
errors.SDKError 4xx-5xx /

listPolicies

List policies

Example Usage

import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
  authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
  const result = await sdk.reconciliation.listPolicies({
    cursor: "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
    pageSize: 100,
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ListPoliciesRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.ListPoliciesResponse>

Errors

Error Object Status Code Content Type
errors.ReconciliationErrorResponse default application/json
errors.SDKError 4xx-5xx /

listReconciliations

List reconciliations

Example Usage

import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
  authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
  const result = await sdk.reconciliation.listReconciliations({
    cursor: "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
    pageSize: 100,
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ListReconciliationsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.ListReconciliationsResponse>

Errors

Error Object Status Code Content Type
errors.ReconciliationErrorResponse default application/json
errors.SDKError 4xx-5xx /

reconcile

Reconcile using a policy

Example Usage

import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
  authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
  const result = await sdk.reconciliation.reconcile({
    reconciliationRequest: {
      reconciledAtLedger: new Date("2021-01-01T00:00:00.000Z"),
      reconciledAtPayments: new Date("2021-01-01T00:00:00.000Z"),
    },
    policyID: "XXX",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ReconcileRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.ReconcileResponse>

Errors

Error Object Status Code Content Type
errors.ReconciliationErrorResponse default application/json
errors.SDKError 4xx-5xx /

reconciliationgetServerInfo

Get server info

Example Usage

import { SDK } from "@formance/formance-sdk";

const sdk = new SDK({
  authorization: "<YOUR_AUTHORIZATION_HERE>",
});

async function run() {
  const result = await sdk.reconciliation.reconciliationgetServerInfo();

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.ReconciliationgetServerInfoResponse>

Errors

Error Object Status Code Content Type
errors.ReconciliationErrorResponse default application/json
errors.SDKError 4xx-5xx /