Skip to content

Files

Latest commit

 

History

History
9903 lines (7737 loc) · 278 KB

AccountingApi.md

File metadata and controls

9903 lines (7737 loc) · 278 KB

Apideck.Accounting

Class Name

AccountingApi

Methods

Get Aged Creditors

Method: agedCreditorsOne

accountingApi.agedCreditorsOne(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
filter AgedReportFilter Apply filters (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetAgedCreditorsResponse

HTTP response details

Status code Description
200 Aged Creditors
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.agedCreditorsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Aged Debtors

Method: agedDebtorsOne

accountingApi.agedDebtorsOne(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
filter AgedReportFilter Apply filters (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetAgedDebtorsResponse

HTTP response details

Status code Description
200 Aged Debtors
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.agedDebtorsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Attachments

Method: attachmentsAll

accountingApi.attachmentsAll(body)

Parameters

Name Type Description Notes
referenceType AttachmentReferenceType The reference type of the document.
referenceId [string] The reference id of the object to retrieve.
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetAttachmentsResponse

HTTP response details

Status code Description
200 Attachments
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  referenceType: 'invoice',
  referenceId: '123456'
}

try {
  const { data } = await apideck.accounting.attachmentsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Attachment

Method: attachmentsDelete

accountingApi.attachmentsDelete(body)

Parameters

Name Type Description Notes
referenceType AttachmentReferenceType The reference type of the document.
referenceId [string] The reference id of the object to retrieve.
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteAttachmentResponse

HTTP response details

Status code Description
200 Attachments
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  referenceType: 'invoice',
  referenceId: '123456',
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.attachmentsDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Download Attachment

Method: attachmentsDownload

accountingApi.attachmentsDownload(body)

Parameters

Name Type Description Notes
referenceType AttachmentReferenceType The reference type of the document.
referenceId [string] The reference id of the object to retrieve.
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

Blob

HTTP response details

Status code Description
200 Attachment Download
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  referenceType: 'invoice',
  referenceId: '123456',
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.attachmentsDownload(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Attachment

Method: attachmentsOne

accountingApi.attachmentsOne(body)

Parameters

Name Type Description Notes
referenceType AttachmentReferenceType The reference type of the document.
referenceId [string] The reference id of the object to retrieve.
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetAttachmentResponse

HTTP response details

Status code Description
200 Attachments
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  referenceType: 'invoice',
  referenceId: '123456',
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.attachmentsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get BalanceSheet

Method: balanceSheetOne

accountingApi.balanceSheetOne(body)

Parameters

Name Type Description Notes
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
filter BalanceSheetFilter Apply filters (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

GetBalanceSheetResponse

HTTP response details

Status code Description
200 BalanceSheet
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.balanceSheetOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Bill Payment

Method: billPaymentsAdd

accountingApi.billPaymentsAdd(body)

Parameters

Name Type Description Notes
billPayment BillPayment
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateBillPaymentResponse

HTTP response details

Status code Description
201 Bill Payment created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  billPayment: {
    currency: 'USD',
    currency_rate: 0.69,
    total_amount: 49.99,
    reference: '123456',
    payment_method: 'cash',
    payment_method_reference: '123456',
    payment_method_id: '12345',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    transaction_date: '2021-05-01T12:00:00.000Z',
    supplier: {
      id: '12345',
      display_name: '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',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    },
    company_id: '12345',
    reconciled: true,
    status: 'authorised',
    type: 'accounts_payable',
    allocations: [
      {
        id: '12345',
        type: 'bill',
        amount: 49.99,
        allocation_id: '123456'
      }
    ],
    note: 'Some notes about this transaction',
    number: '123456',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    display_id: '123456',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.billPaymentsAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Bill Payments

Method: billPaymentsAll

accountingApi.billPaymentsAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter PaymentsFilter Apply filters (optional)
sort PaymentsSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetBillPaymentsResponse

HTTP response details

Status code Description
200 Bill Payments
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.billPaymentsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Bill Payment

Method: billPaymentsDelete

accountingApi.billPaymentsDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteBillPaymentResponse

HTTP response details

Status code Description
200 Bill Payment deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.billPaymentsDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Bill Payment

Method: billPaymentsOne

accountingApi.billPaymentsOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetBillPaymentResponse

HTTP response details

Status code Description
200 Bill Payment
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.billPaymentsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Bill Payment

Method: billPaymentsUpdate

accountingApi.billPaymentsUpdate(body)

Parameters

Name Type Description Notes
billPayment BillPayment
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateBillPaymentResponse

HTTP response details

Status code Description
200 Bill Payment updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  billPayment: {
    currency: 'USD',
    currency_rate: 0.69,
    total_amount: 49.99,
    reference: '123456',
    payment_method: 'cash',
    payment_method_reference: '123456',
    payment_method_id: '12345',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    transaction_date: '2021-05-01T12:00:00.000Z',
    supplier: {
      id: '12345',
      display_name: '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',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    },
    company_id: '12345',
    reconciled: true,
    status: 'authorised',
    type: 'accounts_payable',
    allocations: [
      {
        id: '12345',
        type: 'bill',
        amount: 49.99,
        allocation_id: '123456'
      }
    ],
    note: 'Some notes about this transaction',
    number: '123456',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    display_id: '123456',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.billPaymentsUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Bill

Method: billsAdd

accountingApi.billsAdd(body)

Parameters

Name Type Description Notes
bill Bill
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateBillResponse

HTTP response details

Status code Description
201 Bill created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  bill: {
    bill_number: '10001',
    supplier: {
      id: '12345',
      display_name: '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',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    },
    company_id: '12345',
    currency: 'USD',
    currency_rate: 0.69,
    tax_inclusive: true,
    bill_date: '2020-09-30',
    due_date: '2020-10-30',
    paid_date: '2020-10-30',
    po_number: '90000117',
    reference: '123456',
    line_items: [
      {
        row_id: '12345',
        code: '120-C',
        line_number: 1,
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        type: 'expense_account',
        tax_amount: 27500,
        total_amount: 27500,
        quantity: 1,
        unit_price: 27500.5,
        unit_of_measure: 'pc.',
        discount_percentage: 0.01,
        discount_amount: 19.99,
        location_id: '1234',
        department_id: '1234',
        item: {
          id: '12344',
          code: '120-C',
          name: 'Model Y'
        },
        tax_rate: {
          id: '123456',
          rate: 10
        },
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        row_version: '1-12345'
      }
    ],
    terms: 'Net 30 days',
    balance: 27500,
    deposit: 0,
    sub_total: 27500,
    total_tax: 2500,
    total: 27500,
    tax_code: '1234',
    notes: 'Some notes about this bill.',
    status: 'draft',
    ledger_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    payment_method: 'cash',
    channel: 'email',
    language: 'EN',
    accounting_by_row: false,
    bank_account: {
      bank_name: 'Monzo',
      account_number: '123465',
      account_name: 'SPACEX LLC',
      account_type: 'credit_card',
      iban: 'CH2989144532982975332',
      bic: 'AUDSCHGGXXX',
      routing_number: '012345678',
      bsb_number: '062-001',
      branch_identifier: '001',
      bank_code: 'BNH',
      currency: 'USD'
    },
    discount_percentage: 5.5,
    source_document_url: 'https://www.invoicesolution.com/bill/123456',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    row_version: '1-12345',
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ],
    accounting_period: '01-24'
  }
}

try {
  const { data } = await apideck.accounting.billsAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Bills

Method: billsAll

accountingApi.billsAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter BillsFilter Apply filters (optional)
sort BillsSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetBillsResponse

HTTP response details

Status code Description
200 Bills
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.billsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Bill

Method: billsDelete

accountingApi.billsDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteBillResponse

HTTP response details

Status code Description
200 Bill deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.billsDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Bill

Method: billsOne

accountingApi.billsOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetBillResponse

HTTP response details

Status code Description
200 Bill
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.billsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Bill

Method: billsUpdate

accountingApi.billsUpdate(body)

Parameters

Name Type Description Notes
bill Bill
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateBillResponse

HTTP response details

Status code Description
200 Bill Updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  bill: {
    bill_number: '10001',
    supplier: {
      id: '12345',
      display_name: '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',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    },
    company_id: '12345',
    currency: 'USD',
    currency_rate: 0.69,
    tax_inclusive: true,
    bill_date: '2020-09-30',
    due_date: '2020-10-30',
    paid_date: '2020-10-30',
    po_number: '90000117',
    reference: '123456',
    line_items: [
      {
        row_id: '12345',
        code: '120-C',
        line_number: 1,
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        type: 'expense_account',
        tax_amount: 27500,
        total_amount: 27500,
        quantity: 1,
        unit_price: 27500.5,
        unit_of_measure: 'pc.',
        discount_percentage: 0.01,
        discount_amount: 19.99,
        location_id: '1234',
        department_id: '1234',
        item: {
          id: '12344',
          code: '120-C',
          name: 'Model Y'
        },
        tax_rate: {
          id: '123456',
          rate: 10
        },
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        row_version: '1-12345'
      }
    ],
    terms: 'Net 30 days',
    balance: 27500,
    deposit: 0,
    sub_total: 27500,
    total_tax: 2500,
    total: 27500,
    tax_code: '1234',
    notes: 'Some notes about this bill.',
    status: 'draft',
    ledger_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    payment_method: 'cash',
    channel: 'email',
    language: 'EN',
    accounting_by_row: false,
    bank_account: {
      bank_name: 'Monzo',
      account_number: '123465',
      account_name: 'SPACEX LLC',
      account_type: 'credit_card',
      iban: 'CH2989144532982975332',
      bic: 'AUDSCHGGXXX',
      routing_number: '012345678',
      bsb_number: '062-001',
      branch_identifier: '001',
      bank_code: 'BNH',
      currency: 'USD'
    },
    discount_percentage: 5.5,
    source_document_url: 'https://www.invoicesolution.com/bill/123456',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    row_version: '1-12345',
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ],
    accounting_period: '01-24'
  }
}

try {
  const { data } = await apideck.accounting.billsUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Company Info

Method: companyInfoOne

accountingApi.companyInfoOne(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetCompanyInfoResponse

HTTP response details

Status code Description
200 CompanyInfo
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.companyInfoOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Credit Note

Method: creditNotesAdd

accountingApi.creditNotesAdd(body)

Parameters

Name Type Description Notes
creditNote CreditNote
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateCreditNoteResponse

HTTP response details

Status code Description
201 Credit Note created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  creditNote: {
    number: 'OIT00546',
    customer: {
      id: '12345',
      display_name: 'Windsurf Shop',
      name: 'Windsurf Shop',
      email: 'boring@boring.com'
    },
    company_id: '12345',
    currency: 'USD',
    currency_rate: 0.69,
    tax_inclusive: true,
    sub_total: 27500,
    total_amount: 49.99,
    total_tax: 2500,
    tax_code: '1234',
    balance: 27500,
    remaining_credit: 27500,
    status: 'authorised',
    reference: '123456',
    date_issued: '2021-05-01T12:00:00.000Z',
    date_paid: '2021-05-01T12:00:00.000Z',
    type: 'accounts_receivable_credit',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    line_items: [
      {
        id: '12345',
        row_id: '12345',
        code: '120-C',
        line_number: 1,
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        type: 'sales_item',
        tax_amount: 27500,
        total_amount: 27500,
        quantity: 1,
        unit_price: 27500.5,
        unit_of_measure: 'pc.',
        discount_percentage: 0.01,
        discount_amount: 19.99,
        location_id: '1234',
        department_id: '1234',
        item: {
          id: '12344',
          code: '120-C',
          name: 'Model Y'
        },
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        custom_fields: [
          {
            id: '2389328923893298',
            name: 'employee_level',
            description: 'Employee Level',
            value: 'Uses Salesforce and Marketo'
          }
        ],
        row_version: '1-12345'
      }
    ],
    allocations: [
      {
        id: '123456',
        type: 'invoice',
        amount: 49.99,
        allocation_id: '123456'
      }
    ],
    note: 'Some notes about this credit note',
    terms: 'Some terms about this credit note',
    billing_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    shipping_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.creditNotesAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Credit Notes

Method: creditNotesAll

accountingApi.creditNotesAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter CreditNotesFilter Apply filters (optional)
sort CreditNotesSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetCreditNotesResponse

HTTP response details

Status code Description
200 Credit Notes
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.creditNotesAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Credit Note

Method: creditNotesDelete

accountingApi.creditNotesDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteCreditNoteResponse

HTTP response details

Status code Description
200 Credit Note deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.creditNotesDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Credit Note

Method: creditNotesOne

accountingApi.creditNotesOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetCreditNoteResponse

HTTP response details

Status code Description
200 Credit Note
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.creditNotesOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Credit Note

Method: creditNotesUpdate

accountingApi.creditNotesUpdate(body)

Parameters

Name Type Description Notes
creditNote CreditNote
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateCreditNoteResponse

HTTP response details

Status code Description
200 Credit Note updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  creditNote: {
    number: 'OIT00546',
    customer: {
      id: '12345',
      display_name: 'Windsurf Shop',
      name: 'Windsurf Shop',
      email: 'boring@boring.com'
    },
    company_id: '12345',
    currency: 'USD',
    currency_rate: 0.69,
    tax_inclusive: true,
    sub_total: 27500,
    total_amount: 49.99,
    total_tax: 2500,
    tax_code: '1234',
    balance: 27500,
    remaining_credit: 27500,
    status: 'authorised',
    reference: '123456',
    date_issued: '2021-05-01T12:00:00.000Z',
    date_paid: '2021-05-01T12:00:00.000Z',
    type: 'accounts_receivable_credit',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    line_items: [
      {
        id: '12345',
        row_id: '12345',
        code: '120-C',
        line_number: 1,
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        type: 'sales_item',
        tax_amount: 27500,
        total_amount: 27500,
        quantity: 1,
        unit_price: 27500.5,
        unit_of_measure: 'pc.',
        discount_percentage: 0.01,
        discount_amount: 19.99,
        location_id: '1234',
        department_id: '1234',
        item: {
          id: '12344',
          code: '120-C',
          name: 'Model Y'
        },
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        custom_fields: [
          {
            id: '2389328923893298',
            name: 'employee_level',
            description: 'Employee Level',
            value: 'Uses Salesforce and Marketo'
          }
        ],
        row_version: '1-12345'
      }
    ],
    allocations: [
      {
        id: '123456',
        type: 'invoice',
        amount: 49.99,
        allocation_id: '123456'
      }
    ],
    note: 'Some notes about this credit note',
    terms: 'Some terms about this credit note',
    billing_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    shipping_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.creditNotesUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Customer

Method: customersAdd

accountingApi.customersAdd(body)

Parameters

Name Type Description Notes
customer Customer
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateCustomerResponse

HTTP response details

Status code Description
201 Customers
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  customer: {
    display_id: 'EMP00101',
    display_name: 'Windsurf Shop',
    company_name: 'SpaceX',
    company_id: '12345',
    title: 'CEO',
    first_name: 'Elon',
    middle_name: 'D.',
    last_name: 'Musk',
    suffix: 'Jr.',
    individual: true,
    project: false,
    addresses: [
      {
        id: '123',
        type: 'primary',
        string: '25 Spring Street, Blackburn, VIC 3130',
        name: 'HQ US',
        line1: 'Main street',
        line2: 'apt #',
        line3: 'Suite #',
        line4: 'delivery instructions',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    ],
    phone_numbers: [
      {
        id: '12345',
        country_code: '1',
        area_code: '323',
        number: '111-111-1111',
        extension: '105',
        type: 'primary'
      }
    ],
    emails: [
      {
        id: '123',
        email: 'elon@musk.com',
        type: 'primary'
      }
    ],
    websites: [
      {
        id: '12345',
        url: 'http://example.com',
        type: 'primary'
      }
    ],
    bank_accounts: [
      {
        bank_name: 'Monzo',
        account_number: '123465',
        account_name: 'SPACEX LLC',
        account_type: 'credit_card',
        iban: 'CH2989144532982975332',
        bic: 'AUDSCHGGXXX',
        routing_number: '012345678',
        bsb_number: '062-001',
        branch_identifier: '001',
        bank_code: 'BNH',
        currency: 'USD'
      }
    ],
    notes: 'Some notes about this customer',
    tax_rate: {
      id: '123456',
      rate: 10
    },
    tax_number: 'US123945459',
    currency: 'USD',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    parent: {
      id: '12345',
      name: 'Windsurf Shop'
    },
    status: 'active',
    payment_method: 'cash',
    channel: 'email',
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.customersAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Customers

Method: customersAll

accountingApi.customersAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter CustomersFilter Apply filters (optional)
sort CustomersSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetCustomersResponse

HTTP response details

Status code Description
200 Customers
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.customersAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Customer

Method: customersDelete

accountingApi.customersDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteCustomerResponse

HTTP response details

Status code Description
200 Customers
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.customersDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Customer

Method: customersOne

accountingApi.customersOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetCustomerResponse

HTTP response details

Status code Description
200 Customer
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.customersOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Customer

Method: customersUpdate

accountingApi.customersUpdate(body)

Parameters

Name Type Description Notes
customer Customer
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateCustomerResponse

HTTP response details

Status code Description
200 Customers
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  customer: {
    display_id: 'EMP00101',
    display_name: 'Windsurf Shop',
    company_name: 'SpaceX',
    company_id: '12345',
    title: 'CEO',
    first_name: 'Elon',
    middle_name: 'D.',
    last_name: 'Musk',
    suffix: 'Jr.',
    individual: true,
    project: false,
    addresses: [
      {
        id: '123',
        type: 'primary',
        string: '25 Spring Street, Blackburn, VIC 3130',
        name: 'HQ US',
        line1: 'Main street',
        line2: 'apt #',
        line3: 'Suite #',
        line4: 'delivery instructions',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    ],
    phone_numbers: [
      {
        id: '12345',
        country_code: '1',
        area_code: '323',
        number: '111-111-1111',
        extension: '105',
        type: 'primary'
      }
    ],
    emails: [
      {
        id: '123',
        email: 'elon@musk.com',
        type: 'primary'
      }
    ],
    websites: [
      {
        id: '12345',
        url: 'http://example.com',
        type: 'primary'
      }
    ],
    bank_accounts: [
      {
        bank_name: 'Monzo',
        account_number: '123465',
        account_name: 'SPACEX LLC',
        account_type: 'credit_card',
        iban: 'CH2989144532982975332',
        bic: 'AUDSCHGGXXX',
        routing_number: '012345678',
        bsb_number: '062-001',
        branch_identifier: '001',
        bank_code: 'BNH',
        currency: 'USD'
      }
    ],
    notes: 'Some notes about this customer',
    tax_rate: {
      id: '123456',
      rate: 10
    },
    tax_number: 'US123945459',
    currency: 'USD',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    parent: {
      id: '12345',
      name: 'Windsurf Shop'
    },
    status: 'active',
    payment_method: 'cash',
    channel: 'email',
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.customersUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Department

Method: departmentsAdd

accountingApi.departmentsAdd(body)

Parameters

Name Type Description Notes
department AccountingDepartment
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateAccountingDepartmentResponse

HTTP response details

Status code Description
201 Department
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  department: {
    parent_id: '12345',
    name: 'Sales',
    status: 'active',
    subsidiaries: [
      {
        name: 'SpaceX'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.departmentsAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Departments

Method: departmentsAll

accountingApi.departmentsAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)
filter AccountingDepartmentsFilter Apply filters (optional)

Response Type

GetAccountingDepartmentsResponse

HTTP response details

Status code Description
200 Departments
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.departmentsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Department

Method: departmentsDelete

accountingApi.departmentsDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteAccountingDepartmentResponse

HTTP response details

Status code Description
200 Department deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.departmentsDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Department

Method: departmentsOne

accountingApi.departmentsOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetAccountingDepartmentResponse

HTTP response details

Status code Description
200 Location
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.departmentsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Department

Method: departmentsUpdate

accountingApi.departmentsUpdate(body)

Parameters

Name Type Description Notes
department AccountingDepartment
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateAccountingDepartmentResponse

HTTP response details

Status code Description
200 Department
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  department: {
    parent_id: '12345',
    name: 'Sales',
    status: 'active',
    subsidiaries: [
      {
        name: 'SpaceX'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.departmentsUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Expense

Method: expensesAdd

accountingApi.expensesAdd(body)

Parameters

Name Type Description Notes
expense Expense
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateExpenseResponse

HTTP response details

Status code Description
201 Expenses
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  expense: {
    number: 'OIT00546',
    transaction_date: '2021-05-01T12:00:00.000Z',
    account_id: '123456',
    customer_id: '12345',
    supplier_id: '12345',
    company_id: '12345',
    department_id: '12345',
    payment_type: 'cash',
    currency: 'USD',
    currency_rate: 0.69,
    type: 'expense',
    memo: 'For travel expenses incurred on 2024-05-15',
    tax_rate: {
      id: '123456',
      rate: 10
    },
    total_amount: 275,
    line_items: [
      {
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        account_id: '123456',
        customer_id: '12345',
        department_id: '12345',
        location_id: '12345',
        tax_rate: {
          id: '123456',
          rate: 10
        },
        description: 'Travel US.',
        total_amount: 275,
        billable: true
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.expensesAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Expenses

Method: expensesAll

accountingApi.expensesAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20

Response Type

GetExpensesResponse

HTTP response details

Status code Description
200 Expenses
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.expensesAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Expense

Method: expensesDelete

accountingApi.expensesDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteExpenseResponse

HTTP response details

Status code Description
200 Expenses
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.expensesDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Expense

Method: expensesOne

accountingApi.expensesOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

GetExpenseResponse

HTTP response details

Status code Description
200 Expenses
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.expensesOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Expense

Method: expensesUpdate

accountingApi.expensesUpdate(body)

Parameters

Name Type Description Notes
expense Expense
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateExpenseResponse

HTTP response details

Status code Description
200 Expenses
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  expense: {
    number: 'OIT00546',
    transaction_date: '2021-05-01T12:00:00.000Z',
    account_id: '123456',
    customer_id: '12345',
    supplier_id: '12345',
    company_id: '12345',
    department_id: '12345',
    payment_type: 'cash',
    currency: 'USD',
    currency_rate: 0.69,
    type: 'expense',
    memo: 'For travel expenses incurred on 2024-05-15',
    tax_rate: {
      id: '123456',
      rate: 10
    },
    total_amount: 275,
    line_items: [
      {
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        account_id: '123456',
        customer_id: '12345',
        department_id: '12345',
        location_id: '12345',
        tax_rate: {
          id: '123456',
          rate: 10
        },
        description: 'Travel US.',
        total_amount: 275,
        billable: true
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.expensesUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Invoice Item

Method: invoiceItemsAdd

accountingApi.invoiceItemsAdd(body)

Parameters

Name Type Description Notes
invoiceItem InvoiceItem
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateInvoiceItemResponse

HTTP response details

Status code Description
201 InvoiceItems
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  invoiceItem: {
    name: 'Model Y',
    description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
    code: '120-C',
    sold: true,
    purchased: true,
    tracked: true,
    taxable: true,
    inventory_date: '2020-10-30',
    type: 'inventory',
    sales_details: {
      unit_price: 27500.5,
      unit_of_measure: 'pc.',
      tax_inclusive: true,
      tax_rate: {
        id: '123456',
        rate: 10
      }
    },
    purchase_details: {
      unit_price: 27500.5,
      unit_of_measure: 'pc.',
      tax_inclusive: true,
      tax_rate: {
        id: '123456',
        rate: 10
      }
    },
    quantity: 1,
    unit_price: 27500.5,
    asset_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    income_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    expense_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    tracking_category: {
      id: '123456',
      name: 'New York'
    },
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    active: true,
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.invoiceItemsAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Invoice Items

Method: invoiceItemsAll

accountingApi.invoiceItemsAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter InvoiceItemsFilter Apply filters (optional)
sort InvoiceItemsSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetInvoiceItemsResponse

HTTP response details

Status code Description
200 InvoiceItems
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.invoiceItemsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Invoice Item

Method: invoiceItemsDelete

accountingApi.invoiceItemsDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteTaxRateResponse

HTTP response details

Status code Description
200 InvoiceItems
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.invoiceItemsDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Invoice Item

Method: invoiceItemsOne

accountingApi.invoiceItemsOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)
filter InvoiceItemFilter Apply filters (optional)

Response Type

GetInvoiceItemResponse

HTTP response details

Status code Description
200 InvoiceItems
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.invoiceItemsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Invoice Item

Method: invoiceItemsUpdate

accountingApi.invoiceItemsUpdate(body)

Parameters

Name Type Description Notes
invoiceItem InvoiceItem
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateInvoiceItemsResponse

HTTP response details

Status code Description
200 InvoiceItems
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  invoiceItem: {
    name: 'Model Y',
    description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
    code: '120-C',
    sold: true,
    purchased: true,
    tracked: true,
    taxable: true,
    inventory_date: '2020-10-30',
    type: 'inventory',
    sales_details: {
      unit_price: 27500.5,
      unit_of_measure: 'pc.',
      tax_inclusive: true,
      tax_rate: {
        id: '123456',
        rate: 10
      }
    },
    purchase_details: {
      unit_price: 27500.5,
      unit_of_measure: 'pc.',
      tax_inclusive: true,
      tax_rate: {
        id: '123456',
        rate: 10
      }
    },
    quantity: 1,
    unit_price: 27500.5,
    asset_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    income_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    expense_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    tracking_category: {
      id: '123456',
      name: 'New York'
    },
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    active: true,
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.invoiceItemsUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Invoice

Method: invoicesAdd

accountingApi.invoicesAdd(body)

Parameters

Name Type Description Notes
invoice Invoice
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateInvoiceResponse

HTTP response details

Status code Description
201 Invoice created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  invoice: {
    type: 'service',
    number: 'OIT00546',
    customer: {
      id: '12345',
      display_name: 'Windsurf Shop',
      name: 'Windsurf Shop',
      email: 'boring@boring.com'
    },
    company_id: '12345',
    invoice_date: '2020-09-30',
    due_date: '2020-09-30',
    terms: 'Net 30 days',
    po_number: '90000117',
    reference: '123456',
    status: 'draft',
    invoice_sent: true,
    currency: 'USD',
    currency_rate: 0.69,
    tax_inclusive: true,
    sub_total: 27500,
    total_tax: 2500,
    tax_code: '1234',
    discount_percentage: 5.5,
    discount_amount: 25,
    total: 27500,
    balance: 27500,
    deposit: 0,
    customer_memo: 'Thank you for your business and have a great day!',
    tracking_category: {
      id: '123456',
      name: 'New York'
    },
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    line_items: [
      {
        id: '12345',
        row_id: '12345',
        code: '120-C',
        line_number: 1,
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        type: 'sales_item',
        tax_amount: 27500,
        total_amount: 27500,
        quantity: 1,
        unit_price: 27500.5,
        unit_of_measure: 'pc.',
        discount_percentage: 0.01,
        discount_amount: 19.99,
        location_id: '1234',
        department_id: '1234',
        item: {
          id: '12344',
          code: '120-C',
          name: 'Model Y'
        },
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        custom_fields: [
          {
            id: '2389328923893298',
            name: 'employee_level',
            description: 'Employee Level',
            value: 'Uses Salesforce and Marketo'
          }
        ],
        row_version: '1-12345'
      }
    ],
    billing_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    shipping_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    template_id: '123456',
    source_document_url: 'https://www.invoicesolution.com/invoice/123456',
    payment_method: 'cash',
    channel: 'email',
    language: 'EN',
    accounting_by_row: false,
    bank_account: {
      bank_name: 'Monzo',
      account_number: '123465',
      account_name: 'SPACEX LLC',
      account_type: 'credit_card',
      iban: 'CH2989144532982975332',
      bic: 'AUDSCHGGXXX',
      routing_number: '012345678',
      bsb_number: '062-001',
      branch_identifier: '001',
      bank_code: 'BNH',
      currency: 'USD'
    },
    ledger_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.invoicesAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Invoices

Method: invoicesAll

accountingApi.invoicesAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter InvoicesFilter Apply filters (optional)
sort InvoicesSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetInvoicesResponse

HTTP response details

Status code Description
200 Invoices
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.invoicesAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Invoice

Method: invoicesDelete

accountingApi.invoicesDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteInvoiceResponse

HTTP response details

Status code Description
200 Invoice deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.invoicesDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Invoice

Method: invoicesOne

accountingApi.invoicesOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetInvoiceResponse

HTTP response details

Status code Description
200 Invoice
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.invoicesOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Invoice

Method: invoicesUpdate

accountingApi.invoicesUpdate(body)

Parameters

Name Type Description Notes
invoice Invoice
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateInvoiceResponse

HTTP response details

Status code Description
200 Invoice updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  invoice: {
    type: 'service',
    number: 'OIT00546',
    customer: {
      id: '12345',
      display_name: 'Windsurf Shop',
      name: 'Windsurf Shop',
      email: 'boring@boring.com'
    },
    company_id: '12345',
    invoice_date: '2020-09-30',
    due_date: '2020-09-30',
    terms: 'Net 30 days',
    po_number: '90000117',
    reference: '123456',
    status: 'draft',
    invoice_sent: true,
    currency: 'USD',
    currency_rate: 0.69,
    tax_inclusive: true,
    sub_total: 27500,
    total_tax: 2500,
    tax_code: '1234',
    discount_percentage: 5.5,
    discount_amount: 25,
    total: 27500,
    balance: 27500,
    deposit: 0,
    customer_memo: 'Thank you for your business and have a great day!',
    tracking_category: {
      id: '123456',
      name: 'New York'
    },
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    line_items: [
      {
        id: '12345',
        row_id: '12345',
        code: '120-C',
        line_number: 1,
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        type: 'sales_item',
        tax_amount: 27500,
        total_amount: 27500,
        quantity: 1,
        unit_price: 27500.5,
        unit_of_measure: 'pc.',
        discount_percentage: 0.01,
        discount_amount: 19.99,
        location_id: '1234',
        department_id: '1234',
        item: {
          id: '12344',
          code: '120-C',
          name: 'Model Y'
        },
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        custom_fields: [
          {
            id: '2389328923893298',
            name: 'employee_level',
            description: 'Employee Level',
            value: 'Uses Salesforce and Marketo'
          }
        ],
        row_version: '1-12345'
      }
    ],
    billing_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    shipping_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    template_id: '123456',
    source_document_url: 'https://www.invoicesolution.com/invoice/123456',
    payment_method: 'cash',
    channel: 'email',
    language: 'EN',
    accounting_by_row: false,
    bank_account: {
      bank_name: 'Monzo',
      account_number: '123465',
      account_name: 'SPACEX LLC',
      account_type: 'credit_card',
      iban: 'CH2989144532982975332',
      bic: 'AUDSCHGGXXX',
      routing_number: '012345678',
      bsb_number: '062-001',
      branch_identifier: '001',
      bank_code: 'BNH',
      currency: 'USD'
    },
    ledger_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.invoicesUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Journal Entry

Method: journalEntriesAdd

accountingApi.journalEntriesAdd(body)

Parameters

Name Type Description Notes
journalEntry JournalEntry
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateJournalEntryResponse

HTTP response details

Status code Description
201 JournalEntries
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  journalEntry: {
    title: 'Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry',
    currency_rate: 0.69,
    currency: 'USD',
    company_id: '12345',
    line_items: [
      {
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        tax_amount: 27500,
        sub_total: 27500,
        total_amount: 27500,
        type: 'debit',
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_category: {
          id: '123456',
          name: 'New York'
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        customer: {
          id: '12345',
          display_name: 'Windsurf Shop',
          name: 'Windsurf Shop',
          email: 'boring@boring.com'
        },
        supplier: {
          id: '12345',
          display_name: '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',
            street_number: '25',
            city: 'San Francisco',
            state: 'CA',
            postal_code: '94104',
            country: 'US',
            latitude: '40.759211',
            longitude: '-73.984638',
            county: 'Santa Clara',
            contact_name: 'Elon Musk',
            salutation: 'Mr',
            phone_number: '111-111-1111',
            fax: '122-111-1111',
            email: 'elon@musk.com',
            website: 'https://elonmusk.com',
            notes: 'Address notes or delivery instructions.',
            row_version: '1-12345'
          }
        },
        line_number: 1
      },
      {
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        tax_amount: 27500,
        sub_total: 27500,
        total_amount: 27500,
        type: 'debit',
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_category: {
          id: '123456',
          name: 'New York'
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        customer: {
          id: '12345',
          display_name: 'Windsurf Shop',
          name: 'Windsurf Shop',
          email: 'boring@boring.com'
        },
        supplier: {
          id: '12345',
          display_name: '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',
            street_number: '25',
            city: 'San Francisco',
            state: 'CA',
            postal_code: '94104',
            country: 'US',
            latitude: '40.759211',
            longitude: '-73.984638',
            county: 'Santa Clara',
            contact_name: 'Elon Musk',
            salutation: 'Mr',
            phone_number: '111-111-1111',
            fax: '122-111-1111',
            email: 'elon@musk.com',
            website: 'https://elonmusk.com',
            notes: 'Address notes or delivery instructions.',
            row_version: '1-12345'
          }
        },
        line_number: 1
      }
    ],
    memo: 'Thank you for your business and have a great day!',
    posted_at: '2020-09-30T07:43:32.000Z',
    journal_symbol: 'IND',
    tax_type: 'sales',
    tax_code: '1234',
    number: 'OIT00546',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    accounting_period: '01-24',
    row_version: '1-12345',
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.journalEntriesAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Journal Entries

Method: journalEntriesAll

accountingApi.journalEntriesAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter JournalEntriesFilter Apply filters (optional)
sort JournalEntriesSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetJournalEntriesResponse

HTTP response details

Status code Description
200 JournalEntry
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.journalEntriesAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Journal Entry

Method: journalEntriesDelete

accountingApi.journalEntriesDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteJournalEntryResponse

HTTP response details

Status code Description
200 JournalEntries
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.journalEntriesDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Journal Entry

Method: journalEntriesOne

accountingApi.journalEntriesOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetJournalEntryResponse

HTTP response details

Status code Description
200 JournalEntries
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.journalEntriesOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Journal Entry

Method: journalEntriesUpdate

accountingApi.journalEntriesUpdate(body)

Parameters

Name Type Description Notes
journalEntry JournalEntry
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateJournalEntryResponse

HTTP response details

Status code Description
200 JournalEntries
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  journalEntry: {
    title: 'Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry',
    currency_rate: 0.69,
    currency: 'USD',
    company_id: '12345',
    line_items: [
      {
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        tax_amount: 27500,
        sub_total: 27500,
        total_amount: 27500,
        type: 'debit',
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_category: {
          id: '123456',
          name: 'New York'
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        customer: {
          id: '12345',
          display_name: 'Windsurf Shop',
          name: 'Windsurf Shop',
          email: 'boring@boring.com'
        },
        supplier: {
          id: '12345',
          display_name: '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',
            street_number: '25',
            city: 'San Francisco',
            state: 'CA',
            postal_code: '94104',
            country: 'US',
            latitude: '40.759211',
            longitude: '-73.984638',
            county: 'Santa Clara',
            contact_name: 'Elon Musk',
            salutation: 'Mr',
            phone_number: '111-111-1111',
            fax: '122-111-1111',
            email: 'elon@musk.com',
            website: 'https://elonmusk.com',
            notes: 'Address notes or delivery instructions.',
            row_version: '1-12345'
          }
        },
        line_number: 1
      },
      {
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        tax_amount: 27500,
        sub_total: 27500,
        total_amount: 27500,
        type: 'debit',
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_category: {
          id: '123456',
          name: 'New York'
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        customer: {
          id: '12345',
          display_name: 'Windsurf Shop',
          name: 'Windsurf Shop',
          email: 'boring@boring.com'
        },
        supplier: {
          id: '12345',
          display_name: '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',
            street_number: '25',
            city: 'San Francisco',
            state: 'CA',
            postal_code: '94104',
            country: 'US',
            latitude: '40.759211',
            longitude: '-73.984638',
            county: 'Santa Clara',
            contact_name: 'Elon Musk',
            salutation: 'Mr',
            phone_number: '111-111-1111',
            fax: '122-111-1111',
            email: 'elon@musk.com',
            website: 'https://elonmusk.com',
            notes: 'Address notes or delivery instructions.',
            row_version: '1-12345'
          }
        },
        line_number: 1
      }
    ],
    memo: 'Thank you for your business and have a great day!',
    posted_at: '2020-09-30T07:43:32.000Z',
    journal_symbol: 'IND',
    tax_type: 'sales',
    tax_code: '1234',
    number: 'OIT00546',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    accounting_period: '01-24',
    row_version: '1-12345',
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.journalEntriesUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Ledger Account

Method: ledgerAccountsAdd

accountingApi.ledgerAccountsAdd(body)

Parameters

Name Type Description Notes
ledgerAccount LedgerAccount
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateLedgerAccountResponse

HTTP response details

Status code Description
201 LedgerAccount created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  ledgerAccount: {
    display_id: '1-12345',
    nominal_code: 'N091',
    code: '453',
    classification: 'asset',
    type: 'bank',
    sub_type: 'CHECKING_ACCOUNT',
    name: 'Bank account',
    fully_qualified_name: 'Asset.Bank.Checking_Account',
    description: 'Main checking account',
    opening_balance: 75000,
    current_balance: 20000,
    currency: 'USD',
    tax_type: 'NONE',
    tax_rate: {
      id: '123456',
      rate: 10
    },
    level: 1,
    active: true,
    status: 'active',
    header: true,
    bank_account: {
      bank_name: 'Monzo',
      account_number: '123465',
      account_name: 'SPACEX LLC',
      account_type: 'credit_card',
      iban: 'CH2989144532982975332',
      bic: 'AUDSCHGGXXX',
      routing_number: '012345678',
      bsb_number: '062-001',
      branch_identifier: '001',
      bank_code: 'BNH',
      currency: 'USD'
    },
    parent_account: {
      id: '12345',
      name: 'Bank Accounts',
      display_id: '1-1100'
    },
    sub_account: false,
    last_reconciliation_date: '2020-09-30',
    subsidiaries: [
      {
        id: 'string'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.ledgerAccountsAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Ledger Accounts

Method: ledgerAccountsAll

accountingApi.ledgerAccountsAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter LedgerAccountsFilter Apply filters (optional)
sort LedgerAccountsSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetLedgerAccountsResponse

HTTP response details

Status code Description
200 LedgerAccounts
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.ledgerAccountsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Ledger Account

Method: ledgerAccountsDelete

accountingApi.ledgerAccountsDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteLedgerAccountResponse

HTTP response details

Status code Description
200 LedgerAccount deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.ledgerAccountsDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Ledger Account

Method: ledgerAccountsOne

accountingApi.ledgerAccountsOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetLedgerAccountResponse

HTTP response details

Status code Description
200 LedgerAccount
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.ledgerAccountsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Ledger Account

Method: ledgerAccountsUpdate

accountingApi.ledgerAccountsUpdate(body)

Parameters

Name Type Description Notes
ledgerAccount LedgerAccount
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateLedgerAccountResponse

HTTP response details

Status code Description
200 LedgerAccount updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  ledgerAccount: {
    display_id: '1-12345',
    nominal_code: 'N091',
    code: '453',
    classification: 'asset',
    type: 'bank',
    sub_type: 'CHECKING_ACCOUNT',
    name: 'Bank account',
    fully_qualified_name: 'Asset.Bank.Checking_Account',
    description: 'Main checking account',
    opening_balance: 75000,
    current_balance: 20000,
    currency: 'USD',
    tax_type: 'NONE',
    tax_rate: {
      id: '123456',
      rate: 10
    },
    level: 1,
    active: true,
    status: 'active',
    header: true,
    bank_account: {
      bank_name: 'Monzo',
      account_number: '123465',
      account_name: 'SPACEX LLC',
      account_type: 'credit_card',
      iban: 'CH2989144532982975332',
      bic: 'AUDSCHGGXXX',
      routing_number: '012345678',
      bsb_number: '062-001',
      branch_identifier: '001',
      bank_code: 'BNH',
      currency: 'USD'
    },
    parent_account: {
      id: '12345',
      name: 'Bank Accounts',
      display_id: '1-1100'
    },
    sub_account: false,
    last_reconciliation_date: '2020-09-30',
    subsidiaries: [
      {
        id: 'string'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.ledgerAccountsUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Location

Method: locationsAdd

accountingApi.locationsAdd(body)

Parameters

Name Type Description Notes
location AccountingLocation
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateAccountingLocationResponse

HTTP response details

Status code Description
201 Location
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  location: {
    parent_id: '12345',
    company_name: 'SpaceX',
    display_name: '11 UT - South Jordan',
    status: 'active',
    addresses: [
      {
        id: '123',
        type: 'primary',
        string: '25 Spring Street, Blackburn, VIC 3130',
        name: 'HQ US',
        line1: 'Main street',
        line2: 'apt #',
        line3: 'Suite #',
        line4: 'delivery instructions',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    ],
    subsidiaries: [
      {
        name: 'SpaceX'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.locationsAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Locations

Method: locationsAll

accountingApi.locationsAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)
filter AccountingLocationsFilter Apply filters (optional)

Response Type

GetAccountingLocationsResponse

HTTP response details

Status code Description
200 Locations
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.locationsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Location

Method: locationsDelete

accountingApi.locationsDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteAccountingLocationResponse

HTTP response details

Status code Description
200 Location deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.locationsDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Location

Method: locationsOne

accountingApi.locationsOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetAccountingLocationResponse

HTTP response details

Status code Description
200 Location
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.locationsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Location

Method: locationsUpdate

accountingApi.locationsUpdate(body)

Parameters

Name Type Description Notes
location AccountingLocation
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateAccountingLocationResponse

HTTP response details

Status code Description
200 Location
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  location: {
    parent_id: '12345',
    company_name: 'SpaceX',
    display_name: '11 UT - South Jordan',
    status: 'active',
    addresses: [
      {
        id: '123',
        type: 'primary',
        string: '25 Spring Street, Blackburn, VIC 3130',
        name: 'HQ US',
        line1: 'Main street',
        line2: 'apt #',
        line3: 'Suite #',
        line4: 'delivery instructions',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    ],
    subsidiaries: [
      {
        name: 'SpaceX'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.locationsUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Payment

Method: paymentsAdd

accountingApi.paymentsAdd(body)

Parameters

Name Type Description Notes
payment Payment
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreatePaymentResponse

HTTP response details

Status code Description
201 Payment created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  payment: {
    currency: 'USD',
    currency_rate: 0.69,
    total_amount: 49.99,
    reference: '123456',
    payment_method: 'cash',
    payment_method_reference: '123456',
    payment_method_id: '12345',
    accounts_receivable_account_type: 'Account',
    accounts_receivable_account_id: '123456',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    transaction_date: '2021-05-01T12:00:00.000Z',
    customer: {
      id: '12345',
      display_name: 'Windsurf Shop',
      name: 'Windsurf Shop',
      email: 'boring@boring.com'
    },
    supplier: {
      display_name: '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',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    },
    company_id: '12345',
    reconciled: true,
    status: 'authorised',
    type: 'accounts_receivable',
    allocations: [
      {
        id: '123456',
        type: 'invoice',
        amount: 49.99,
        allocation_id: '123456'
      }
    ],
    note: 'Some notes about this transaction',
    number: '123456',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    display_id: '123456',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.paymentsAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Payments

Method: paymentsAll

accountingApi.paymentsAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter PaymentsFilter Apply filters (optional)
sort PaymentsSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetPaymentsResponse

HTTP response details

Status code Description
200 Payments
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.paymentsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Payment

Method: paymentsDelete

accountingApi.paymentsDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeletePaymentResponse

HTTP response details

Status code Description
200 Payment deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.paymentsDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Payment

Method: paymentsOne

accountingApi.paymentsOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetPaymentResponse

HTTP response details

Status code Description
200 Payment
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.paymentsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Payment

Method: paymentsUpdate

accountingApi.paymentsUpdate(body)

Parameters

Name Type Description Notes
payment Payment
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdatePaymentResponse

HTTP response details

Status code Description
200 Payment Updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  payment: {
    currency: 'USD',
    currency_rate: 0.69,
    total_amount: 49.99,
    reference: '123456',
    payment_method: 'cash',
    payment_method_reference: '123456',
    payment_method_id: '12345',
    accounts_receivable_account_type: 'Account',
    accounts_receivable_account_id: '123456',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    transaction_date: '2021-05-01T12:00:00.000Z',
    customer: {
      id: '12345',
      display_name: 'Windsurf Shop',
      name: 'Windsurf Shop',
      email: 'boring@boring.com'
    },
    supplier: {
      display_name: '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',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    },
    company_id: '12345',
    reconciled: true,
    status: 'authorised',
    type: 'accounts_receivable',
    allocations: [
      {
        id: '123456',
        type: 'invoice',
        amount: 49.99,
        allocation_id: '123456'
      }
    ],
    note: 'Some notes about this transaction',
    number: '123456',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    display_id: '123456',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.paymentsUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Profit And Loss

Method: profitAndLossOne

accountingApi.profitAndLossOne(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
filter ProfitAndLossFilter Apply filters (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetProfitAndLossResponse

HTTP response details

Status code Description
200 Profit & Loss Report
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.profitAndLossOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Purchase Order

Method: purchaseOrdersAdd

accountingApi.purchaseOrdersAdd(body)

Parameters

Name Type Description Notes
purchaseOrder PurchaseOrder
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreatePurchaseOrderResponse

HTTP response details

Status code Description
201 PurchaseOrders
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  purchaseOrder: {
    po_number: '90000117',
    reference: '123456',
    supplier: {
      id: '12345',
      display_name: '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',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    },
    company_id: '12345',
    status: 'open',
    issued_date: '2020-09-30',
    delivery_date: '2020-09-30',
    expected_arrival_date: '2020-09-30',
    currency: 'USD',
    currency_rate: 0.69,
    sub_total: 27500,
    total_tax: 2500,
    total: 27500,
    tax_inclusive: true,
    line_items: [
      {
        id: '12345',
        row_id: '12345',
        code: '120-C',
        line_number: 1,
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        type: 'sales_item',
        tax_amount: 27500,
        total_amount: 27500,
        quantity: 1,
        unit_price: 27500.5,
        unit_of_measure: 'pc.',
        discount_percentage: 0.01,
        discount_amount: 19.99,
        location_id: '1234',
        department_id: '1234',
        item: {
          id: '12344',
          code: '120-C',
          name: 'Model Y'
        },
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        custom_fields: [
          {
            id: '2389328923893298',
            name: 'employee_level',
            description: 'Employee Level',
            value: 'Uses Salesforce and Marketo'
          }
        ],
        row_version: '1-12345'
      }
    ],
    shipping_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    ledger_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    template_id: '123456',
    discount_percentage: 5.5,
    bank_account: {
      bank_name: 'Monzo',
      account_number: '123465',
      account_name: 'SPACEX LLC',
      account_type: 'credit_card',
      iban: 'CH2989144532982975332',
      bic: 'AUDSCHGGXXX',
      routing_number: '012345678',
      bsb_number: '062-001',
      branch_identifier: '001',
      bank_code: 'BNH',
      currency: 'USD'
    },
    accounting_by_row: false,
    due_date: '2020-10-30',
    payment_method: 'cash',
    tax_code: '1234',
    channel: 'email',
    memo: 'Thank you for the partnership and have a great day!',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.purchaseOrdersAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Purchase Orders

Method: purchaseOrdersAll

accountingApi.purchaseOrdersAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter PurchaseOrdersFilter Apply filters (optional)
sort PurchaseOrdersSort Apply sorting (optional)

Response Type

GetPurchaseOrdersResponse

HTTP response details

Status code Description
200 PurchaseOrders
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.purchaseOrdersAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Purchase Order

Method: purchaseOrdersDelete

accountingApi.purchaseOrdersDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeletePurchaseOrderResponse

HTTP response details

Status code Description
200 PurchaseOrders
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.purchaseOrdersDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Purchase Order

Method: purchaseOrdersOne

accountingApi.purchaseOrdersOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

GetPurchaseOrderResponse

HTTP response details

Status code Description
200 PurchaseOrders
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.purchaseOrdersOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Purchase Order

Method: purchaseOrdersUpdate

accountingApi.purchaseOrdersUpdate(body)

Parameters

Name Type Description Notes
purchaseOrder PurchaseOrder
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdatePurchaseOrderResponse

HTTP response details

Status code Description
200 PurchaseOrders
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  purchaseOrder: {
    po_number: '90000117',
    reference: '123456',
    supplier: {
      id: '12345',
      display_name: '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',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    },
    company_id: '12345',
    status: 'open',
    issued_date: '2020-09-30',
    delivery_date: '2020-09-30',
    expected_arrival_date: '2020-09-30',
    currency: 'USD',
    currency_rate: 0.69,
    sub_total: 27500,
    total_tax: 2500,
    total: 27500,
    tax_inclusive: true,
    line_items: [
      {
        id: '12345',
        row_id: '12345',
        code: '120-C',
        line_number: 1,
        description: 'Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.',
        type: 'sales_item',
        tax_amount: 27500,
        total_amount: 27500,
        quantity: 1,
        unit_price: 27500.5,
        unit_of_measure: 'pc.',
        discount_percentage: 0.01,
        discount_amount: 19.99,
        location_id: '1234',
        department_id: '1234',
        item: {
          id: '12344',
          code: '120-C',
          name: 'Model Y'
        },
        tax_rate: {
          id: '123456',
          rate: 10
        },
        tracking_categories: [
          {
            id: '123456',
            name: 'New York'
          }
        ],
        ledger_account: {
          id: '123456',
          nominal_code: 'N091',
          code: '453'
        },
        custom_fields: [
          {
            id: '2389328923893298',
            name: 'employee_level',
            description: 'Employee Level',
            value: 'Uses Salesforce and Marketo'
          }
        ],
        row_version: '1-12345'
      }
    ],
    shipping_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',
      street_number: '25',
      city: 'San Francisco',
      state: 'CA',
      postal_code: '94104',
      country: 'US',
      latitude: '40.759211',
      longitude: '-73.984638',
      county: 'Santa Clara',
      contact_name: 'Elon Musk',
      salutation: 'Mr',
      phone_number: '111-111-1111',
      fax: '122-111-1111',
      email: 'elon@musk.com',
      website: 'https://elonmusk.com',
      notes: 'Address notes or delivery instructions.',
      row_version: '1-12345'
    },
    ledger_account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    template_id: '123456',
    discount_percentage: 5.5,
    bank_account: {
      bank_name: 'Monzo',
      account_number: '123465',
      account_name: 'SPACEX LLC',
      account_type: 'credit_card',
      iban: 'CH2989144532982975332',
      bic: 'AUDSCHGGXXX',
      routing_number: '012345678',
      bsb_number: '062-001',
      branch_identifier: '001',
      bank_code: 'BNH',
      currency: 'USD'
    },
    accounting_by_row: false,
    due_date: '2020-10-30',
    payment_method: 'cash',
    tax_code: '1234',
    channel: 'email',
    memo: 'Thank you for the partnership and have a great day!',
    tracking_categories: [
      {
        id: '123456',
        name: 'New York'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.purchaseOrdersUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Subsidiary

Method: subsidiariesAdd

accountingApi.subsidiariesAdd(body)

Parameters

Name Type Description Notes
subsidiary Subsidiary
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateSubsidiaryResponse

HTTP response details

Status code Description
201 Subsidiaries
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  subsidiary: {
    parent_id: '12345',
    name: 'SpaceX',
    status: 'active',
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.subsidiariesAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Subsidiaries

Method: subsidiariesAll

accountingApi.subsidiariesAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetSubsidiariesResponse

HTTP response details

Status code Description
200 Subsidiaries
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.subsidiariesAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Subsidiary

Method: subsidiariesDelete

accountingApi.subsidiariesDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteSubsidiaryResponse

HTTP response details

Status code Description
200 Subsidiarys
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.subsidiariesDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Subsidiary

Method: subsidiariesOne

accountingApi.subsidiariesOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetSubsidiaryResponse

HTTP response details

Status code Description
200 Subsidiary
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.subsidiariesOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Subsidiary

Method: subsidiariesUpdate

accountingApi.subsidiariesUpdate(body)

Parameters

Name Type Description Notes
subsidiary Subsidiary
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateSubsidiaryResponse

HTTP response details

Status code Description
200 Subsidiaries
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  subsidiary: {
    parent_id: '12345',
    name: 'SpaceX',
    status: 'active',
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.subsidiariesUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Supplier

Method: suppliersAdd

accountingApi.suppliersAdd(body)

Parameters

Name Type Description Notes
supplier Supplier
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateSupplierResponse

HTTP response details

Status code Description
201 Supplier created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  supplier: {
    display_id: 'EMP00101',
    display_name: 'Windsurf Shop',
    company_name: 'SpaceX',
    company_id: '12345',
    title: 'CEO',
    first_name: 'Elon',
    middle_name: 'D.',
    last_name: 'Musk',
    suffix: 'Jr.',
    individual: true,
    addresses: [
      {
        id: '123',
        type: 'primary',
        string: '25 Spring Street, Blackburn, VIC 3130',
        name: 'HQ US',
        line1: 'Main street',
        line2: 'apt #',
        line3: 'Suite #',
        line4: 'delivery instructions',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    ],
    phone_numbers: [
      {
        id: '12345',
        country_code: '1',
        area_code: '323',
        number: '111-111-1111',
        extension: '105',
        type: 'primary'
      }
    ],
    emails: [
      {
        id: '123',
        email: 'elon@musk.com',
        type: 'primary'
      }
    ],
    websites: [
      {
        id: '12345',
        url: 'http://example.com',
        type: 'primary'
      }
    ],
    bank_accounts: [
      {
        bank_name: 'Monzo',
        account_number: '123465',
        account_name: 'SPACEX LLC',
        account_type: 'credit_card',
        iban: 'CH2989144532982975332',
        bic: 'AUDSCHGGXXX',
        routing_number: '012345678',
        bsb_number: '062-001',
        branch_identifier: '001',
        bank_code: 'BNH',
        currency: 'USD'
      }
    ],
    notes: 'Some notes about this supplier',
    tax_rate: {
      id: '123456',
      rate: 10
    },
    tax_number: 'US123945459',
    currency: 'USD',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    status: 'active',
    payment_method: 'cash',
    channel: 'email',
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ],
    subsidiary_id: '12345'
  }
}

try {
  const { data } = await apideck.accounting.suppliersAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Suppliers

Method: suppliersAll

accountingApi.suppliersAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter SuppliersFilter Apply filters (optional)
sort SuppliersSort Apply sorting (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetSuppliersResponse

HTTP response details

Status code Description
200 Suppliers
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.suppliersAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Supplier

Method: suppliersDelete

accountingApi.suppliersDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteSupplierResponse

HTTP response details

Status code Description
200 Supplier deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.suppliersDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Supplier

Method: suppliersOne

accountingApi.suppliersOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetSupplierResponse

HTTP response details

Status code Description
200 Supplier
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.suppliersOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Supplier

Method: suppliersUpdate

accountingApi.suppliersUpdate(body)

Parameters

Name Type Description Notes
supplier Supplier
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateSupplierResponse

HTTP response details

Status code Description
200 Supplier updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  supplier: {
    display_id: 'EMP00101',
    display_name: 'Windsurf Shop',
    company_name: 'SpaceX',
    company_id: '12345',
    title: 'CEO',
    first_name: 'Elon',
    middle_name: 'D.',
    last_name: 'Musk',
    suffix: 'Jr.',
    individual: true,
    addresses: [
      {
        id: '123',
        type: 'primary',
        string: '25 Spring Street, Blackburn, VIC 3130',
        name: 'HQ US',
        line1: 'Main street',
        line2: 'apt #',
        line3: 'Suite #',
        line4: 'delivery instructions',
        street_number: '25',
        city: 'San Francisco',
        state: 'CA',
        postal_code: '94104',
        country: 'US',
        latitude: '40.759211',
        longitude: '-73.984638',
        county: 'Santa Clara',
        contact_name: 'Elon Musk',
        salutation: 'Mr',
        phone_number: '111-111-1111',
        fax: '122-111-1111',
        email: 'elon@musk.com',
        website: 'https://elonmusk.com',
        notes: 'Address notes or delivery instructions.',
        row_version: '1-12345'
      }
    ],
    phone_numbers: [
      {
        id: '12345',
        country_code: '1',
        area_code: '323',
        number: '111-111-1111',
        extension: '105',
        type: 'primary'
      }
    ],
    emails: [
      {
        id: '123',
        email: 'elon@musk.com',
        type: 'primary'
      }
    ],
    websites: [
      {
        id: '12345',
        url: 'http://example.com',
        type: 'primary'
      }
    ],
    bank_accounts: [
      {
        bank_name: 'Monzo',
        account_number: '123465',
        account_name: 'SPACEX LLC',
        account_type: 'credit_card',
        iban: 'CH2989144532982975332',
        bic: 'AUDSCHGGXXX',
        routing_number: '012345678',
        bsb_number: '062-001',
        branch_identifier: '001',
        bank_code: 'BNH',
        currency: 'USD'
      }
    ],
    notes: 'Some notes about this supplier',
    tax_rate: {
      id: '123456',
      rate: 10
    },
    tax_number: 'US123945459',
    currency: 'USD',
    account: {
      id: '123456',
      nominal_code: 'N091',
      code: '453'
    },
    status: 'active',
    payment_method: 'cash',
    channel: 'email',
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ],
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ],
    subsidiary_id: '12345'
  }
}

try {
  const { data } = await apideck.accounting.suppliersUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Tax Rate

Method: taxRatesAdd

accountingApi.taxRatesAdd(body)

Parameters

Name Type Description Notes
taxRate TaxRate
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateTaxRateResponse

HTTP response details

Status code Description
201 TaxRate created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  taxRate: {
    id: '1234',
    name: 'GST on Purchases',
    code: 'ABN',
    description: 'Reduced rate GST Purchases',
    effective_tax_rate: 10,
    total_tax_rate: 10,
    tax_payable_account_id: '123456',
    tax_remitted_account_id: '123456',
    components: [
      {
        id: '10',
        name: 'GST',
        rate: 10,
        compound: true
      }
    ],
    type: 'NONE',
    report_tax_type: 'NONE',
    original_tax_rate_id: '12345',
    status: 'active',
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ],
    subsidiaries: [
      {
        id: 'string'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.taxRatesAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Tax Rates

Method: taxRatesAll

accountingApi.taxRatesAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
filter TaxRatesFilter Apply filters (optional)
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetTaxRatesResponse

HTTP response details

Status code Description
200 TaxRates
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.taxRatesAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Tax Rate

Method: taxRatesDelete

accountingApi.taxRatesDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteTaxRateResponse

HTTP response details

Status code Description
200 TaxRates deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.taxRatesDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Tax Rate

Method: taxRatesOne

accountingApi.taxRatesOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetTaxRateResponse

HTTP response details

Status code Description
200 TaxRate
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.taxRatesOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Tax Rate

Method: taxRatesUpdate

accountingApi.taxRatesUpdate(body)

Parameters

Name Type Description Notes
taxRate TaxRate
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateTaxRateResponse

HTTP response details

Status code Description
200 TaxRate updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  taxRate: {
    id: '1234',
    name: 'GST on Purchases',
    code: 'ABN',
    description: 'Reduced rate GST Purchases',
    effective_tax_rate: 10,
    total_tax_rate: 10,
    tax_payable_account_id: '123456',
    tax_remitted_account_id: '123456',
    components: [
      {
        id: '10',
        name: 'GST',
        rate: 10,
        compound: true
      }
    ],
    type: 'NONE',
    report_tax_type: 'NONE',
    original_tax_rate_id: '12345',
    status: 'active',
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ],
    subsidiaries: [
      {
        id: 'string'
      }
    ],
    custom_fields: [
      {
        id: '2389328923893298',
        name: 'employee_level',
        description: 'Employee Level',
        value: 'Uses Salesforce and Marketo'
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.taxRatesUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Tracking Category

Method: trackingCategoriesAdd

accountingApi.trackingCategoriesAdd(body)

Parameters

Name Type Description Notes
trackingCategory TrackingCategory
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)

Response Type

CreateTrackingCategoryResponse

HTTP response details

Status code Description
201 Tracking category created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  trackingCategory: {
    parent_id: '12345',
    name: 'Department',
    code: '100',
    status: 'active',
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ],
    subsidiaries: [
      {
        id: 'string'
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.trackingCategoriesAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Tracking Categories

Method: trackingCategoriesAll

accountingApi.trackingCategoriesAll(body)

Parameters

Name Type Description Notes
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20
passThrough PassThroughQuery Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetTrackingCategoriesResponse

HTTP response details

Status code Description
200 Tracking categories
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.accounting.trackingCategoriesAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Tracking Category

Method: trackingCategoriesDelete

accountingApi.trackingCategoriesDelete(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

DeleteTrackingCategoryResponse

HTTP response details

Status code Description
200 Tracking category deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.trackingCategoriesDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Tracking Category

Method: trackingCategoriesOne

accountingApi.trackingCategoriesOne(body)

Parameters

Name Type Description Notes
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false
fields [string] The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
(optional)

Response Type

GetTrackingCategoryResponse

HTTP response details

Status code Description
200 Tracking category
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example'
}

try {
  const { data } = await apideck.accounting.trackingCategoriesOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Tracking Category

Method: trackingCategoriesUpdate

accountingApi.trackingCategoriesUpdate(body)

Parameters

Name Type Description Notes
trackingCategory TrackingCategory
id [string] ID of the record you are acting upon.
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
serviceId [string] Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. (optional)
raw [boolean] Include raw response. Mostly used for debugging purposes (optional) defaults to false

Response Type

UpdateTrackingCategoryResponse

HTTP response details

Status code Description
200 Tracking category updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  id: 'id_example',
  trackingCategory: {
    parent_id: '12345',
    name: 'Department',
    code: '100',
    status: 'active',
    row_version: '1-12345',
    pass_through: [
      {
        service_id: 'string',
        operation_id: 'string',
        extend_object: {},
        extend_paths: [
          {
            path: '$.nested.property',
            value: [Object]
          }
        ]
      }
    ],
    subsidiaries: [
      {
        id: 'string'
      }
    ]
  }
}

try {
  const { data } = await apideck.accounting.trackingCategoriesUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]