(accounting.journalEntries)
- list - List Journal Entries
- create - Create Journal Entry
- get - Get Journal Entry
- update - Update Journal Entry
- delete - Delete Journal Entry
List Journal Entries
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.accounting.journalEntries.list({
raw: false,
serviceId: "salesforce",
limit: 20,
filter: {
updatedSince: new Date("2020-09-30T07:43:32.000Z"),
},
sort: {
by: "updated_at",
direction: "desc",
},
passThrough: {
"search": "San Francisco",
},
fields: "id,updated_at",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { accountingJournalEntriesList } from "@apideck/unify/funcs/accountingJournalEntriesList.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await accountingJournalEntriesList(apideck, {
raw: false,
serviceId: "salesforce",
limit: 20,
filter: {
updatedSince: new Date("2020-09-30T07:43:32.000Z"),
},
sort: {
by: "updated_at",
direction: "desc",
},
passThrough: {
"search": "San Francisco",
},
fields: "id,updated_at",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.AccountingJournalEntriesAllRequest | ✔️ | 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. |
Promise<operations.AccountingJournalEntriesAllResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Create Journal Entry
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.accounting.journalEntries.create({
raw: false,
serviceId: "salesforce",
journalEntry: {
title: "Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry",
currencyRate: 0.69,
currency: "USD",
companyId: "12345",
lineItems: [
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
],
memo: "Thank you for your business and have a great day!",
postedAt: new Date("2020-09-30T07:43:32.000Z"),
journalSymbol: "IND",
taxType: "sales",
taxCode: "1234",
number: "OIT00546",
trackingCategories: [
{
id: "123456",
name: "New York",
},
],
accountingPeriod: "01-24",
rowVersion: "1-12345",
customFields: [
{
id: "2389328923893298",
name: "employee_level",
description: "Employee Level",
value: [
"<value>",
"<value>",
"<value>",
],
},
],
passThrough: [
{
serviceId: "<id>",
extendPaths: [
{
path: "$.nested.property",
value: {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
],
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { accountingJournalEntriesCreate } from "@apideck/unify/funcs/accountingJournalEntriesCreate.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await accountingJournalEntriesCreate(apideck, {
raw: false,
serviceId: "salesforce",
journalEntry: {
title: "Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry",
currencyRate: 0.69,
currency: "USD",
companyId: "12345",
lineItems: [
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
],
memo: "Thank you for your business and have a great day!",
postedAt: new Date("2020-09-30T07:43:32.000Z"),
journalSymbol: "IND",
taxType: "sales",
taxCode: "1234",
number: "OIT00546",
trackingCategories: [
{
id: "123456",
name: "New York",
},
],
accountingPeriod: "01-24",
rowVersion: "1-12345",
customFields: [
{
id: "2389328923893298",
name: "employee_level",
description: "Employee Level",
value: [
"<value>",
"<value>",
"<value>",
],
},
],
passThrough: [
{
serviceId: "<id>",
extendPaths: [
{
path: "$.nested.property",
value: {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.AccountingJournalEntriesAddRequest | ✔️ | 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. |
Promise<operations.AccountingJournalEntriesAddResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Get Journal Entry
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.accounting.journalEntries.get({
id: "<id>",
serviceId: "salesforce",
raw: false,
fields: "id,updated_at",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { accountingJournalEntriesGet } from "@apideck/unify/funcs/accountingJournalEntriesGet.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await accountingJournalEntriesGet(apideck, {
id: "<id>",
serviceId: "salesforce",
raw: false,
fields: "id,updated_at",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.AccountingJournalEntriesOneRequest | ✔️ | 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. |
Promise<operations.AccountingJournalEntriesOneResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Update Journal Entry
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.accounting.journalEntries.update({
id: "<id>",
serviceId: "salesforce",
raw: false,
journalEntry: {
title: "Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry",
currencyRate: 0.69,
currency: "USD",
companyId: "12345",
lineItems: [
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
],
memo: "Thank you for your business and have a great day!",
postedAt: new Date("2020-09-30T07:43:32.000Z"),
journalSymbol: "IND",
taxType: "sales",
taxCode: "1234",
number: "OIT00546",
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
accountingPeriod: "01-24",
rowVersion: "1-12345",
customFields: [
{
id: "2389328923893298",
name: "employee_level",
description: "Employee Level",
value: {},
},
{
id: "2389328923893298",
name: "employee_level",
description: "Employee Level",
value: [
{},
],
},
],
passThrough: [
{
serviceId: "<id>",
extendPaths: [
{
path: "$.nested.property",
value: {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
],
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { accountingJournalEntriesUpdate } from "@apideck/unify/funcs/accountingJournalEntriesUpdate.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await accountingJournalEntriesUpdate(apideck, {
id: "<id>",
serviceId: "salesforce",
raw: false,
journalEntry: {
title: "Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry",
currencyRate: 0.69,
currency: "USD",
companyId: "12345",
lineItems: [
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
{
description: "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
taxAmount: 27500,
subTotal: 27500,
totalAmount: 27500,
type: "debit",
taxRate: {
id: "123456",
rate: 10,
},
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
ledgerAccount: {
id: "123456",
nominalCode: "N091",
code: "453",
},
customer: {
id: "12345",
displayName: "Windsurf Shop",
email: "boring@boring.com",
},
supplier: {
id: "12345",
displayName: "Windsurf Shop",
address: {
id: "123",
type: "primary",
string: "25 Spring Street, Blackburn, VIC 3130",
name: "HQ US",
line1: "Main street",
line2: "apt #",
line3: "Suite #",
line4: "delivery instructions",
streetNumber: "25",
city: "San Francisco",
state: "CA",
postalCode: "94104",
country: "US",
latitude: "40.759211",
longitude: "-73.984638",
county: "Santa Clara",
contactName: "Elon Musk",
salutation: "Mr",
phoneNumber: "111-111-1111",
fax: "122-111-1111",
email: "elon@musk.com",
website: "https://elonmusk.com",
notes: "Address notes or delivery instructions.",
rowVersion: "1-12345",
},
},
lineNumber: 1,
},
],
memo: "Thank you for your business and have a great day!",
postedAt: new Date("2020-09-30T07:43:32.000Z"),
journalSymbol: "IND",
taxType: "sales",
taxCode: "1234",
number: "OIT00546",
trackingCategories: [
{
id: "123456",
name: "New York",
},
{
id: "123456",
name: "New York",
},
],
accountingPeriod: "01-24",
rowVersion: "1-12345",
customFields: [
{
id: "2389328923893298",
name: "employee_level",
description: "Employee Level",
value: {},
},
{
id: "2389328923893298",
name: "employee_level",
description: "Employee Level",
value: [
{},
],
},
],
passThrough: [
{
serviceId: "<id>",
extendPaths: [
{
path: "$.nested.property",
value: {
"TaxClassificationRef": {
"value": "EUC-99990201-V1-00020000",
},
},
},
],
},
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.AccountingJournalEntriesUpdateRequest | ✔️ | 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. |
Promise<operations.AccountingJournalEntriesUpdateResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |
Delete Journal Entry
import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const result = await apideck.accounting.journalEntries.delete({
id: "<id>",
serviceId: "salesforce",
raw: false,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ApideckCore } from "@apideck/unify/core.js";
import { accountingJournalEntriesDelete } from "@apideck/unify/funcs/accountingJournalEntriesDelete.js";
// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});
async function run() {
const res = await accountingJournalEntriesDelete(apideck, {
id: "<id>",
serviceId: "salesforce",
raw: false,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.AccountingJournalEntriesDeleteRequest | ✔️ | 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. |
Promise<operations.AccountingJournalEntriesDeleteResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequestResponse | 400 | application/json |
errors.UnauthorizedResponse | 401 | application/json |
errors.PaymentRequiredResponse | 402 | application/json |
errors.NotFoundResponse | 404 | application/json |
errors.UnprocessableResponse | 422 | application/json |
errors.APIError | 4XX, 5XX | */* |