Skip to content

Latest commit

 

History

History
313 lines (227 loc) · 17.9 KB

File metadata and controls

313 lines (227 loc) · 17.9 KB

SpendData

(spendData)

Available Operations

getBankFees

Returns a list of bank fees

Example Usage

import { SpendeskPublicAPI } from "Spendesk-Public-API";
import { GetBankFeesSecurity } from "Spendesk-Public-API/dist/sdk/models/operations";

async function run() {
  const sdk = new SpendeskPublicAPI();
const operationSecurity: GetBankFeesSecurity = {
  authorizationCodeFlow: "<YOUR_AUTHORIZATION_CODE_FLOW_HERE>",
};

  const res = await sdk.spendData.getBankFees({
    settlementIds: [
      "<value>",
    ],
    sort: "+createdAt",
  }, operationSecurity);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetBankFeesRequest ✔️ The request object to use for the request.
security operations.GetBankFeesSecurity ✔️ The security requirements to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetBankFeesResponse>

Errors

Error Object Status Code Content Type
errors.ErrorT 400,401,403,404,429,500 application/json
errors.SDKError 4xx-5xx /

getPayableAttachments

Get attachments

Example Usage

import { SpendeskPublicAPI } from "Spendesk-Public-API";
import { GetPayableAttachmentsSecurity } from "Spendesk-Public-API/dist/sdk/models/operations";

async function run() {
  const sdk = new SpendeskPublicAPI();
const operationSecurity: GetPayableAttachmentsSecurity = {
  authorizationCodeFlow: "<YOUR_AUTHORIZATION_CODE_FLOW_HERE>",
};

  const res = await sdk.spendData.getPayableAttachments({
    payableId: "<value>",
  }, operationSecurity);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetPayableAttachmentsRequest ✔️ The request object to use for the request.
security operations.GetPayableAttachmentsSecurity ✔️ The security requirements to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetPayableAttachmentsResponse>

Errors

Error Object Status Code Content Type
errors.ErrorT 400,401,403,404,429,500 application/json
errors.SDKError 4xx-5xx /

getPayables

GET payables endpoint

Example Usage

import { SpendeskPublicAPI } from "Spendesk-Public-API";
import { BookkeepingStatus, GetPayablesSecurity } from "Spendesk-Public-API/dist/sdk/models/operations";

async function run() {
  const sdk = new SpendeskPublicAPI();
const operationSecurity: GetPayablesSecurity = {
  authorizationCodeFlow: "<YOUR_AUTHORIZATION_CODE_FLOW_HERE>",
};

  const res = await sdk.spendData.getPayables({
    bookkeepingStatus: [
      BookkeepingStatus.Exported,
    ],
    ids: [
      "<value>",
    ],
    sort: "-createdAt,+payableDate",
  }, operationSecurity);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetPayablesRequest ✔️ The request object to use for the request.
security operations.GetPayablesSecurity ✔️ The security requirements to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetPayablesResponse>

Errors

Error Object Status Code Content Type
errors.ErrorT 400,401,403,404,429,500 application/json
errors.SDKError 4xx-5xx /

getSettlements

Get settlements

Example Usage

import { SpendeskPublicAPI } from "Spendesk-Public-API";
import { GetSettlementsSecurity, PaidFrom, State } from "Spendesk-Public-API/dist/sdk/models/operations";

async function run() {
  const sdk = new SpendeskPublicAPI();
const operationSecurity: GetSettlementsSecurity = {
  authorizationCodeFlow: "<YOUR_AUTHORIZATION_CODE_FLOW_HERE>",
};

  const res = await sdk.spendData.getSettlements({
    ids: [
      "<value>",
    ],
    paidFrom: [
      PaidFrom.SpendeskAccount,
    ],
    sort: "+createdAt",
    state: [
      State.Exported,
    ],
  }, operationSecurity);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetSettlementsRequest ✔️ The request object to use for the request.
security operations.GetSettlementsSecurity ✔️ The security requirements to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetSettlementsResponse>

Errors

Error Object Status Code Content Type
errors.ErrorT 400,401,403,404,429,500 application/json
errors.SDKError 4xx-5xx /

getWalletLoads

Get wallet loads

Example Usage

import { SpendeskPublicAPI } from "Spendesk-Public-API";
import { GetWalletLoadsSecurity } from "Spendesk-Public-API/dist/sdk/models/operations";

async function run() {
  const sdk = new SpendeskPublicAPI();
const operationSecurity: GetWalletLoadsSecurity = {
  authorizationCodeFlow: "<YOUR_AUTHORIZATION_CODE_FLOW_HERE>",
};

  const res = await sdk.spendData.getWalletLoads({
    sort: "+createdAt",
  }, operationSecurity);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetWalletLoadsRequest ✔️ The request object to use for the request.
security operations.GetWalletLoadsSecurity ✔️ The security requirements to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetWalletLoadsResponse>

Errors

Error Object Status Code Content Type
errors.ErrorT 400,401,403,404,429,500 application/json
errors.SDKError 4xx-5xx /

getWalletSummary

Get wallet summary

Example Usage

import { SpendeskPublicAPI } from "Spendesk-Public-API";
import { GetWalletSummarySecurity } from "Spendesk-Public-API/dist/sdk/models/operations";

async function run() {
  const sdk = new SpendeskPublicAPI();
const operationSecurity: GetWalletSummarySecurity = {
  authorizationCodeFlow: "<YOUR_AUTHORIZATION_CODE_FLOW_HERE>",
};

  const res = await sdk.spendData.getWalletSummary({
    ids: [
      "<value>",
    ],
  }, operationSecurity);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetWalletSummaryRequest ✔️ The request object to use for the request.
security operations.GetWalletSummarySecurity ✔️ The security requirements to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetWalletSummaryResponse>

Errors

Error Object Status Code Content Type
errors.ErrorT 400,401,403,404,429,500 application/json
errors.SDKError 4xx-5xx /