Skip to content

Latest commit

 

History

History
577 lines (424 loc) · 37.5 KB

README.md

File metadata and controls

577 lines (424 loc) · 37.5 KB

Sweeps

(sweeps)

Overview

Available Operations

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.write scope.

  • listConfigs - List sweep configs associated with an account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

  • getConfig - Get a sweep config associated with a wallet.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.write scope.

  • list - List sweeps associated with a wallet.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

  • get - Get details on a specific sweep.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

createConfig

Create a sweep config for a wallet.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.write scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.sweeps.createConfig({
    accountID: "2c0dfb65-d7ef-4c8e-8c74-e6c7773550bc",
    createSweepConfig: {
      walletID: "01234567-89ab-cdef-0123-456789abcdef",
      status: "enabled",
      pushPaymentMethodID: "01234567-89ab-cdef-0123-456789abcdef",
      pullPaymentMethodID: "01234567-89ab-cdef-0123-456789abcdef",
    },
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { sweepsCreateConfig } from "@moovio/sdk/funcs/sweepsCreateConfig.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await sweepsCreateConfig(moov, {
    accountID: "2c0dfb65-d7ef-4c8e-8c74-e6c7773550bc",
    createSweepConfig: {
      walletID: "01234567-89ab-cdef-0123-456789abcdef",
      status: "enabled",
      pushPaymentMethodID: "01234567-89ab-cdef-0123-456789abcdef",
      pullPaymentMethodID: "01234567-89ab-cdef-0123-456789abcdef",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.CreateSweepConfigRequest ✔️ 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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.CreateSweepConfigResponse>

Errors

Error Type Status Code Content Type
errors.GenericError 400, 409 application/json
errors.CreateSweepConfigError 422 application/json
errors.APIError 4XX, 5XX */*

listConfigs

List sweep configs associated with an account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.sweeps.listConfigs({
    accountID: "5d9d568d-fb5d-478b-a301-d495422f1c35",
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { sweepsListConfigs } from "@moovio/sdk/funcs/sweepsListConfigs.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await sweepsListConfigs(moov, {
    accountID: "5d9d568d-fb5d-478b-a301-d495422f1c35",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.ListSweepConfigsRequest ✔️ 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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ListSweepConfigsResponse>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

getConfig

Get a sweep config associated with a wallet.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.sweeps.getConfig({
    accountID: "12f68c4e-1e8d-483b-9f62-b5d6458d538c",
    sweepConfigID: "ce92235d-dd84-4e14-9895-3b98a0003522",
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { sweepsGetConfig } from "@moovio/sdk/funcs/sweepsGetConfig.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await sweepsGetConfig(moov, {
    accountID: "12f68c4e-1e8d-483b-9f62-b5d6458d538c",
    sweepConfigID: "ce92235d-dd84-4e14-9895-3b98a0003522",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.GetSweepConfigRequest ✔️ 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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetSweepConfigResponse>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

updateConfig

Update settings on a sweep config.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.write scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.sweeps.updateConfig({
    accountID: "7573cb48-6325-4d3d-841d-81108fcfe6f2",
    sweepConfigID: "49e8f3b1-259f-458e-9367-adb3b938f8c8",
    patchSweepConfig: {
      status: "disabled",
    },
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { sweepsUpdateConfig } from "@moovio/sdk/funcs/sweepsUpdateConfig.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await sweepsUpdateConfig(moov, {
    accountID: "7573cb48-6325-4d3d-841d-81108fcfe6f2",
    sweepConfigID: "49e8f3b1-259f-458e-9367-adb3b938f8c8",
    patchSweepConfig: {
      status: "disabled",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.UpdateSweepConfigRequest ✔️ 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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.UpdateSweepConfigResponse>

Errors

Error Type Status Code Content Type
errors.GenericError 400, 409 application/json
errors.PatchSweepConfigError 422 application/json
errors.APIError 4XX, 5XX */*

list

List sweeps associated with a wallet.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.sweeps.list({
    accountID: "c8a232aa-0b11-4b8a-b005-71e9e705d0e6",
    walletID: "21e27667-18d6-4d46-812e-0aee1b9ddf12",
    skip: 60,
    count: 20,
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { sweepsList } from "@moovio/sdk/funcs/sweepsList.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await sweepsList(moov, {
    accountID: "c8a232aa-0b11-4b8a-b005-71e9e705d0e6",
    walletID: "21e27667-18d6-4d46-812e-0aee1b9ddf12",
    skip: 60,
    count: 20,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.ListSweepsRequest ✔️ 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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ListSweepsResponse>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

get

Get details on a specific sweep.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/wallets.read scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.sweeps.get({
    accountID: "b888f774-3e7c-4135-a18c-6b985523c4bc",
    walletID: "e50f7622-81da-484b-9c66-1c8a99c6b71b",
    sweepID: "ecd62b8f-7112-4aaf-90ab-4e43b4cca371",
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { sweepsGet } from "@moovio/sdk/funcs/sweepsGet.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await sweepsGet(moov, {
    accountID: "b888f774-3e7c-4135-a18c-6b985523c4bc",
    walletID: "e50f7622-81da-484b-9c66-1c8a99c6b71b",
    sweepID: "ecd62b8f-7112-4aaf-90ab-4e43b4cca371",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.GetSweepRequest ✔️ 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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetSweepResponse>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*