Skip to content

Latest commit

 

History

History
561 lines (458 loc) · 29.3 KB

README.md

File metadata and controls

561 lines (458 loc) · 29.3 KB

Onboarding

(onboarding)

Overview

Available Operations

  • createInvite - Create an invitation containing a unique link that allows the recipient to onboard their organization with Moov.

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

  • listInvites - List all the onboarding invites created by the caller's account.

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

  • getInvite - Retrieve details about an onboarding invite.

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

  • revokeInvite - Revoke an onboarding invite, rendering the invitation link unusable.

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

createInvite

Create an invitation containing a unique link that allows the recipient to onboard their organization with Moov.

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

Example Usage

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

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

async function run() {
  const result = await moov.onboarding.createInvite({
    scopes: [
      "accounts.read",
    ],
    capabilities: [
      "transfers",
    ],
    feePlanCodes: [
      "merchant-direct",
    ],
    prefill: {
      accountType: "business",
      profile: {
        individual: {
          name: {
            firstName: "Jordan",
            middleName: "Reese",
            lastName: "Lee",
            suffix: "Jr",
          },
          phone: {
            number: "8185551212",
            countryCode: "1",
          },
          email: "[email protected]",
          address: {
            addressLine1: "123 Main Street",
            addressLine2: "Apt 302",
            city: "Boulder",
            stateOrProvince: "CO",
            postalCode: "80301",
            country: "US",
          },
          birthDate: {
            day: 9,
            month: 11,
            year: 1989,
          },
        },
        business: {
          legalBusinessName: "Classbooker, LLC",
          businessType: "llc",
          address: {
            addressLine1: "123 Main Street",
            addressLine2: "Apt 302",
            city: "Boulder",
            stateOrProvince: "CO",
            postalCode: "80301",
            country: "US",
          },
          phone: {
            number: "8185551212",
            countryCode: "1",
          },
          email: "[email protected]",
          description: "Local fitness gym paying out instructors",
          taxID: {
            ein: {
              number: "12-3456789",
            },
          },
          industryCodes: {
            naics: "713940",
            sic: "7991",
            mcc: "7997",
          },
        },
      },
      metadata: {
        "optional": "metadata",
      },
      termsOfService: {
        acceptedDate: new Date("2024-12-17T23:29:29.246Z"),
        acceptedIP: "172.217.2.46",
        acceptedUserAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36",
        acceptedDomain: "https://odd-brace.biz/",
      },
      customerSupport: {
        phone: {
          number: "8185551212",
          countryCode: "1",
        },
        email: "[email protected]",
        address: {
          addressLine1: "123 Main Street",
          addressLine2: "Apt 302",
          city: "Boulder",
          stateOrProvince: "CO",
          postalCode: "80301",
          country: "US",
        },
      },
      settings: {
        cardPayment: {
          statementDescriptor: "Whole Body Fitness",
        },
        achPayment: {
          companyName: "WholeBodyFitness",
        },
      },
      mode: "production",
    },
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { onboardingCreateInvite } from "@moovio/sdk/funcs/onboardingCreateInvite.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 onboardingCreateInvite(moov, {
    scopes: [
      "accounts.read",
    ],
    capabilities: [
      "transfers",
    ],
    feePlanCodes: [
      "merchant-direct",
    ],
    prefill: {
      accountType: "business",
      profile: {
        individual: {
          name: {
            firstName: "Jordan",
            middleName: "Reese",
            lastName: "Lee",
            suffix: "Jr",
          },
          phone: {
            number: "8185551212",
            countryCode: "1",
          },
          email: "[email protected]",
          address: {
            addressLine1: "123 Main Street",
            addressLine2: "Apt 302",
            city: "Boulder",
            stateOrProvince: "CO",
            postalCode: "80301",
            country: "US",
          },
          birthDate: {
            day: 9,
            month: 11,
            year: 1989,
          },
        },
        business: {
          legalBusinessName: "Classbooker, LLC",
          businessType: "llc",
          address: {
            addressLine1: "123 Main Street",
            addressLine2: "Apt 302",
            city: "Boulder",
            stateOrProvince: "CO",
            postalCode: "80301",
            country: "US",
          },
          phone: {
            number: "8185551212",
            countryCode: "1",
          },
          email: "[email protected]",
          description: "Local fitness gym paying out instructors",
          taxID: {
            ein: {
              number: "12-3456789",
            },
          },
          industryCodes: {
            naics: "713940",
            sic: "7991",
            mcc: "7997",
          },
        },
      },
      metadata: {
        "optional": "metadata",
      },
      termsOfService: {
        acceptedDate: new Date("2024-12-17T23:29:29.246Z"),
        acceptedIP: "172.217.2.46",
        acceptedUserAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36",
        acceptedDomain: "https://odd-brace.biz/",
      },
      customerSupport: {
        phone: {
          number: "8185551212",
          countryCode: "1",
        },
        email: "[email protected]",
        address: {
          addressLine1: "123 Main Street",
          addressLine2: "Apt 302",
          city: "Boulder",
          stateOrProvince: "CO",
          postalCode: "80301",
          country: "US",
        },
      },
      settings: {
        cardPayment: {
          statementDescriptor: "Whole Body Fitness",
        },
        achPayment: {
          companyName: "WholeBodyFitness",
        },
      },
      mode: "production",
    },
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request components.OnboardingInviteRequest ✔️ 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.CreateOnboardingInviteResponse>

Errors

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

listInvites

List all the onboarding invites created by the caller's account.

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

Example Usage

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

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

async function run() {
  const result = await moov.onboarding.listInvites({});

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { onboardingListInvites } from "@moovio/sdk/funcs/onboardingListInvites.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 onboardingListInvites(moov, {});

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.ListOnboardingInvitesRequest ✔️ 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.ListOnboardingInvitesResponse>

Errors

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

getInvite

Retrieve details about an onboarding invite.

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

Example Usage

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

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

async function run() {
  const result = await moov.onboarding.getInvite({
    code: "N1IA5eWYNh",
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { onboardingGetInvite } from "@moovio/sdk/funcs/onboardingGetInvite.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 onboardingGetInvite(moov, {
    code: "N1IA5eWYNh",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.GetOnboardingInviteRequest ✔️ 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.GetOnboardingInviteResponse>

Errors

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

revokeInvite

Revoke an onboarding invite, rendering the invitation link unusable.

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

Example Usage

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

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

async function run() {
  const result = await moov.onboarding.revokeInvite({
    code: "N1IA5eWYNh",
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { onboardingRevokeInvite } from "@moovio/sdk/funcs/onboardingRevokeInvite.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 onboardingRevokeInvite(moov, {
    code: "N1IA5eWYNh",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.RevokeOnboardingInviteRequest ✔️ 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.RevokeOnboardingInviteResponse>

Errors

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