NCOA responses
Prerequisites
How to use Lob’s NCOA functionality
Code example
import {
Configuration,ChecksApi, CheckEditable,CountryExtended, AddressEditable
} from "@lob/lob-typescript-sdk";
async function demo() {
const config: Configuration = new Configuration({
username: "test_XXXXXXXX",
});
const checkToCreate = new CheckEditable({
description: "Reimbursement $1",
to: new AddressEditable({
name: "HARRY ZHANG",
address_line1: "185 BERRY ST",
address_line2: "SUITE 6100",
address_city: "SAN FRANCISCO",
address_state: "CA",
address_zip: "94107"
}),
from: new AddressEditable({
name: "LEORE AVIDAR",
address_line1: "210 King Street",
address_city: "SAN FRANCISCO",
address_state: "CA",
address_zip: "94107",
address_country: CountryExtended.Us,
}),
bank_account: "bank_XXXXXXXX",
amount: 1,
});
const checksApi = new ChecksApi(config);
try {
const newCheck = await checksApi.create(checkToCreate);
if (newCheck.to?.recipient_moved) {
console.log("Recipient has moved - cancel ")
await checksApi.cancel(newCheck.id);
}
} catch (err) {
console.error(err);
}
}
demo().then().catch(); Conclusion
Further resources
Last updated
Was this helpful?

