Skip to content

Latest commit

 

History

History
1243 lines (986 loc) · 79.9 KB

File metadata and controls

1243 lines (986 loc) · 79.9 KB

Accounts

Overview

Available Operations

  • create - You can create business or individual accounts for your users (i.e., customers, merchants) by passing the required information to Moov. Requirements differ per account type and requested capabilities.

If you're requesting the wallet, send-funds, collect-funds, or card-issuing capabilities, you'll need to:

  • Send Moov the user platform terms of service agreement acceptance. This can be done upon account creation, or by patching the account using the termsOfService field. If you're creating a business account with the business type llc, partnership, or privateCorporation, you'll need to:
  • Provide business representatives after creating the account.
  • Patch the account to indicate that business representative ownership information is complete.

Visit our documentation to read more about creating accounts and verification requirements. Note that the mode field (for production or sandbox) is only required when creating a facilitator account. All non-facilitator account requests will ignore the mode field and be set to the calling facilitator's mode.

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

  • list - List or search accounts to which the caller is connected.

All supported query parameters are optional. If none are provided the response will include all connected accounts. Pagination is supported via the skip and count query parameters. Searching by name and email will overlap and return results based on relevance. Accounts with AccountType guest will not be included in the response.

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

  • get - Retrieves details for the account with the specified ID.

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

  • update - When can profile data be updated:

    • For unverified accounts, all profile data can be edited.
    • During the verification process, missing or incomplete profile data can be edited.
    • Verified accounts can only add missing profile data.

    When can't profile data be updated:

    • Verified accounts cannot change any existing profile data.

If you need to update information in a locked state, please contact Moov support.

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

  • disconnect - This will sever the connection between you and the account specified and it will no longer be listed as active in the list of accounts. This also means you'll only have read-only access to the account going forward for reporting purposes.

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

  • listConnected - List or search accounts to which the caller is connected.

All supported query parameters are optional. If none are provided the response will include all connected accounts. Pagination is supported via the skip and count query parameters. Searching by name and email will overlap and return results based on relevance. Accounts with AccountType guest will not be included in the response.

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

  • connect - Shares access scopes from the account specified to the caller, establishing a connection between the two accounts with the specified permissions.
  • getCountries - Retrieve the specified countries of operation for an account.

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

This endpoint will always overwrite the previously assigned values.

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

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

  • getTermsOfServiceToken - Generates a non-expiring token that can then be used to accept Moov's terms of service.

This token can only be generated via API. Any Moov account requesting the collect funds, send funds, wallet, or card issuing capabilities must accept Moov's terms of service, then have the generated terms of service token patched to the account. Read more in our documentation.

create

You can create business or individual accounts for your users (i.e., customers, merchants) by passing the required information to Moov. Requirements differ per account type and requested capabilities.

If you're requesting the wallet, send-funds, collect-funds, or card-issuing capabilities, you'll need to:

  • Send Moov the user platform terms of service agreement acceptance. This can be done upon account creation, or by patching the account using the termsOfService field. If you're creating a business account with the business type llc, partnership, or privateCorporation, you'll need to:
  • Provide business representatives after creating the account.
  • Patch the account to indicate that business representative ownership information is complete.

