The Abound Node library provides convenient access to the Abound API from applications written in server-side JavaScript.
The Abound Node SDK supports all Abound API endpoints. See the API Documentation and the API Reference for complete information about the APIs.
You can start to integrate the Abound Node library into your solution as soon as you create an account with Abound and obtain your API keys.
Install the SDK with npm or yarn:
npm install @withabound/node-sdk --saveyarn add @withabound/node-sdkThe Abound client must be configured with your account's appId and appSecret, which are available on the Keys page of the Abound Dashboard.
Every method returns a promise which can either be chained or handled via async/await.
import { Abound } from "@withabound/node-sdk";
const abound = new Abound({
appId: "appId_f2d...",
appSecret: "appSecret_bf3...",
environment: "SANDBOX", // or "PRODUCTION"
});
(async () => {
const user = await abound.users.create({
email: "[email protected]",
});
console.log(user.userId);
})();
// or
abound.users
.create({
email: "[email protected]",
})
.then((user) => console.log(user.userId))
.catch((error) => console.error(error));Create an Access Token:
const userId = "userId_506...";
const response = await abound.accessTokens.create({
expiresIn: 300,
userId,
});
console.log(response.userId);Create a Form 1099-INT:
const response = await abound.form1099Int.create({
filingYear: 2022
payer: {
name: "Hooli",
tin: "111111111",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
phoneNumber: "6501014096",
},
payee: {
name: "Ada Lovelace",
tin: "000000000",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
formFields: {
interestIncome: 83_232,
stateTaxInfo: [{ filingState: "CA" as const }],
},
});
console.log(response.payeeUrl);List Form 1099-INTs:
const response = await abound.form1099Int.list();
console.log(response); // list of Form 1099-INTsMail a Form 1099-INT:
const documentId = "documentId_f03...";
const response = await abound.form1099Int.mail(documentId, {
to: {
name: "Ada Lovelace",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
from: {
name: "Hooli",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
});
console.log(response);File a Form 1099-INT:
const documentId = "documentId_f03...";
const response = await abound.form1099Int.file(documentId);
console.log(response.status);Correct a Form 1099-INT:
const documentId = "documentId_f03...";
const response = await abound.form1099Int.correct(documentId, {
payee: {
name: "Ada Lovelace",
tin: "000000000",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
formFields: {
interestIncome: 24_271,
stateTaxInfo: [{ filingState: "CA" as const }],
},
});
console.log(response);Void a Form 1099-INT:
const documentId = "documentId_f03...";
const response = await abound.form1099Int.void(documentId);
console.log(response);Retrieve a Form 1099-INT:
const documentId = "documentId_f03...";
const response = await abound.form1099Int.retrieve(documentId);
console.log(response);Delete a Form 1099-INT:
const documentId = "documentId_f03...";
const response = await abound.form1099Int.delete(documentId);
console.log(response); // {}Create a Form 1099-K:
const response = await abound.form1099K.create({
filingYear: 2022
payer: {
name: "Hooli",
tin: "111111111",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
phoneNumber: "6501014096",
},
payee: {
name: "Ada Lovelace",
tin: "000000000",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
formFields: {
payerClassification: "EPF_OTHER" as const,
transactionsReportedClassification: "PAYMENT_CARD" as const,
aggregateGrossAmount: 2_332_323,
numberOfPaymentTransactions: 767,
grossAmountsByMonth: {
december: 2_332_323,
},
stateTaxInfo: [{ filingState: "CA" as const }],
},
});
console.log(response.payeeUrl);List Form 1099-Ks:
const response = await abound.form1099K.list();
console.log(response); // list of Form 1099-KsMail a Form 1099-K:
const documentId = "documentId_fef...";
const response = await abound.form1099K.mail(documentId, {
to: {
name: "Ada Lovelace",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
from: {
name: "Hooli",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
});
console.log(response);File a Form 1099-K:
const documentId = "documentId_fef...";
const response = await abound.form1099K.file(documentId);
console.log(response.status);Correct a Form 1099-K:
const documentId = "documentId_fef...";
const response = await abound.form1099K.correct(documentId, {
payee: {
name: "Ada Lovelace",
tin: "000000000",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
formFields: {
payerClassification: "EPF_OTHER" as const,
transactionsReportedClassification: "PAYMENT_CARD" as const,
aggregateGrossAmount: 512_223,
numberOfPaymentTransactions: 767,
grossAmountsByMonth: {
december: 512_223,
},
stateTaxInfo: [{ filingState: "CA" as const }],
},
});
console.log(response);Void a Form 1099-K:
const documentId = "documentId_fef...";
const response = await abound.form1099K.void(documentId);
console.log(response);Retrieve a Form 1099-K:
const documentId = "documentId_fef...";
const response = await abound.form1099K.retrieve(documentId);
console.log(response);Delete a Form 1099-K:
const documentId = "documentId_fef...";
const response = await abound.form1099K.delete(documentId);
console.log(response); // {}Create a Form 1099-NEC:
const response = await abound.form1099Nec.create({
filingYear: 2022
payer: {
name: "Hooli",
tin: "111111111",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
phoneNumber: "6501014096",
},
payee: {
name: "Ada Lovelace",
tin: "000000000",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
formFields: {
nonemployeeCompensation: 23_423,
stateTaxInfo: [{ filingState: "CA" as const }],
},
});
console.log(response.payeeUrl);List Form 1099-NECs:
const response = await abound.form1099Nec.list();
console.log(response); // list of Form 1099-NECsMail a Form 1099-NEC:
const documentId = "documentId_63a...";
const response = await abound.form1099Nec.mail(documentId, {
to: {
name: "Ada Lovelace",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
from: {
name: "Hooli",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
});
console.log(response);File a Form 1099-NEC:
const documentId = "documentId_63a...";
const response = await abound.form1099Nec.file(documentId);
console.log(response.status);Correct a Form 1099-NEC:
const documentId = "documentId_63a...";
const response = await abound.form1099Nec.correct(documentId, {
payee: {
name: "Ada Lovelace",
tin: "000000000",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
formFields: {
nonemployeeCompensation: 24_389,
stateTaxInfo: [{ filingState: "CA" as const }],
},
});
console.log(response);Void a Form 1099-NEC:
const documentId = "documentId_63a...";
const response = await abound.form1099Nec.void(documentId);
console.log(response);Retrieve a Form 1099-NEC:
const documentId = "documentId_63a...";
const response = await abound.form1099Nec.retrieve(documentId);
console.log(response);Delete a Form 1099-NEC:
const documentId = "documentId_63a...";
const response = await abound.form1099Nec.delete(documentId);
console.log(response); // {}Create a Form W-9:
const response = await abound.formW9.create({
payee: {
name: "Ada Lovelace",
tin: "000000000",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
formFields: {
taxClassification: "SOLE_PROPRIETOR" as const,
certifiedAt: "2023-01-01T00:00:00.000Z",
},
});
console.log(response.url);List Form W-9s:
const response = await abound.formW9.list();
console.log(response); // list of Form W-9sRetrieve a Form W-9:
const documentId = "documentId_f48...";
const response = await abound.formW9.retrieve(documentId);
console.log(response);List Mailings:
const documentId = "documentId_efb...";
const response = await abound.mailings.list();
console.log(response); // list of MailingsRetrieve a Mailing:
const mailingId = "mailingId_d01...";
const response = await abound.mailings.retrieve(mailingId);
console.log(response);Update a Mailing:
const mailingId = "mailingId_d01...";
const response = await abound.mailings.update(mailingId, {
to: {
name: "Ada Lovelace",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
from: {
name: "Hooli",
address: "256 Byron Street",
address2: "Suite 32",
city: "Palo Alto",
state: "CA",
postalCode: "94306",
country: "US",
},
});
console.log(response);Delete a Mailing:
const mailingId = "mailingId_d01...";
const response = await abound.mailings.delete(mailingId);
console.log(response); // {}Create a TIN Verification:
const response = await abound.tinVerifications.create({
name: "Ada Lovelace",
tin: "111111111",
});
console.log(response.tinFingerprint);List TIN Verificationss:
const response = await abound.tinVerifications.list();
console.log(response); // list of TIN VerificationsRetrieve a TIN Verification:
const tinVerificationId = "tinVerificationId_40c...";
const response = await abound.tinVerifications.retrieve(tinVerificationId);
console.log(response.tinFingerprint);Create a User:
const response = await abound.users.create({
email: "[email protected]",
});
console.log(response.userId);List Users:
const response = await abound.users.list();
console.log(response); // list of UsersRetrieve a User:
const userId = "userId_506...";
const response = await abound.users.retrieve(userId);
console.log(response.userId);Update a User:
const userId = "userId_506...";
const response = await abound.users.update(userId, {
email: "[email protected]",
});
console.log(response.email);Run all tests:
npx vitestRun xo:
npx xoor, run with autofix:
npx xo --fixCompile:
npm run compileInstall husky:
npx husky installPublish artifacts locally:
Install yalc with npm or yarn:
npm install yalc -gyarn global add yalcBuild the SDK:
npm run buildPublish artifacts to local yalc registry:
yalc pushInstall the local artifacts:
~/my-project $ yalc add @withabound/node-sdk