Visit our documentation to read more about creating accounts and verification requirements. Note that the mode field (for production or sandbox) is only required when creating a facilitator account. All non-facilitator account requests will ignore the mode field and be set to the calling facilitator's mode.

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({
  xMoovVersion: "v2024.01.00",
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.accounts.create({
    accountType: "business",
    profile: {
      business: {
        legalBusinessName: "Whole Body Fitness LLC",
      },
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsCreate(moov, {
    accountType: "business",
    profile: {
      business: {
        legalBusinessName: "Whole Body Fitness LLC",
      },
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsCreate failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

list

List or search accounts to which the caller is connected.

All supported query parameters are optional. If none are provided the response will include all connected accounts. Pagination is supported via the skip and count query parameters. Searching by name and email will overlap and return results based on relevance. Accounts with AccountType guest will not be included in the response.

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({
  xMoovVersion: "v2024.01.00",
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.accounts.list({
    type: "business",
    skip: 60,
    count: 20,
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsList(moov, {
    type: "business",
    skip: 60,
    count: 20,
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsList failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

get

Retrieves details for the account with the specified ID.

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

Example Usage

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

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

async function run() {
  const result = await moov.accounts.get({
    accountID: "2f93a6cf-3b3b-4c17-8d3b-110dfadccea4",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsGet(moov, {
    accountID: "2f93a6cf-3b3b-4c17-8d3b-110dfadccea4",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsGet failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

update

When can profile data be updated:

  • For unverified accounts, all profile data can be edited.
  • During the verification process, missing or incomplete profile data can be edited.
  • Verified accounts can only add missing profile data.

When can't profile data be updated:

  • Verified accounts cannot change any existing profile data.

If you need to update information in a locked state, please contact Moov support.

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

Example Usage

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

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

async function run() {
  const result = await moov.accounts.update({
    accountID: "433cb9d1-5943-4fd5-91b4-2aef5b30e2e7",
    patchAccount: {
      profile: {
        individual: {
          name: {
            firstName: "Jordan",
            middleName: "Reese",
            lastName: "Lee",
            suffix: "Jr",
          },
          phone: {
            number: "8185551212",
            countryCode: "1",
          },
          email: "jordan.lee@classbooker.dev",
          address: {
            addressLine1: "123 Main Street",
            addressLine2: "Apt 302",
            city: "Boulder",
            stateOrProvince: "CO",
            postalCode: "80301",
            country: "US",
          },
          birthDate: {
            day: 9,
            month: 11,
            year: 1989,
          },
        },
        business: {
          businessType: "llc",
          address: {
            addressLine1: "123 Main Street",
            addressLine2: "Apt 302",
            city: "Boulder",
            stateOrProvince: "CO",
            postalCode: "80301",
            country: "US",
          },
          phone: {
            number: "8185551212",
            countryCode: "1",
          },
          email: "jordan.lee@classbooker.dev",
          taxID: {
            ein: {
              number: "12-3456789",
            },
          },
          industryCodes: {
            naics: "713940",
            sic: "7991",
            mcc: "7997",
          },
          industry: "electronics-appliances",
        },
      },
      metadata: {
        "optional": "metadata",
      },
      termsOfService: {
        manual: {
          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",
        },
      },
      customerSupport: {
        phone: {
          number: "8185551212",
          countryCode: "1",
        },
        email: "jordan.lee@classbooker.dev",
        address: {
          addressLine1: "123 Main Street",
          addressLine2: "Apt 302",
          city: "Boulder",
          stateOrProvince: "CO",
          postalCode: "80301",
          country: "US",
        },
      },
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsUpdate(moov, {
    accountID: "433cb9d1-5943-4fd5-91b4-2aef5b30e2e7",
    patchAccount: {
      profile: {
        individual: {
          name: {
            firstName: "Jordan",
            middleName: "Reese",
            lastName: "Lee",
            suffix: "Jr",
          },
          phone: {
            number: "8185551212",
            countryCode: "1",
          },
          email: "jordan.lee@classbooker.dev",
          address: {
            addressLine1: "123 Main Street",
            addressLine2: "Apt 302",
            city: "Boulder",
            stateOrProvince: "CO",
            postalCode: "80301",
            country: "US",
          },
          birthDate: {
            day: 9,
            month: 11,
            year: 1989,
          },
        },
        business: {
          businessType: "llc",
          address: {
            addressLine1: "123 Main Street",
            addressLine2: "Apt 302",
            city: "Boulder",
            stateOrProvince: "CO",
            postalCode: "80301",
            country: "US",
          },
          phone: {
            number: "8185551212",
            countryCode: "1",
          },
          email: "jordan.lee@classbooker.dev",
          taxID: {
            ein: {
              number: "12-3456789",
            },
          },
          industryCodes: {
            naics: "713940",
            sic: "7991",
            mcc: "7997",
          },
          industry: "electronics-appliances",
        },
      },
      metadata: {
        "optional": "metadata",
      },
      termsOfService: {
        manual: {
          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",
        },
      },
      customerSupport: {
        phone: {
          number: "8185551212",
          countryCode: "1",
        },
        email: "jordan.lee@classbooker.dev",
        address: {
          addressLine1: "123 Main Street",
          addressLine2: "Apt 302",
          city: "Boulder",
          stateOrProvince: "CO",
          postalCode: "80301",
          country: "US",
        },
      },
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsUpdate failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

disconnect

This will sever the connection between you and the account specified and it will no longer be listed as active in the list of accounts. This also means you'll only have read-only access to the account going forward for reporting purposes.

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

Example Usage

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

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

async function run() {
  const result = await moov.accounts.disconnect({
    accountID: "cfdfea7d-f185-4de5-ba90-b09f14fe6683",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsDisconnect(moov, {
    accountID: "cfdfea7d-f185-4de5-ba90-b09f14fe6683",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsDisconnect failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

listConnected

List or search accounts to which the caller is connected.

All supported query parameters are optional. If none are provided the response will include all connected accounts. Pagination is supported via the skip and count query parameters. Searching by name and email will overlap and return results based on relevance. Accounts with AccountType guest will not be included in the response.

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({
  xMoovVersion: "<value>",
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.accounts.listConnected({
    accountID: "7e09ffc8-e508-4fd4-a54e-21cff90a1824",
    skip: 60,
    count: 20,
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsListConnected(moov, {
    accountID: "7e09ffc8-e508-4fd4-a54e-21cff90a1824",
    skip: 60,
    count: 20,
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsListConnected failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

connect

Shares access scopes from the account specified to the caller, establishing a connection between the two accounts with the specified permissions.

Example Usage

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

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

async function run() {
  const result = await moov.accounts.connect({
    accountID: "456cb5b6-20dc-4585-97b4-745d013adb1f",
    shareScopes: {
      principalAccountID: "c520f1b9-0ba7-42f5-b977-248cdbe41c69",
      allowScopes: [
        "transfers.write",
        "payment-methods.read",
      ],
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsConnect(moov, {
    accountID: "456cb5b6-20dc-4585-97b4-745d013adb1f",
    shareScopes: {
      principalAccountID: "c520f1b9-0ba7-42f5-b977-248cdbe41c69",
      allowScopes: [
        "transfers.write",
        "payment-methods.read",
      ],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsConnect failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

getCountries

Retrieve the specified countries of operation for an account.

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

Example Usage

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

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

async function run() {
  const result = await moov.accounts.getCountries({
    accountID: "a2026036-cc26-42c1-beef-950662d13b5d",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsGetCountries(moov, {
    accountID: "a2026036-cc26-42c1-beef-950662d13b5d",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsGetCountries failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

assignCountries

Assign the countries of operation for an account.

This endpoint will always overwrite the previously assigned values.

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

Example Usage

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

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

async function run() {
  const result = await moov.accounts.assignCountries({
    accountID: "46736fa8-4bf7-4144-8e0e-dbea1eb0805b",
    accountCountries: {
      countries: [
        "United States",
      ],
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsAssignCountries(moov, {
    accountID: "46736fa8-4bf7-4144-8e0e-dbea1eb0805b",
    accountCountries: {
      countries: [
        "United States",
      ],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsAssignCountries failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

getMerchantProcessingAgreement

Retrieve a merchant account's processing agreement.

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

Example Usage

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

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

async function run() {
  const result = await moov.accounts.getMerchantProcessingAgreement({
    accountID: "6180d9b9-2377-4190-8530-70a99d31a578",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsGetMerchantProcessingAgreement(moov, {
    accountID: "6180d9b9-2377-4190-8530-70a99d31a578",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsGetMerchantProcessingAgreement failed:", res.error);
  }
}

run();

Parameters

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

Errors

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

getTermsOfServiceToken

Generates a non-expiring token that can then be used to accept Moov's terms of service.

This token can only be generated via API. Any Moov account requesting the collect funds, send funds, wallet, or card issuing capabilities must accept Moov's terms of service, then have the generated terms of service token patched to the account. Read more in our documentation.

Example Usage

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

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

async function run() {
  const result = await moov.accounts.getTermsOfServiceToken({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

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

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

async function run() {
  const res = await accountsGetTermsOfServiceToken(moov, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("accountsGetTermsOfServiceToken failed:", res.error);
  }
}

run();

Parameters

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

Errors

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