Vic.ai API (0.20.0)

Download OpenAPI specification:Download

Introduction

The Vic.ai API provides a seamless connection between your Enterprise Resource Planning (ERP) system and the Vic.ai product suite.

The API is designed to offer three main areas of functionality:

  • Syncing master data: This refers to the data in your ERP that Vic.ai interacts with. You are required to supply and update this data in Vic.ai, and you also have the option to verify the copy of the masterdata in Vic.ai.

  • Syncing training data: We need historical data to train your AI model. To that end, the API provides endpoints to sync historical invoices into Vic.ai and to confirm their presence.

  • Subscribing to and receiving webhooks: Webhooks enable users or automated tasks to interact with your ERP through various actions in the Vic.ai product suite, such as posting an invoice, payment or purchase order or requesting synchronization. You will receive a notification via a webhook when these actions occur.

For US-based integrations, please use the following base API URL:

https://api.us.vic.ai/v0

For integrations based in Norway, use the following base API URL:

https://api.no.vic.ai/v0

All paths mentioned in this documentation should use one of these URLs as the base.

Example:

curl https://api.us.vic.ai/v0/healthCheck \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Getting Started

To begin interacting with the Vic.ai API, you will need the following credentials:

  • A Vic.ai client ID
  • A Vic.ai client secret.

These can be provided to you securely by a Vic.ai representative upon request.

Please note: These credentials are essentially the keys to your ERP integration. If they fall into the wrong hands, unauthorized parties could impersonate you, gain access to sensitive data, and potentially perform malicious actions. Therefore, it's crucial to keep these credentials safe at all times to protect your application's integrity and your clients' data.

Authentication

To initiate the authentication process, send a POST request to /v0/token with the payload as shown in the example below:

{
    "client_id": "VIC_CLIENT_ID",
    "client_secret": "VIC_CLIENT_SECRET"
}

Here is an example of how to do this:

curl -X POST https://api.us.vic.ai/v0/token \
    -H "Content-Type: application/json" \
    -d '{"client_id": "VIC_CLIENT_ID", "client_secret": "VIC_CLIENT_SECRET"}'

Upon providing a valid client ID and client secret, you should receive a response similar to the following:

{
    "access_token": "YOUR_ACCESS_TOKEN",
    "token_type": "Bearer",
    "expires_in": 3600
}

For subsequent calls, use the value in access_token in the Authorization field.

Here is an example:

curl https://api.us.vic.ai/v0/healthCheck \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

The response should resemble the following:

{"company":"Your Company Name","status":"PASS","version":"0.19.0"}

Obtain an access token

Use this endpoint to obtain an access token that can be used to authenticate subsequent requests to the API.

Request Body schema: application/json
required
client_id
required
string
client_secret
required
string

Responses

Request samples

Content type
application/json
{
  • "client_id": "string",
  • "client_secret": "string"
}

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "token_type": "Bearer",
  • "expires_in": 0
}

Pagination

The Vic.ai API leverages cursor-based pagination for traversing through data.

To fetch the next page of information, include the cursor parameter to the request. This value can be obtained from the X-next field in a previous response.

Example:

curl https://api.us.vic.ai/v0/accounts?cursor=foobar \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \

Accounts

GL (General Ledger) accounts are part of your ERP Masterdata. In order to be associated with an invoice line item, key data about the account must be stored in Vic.ai. These operations allow querying and manipulation of these GL account data.

List all accounts

Use this request to query the GL account data that are stored in Vic.ai.

Authorizations:
BearerAuth
query Parameters
limit
integer [ 1 .. 100 ]

How many items to return at one time (max 100) (default 100)

cursor
string

Which item to start from. See Pagination for more information.

since
string <date-time>

Datetime value for incremental updates. NOTE: For external datetimes, the expected format is not in UTC. for vic-internal datetimes (see SinceIsExternal) the format is UTC.

useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

sortOrder
string
Default: "ASCENDING"
Enum: "ASCENDING" "DESCENDING"

what sort order should be used for queries

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Info for a specific account

Use this request to get data for a single GL account that is stored in Vic.ai.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "number": "string",
  • "name": "string",
  • "externalData": { }
}

Upserts an account

Use this request to upsert GL account data for one GL account into Vic.ai. If the account is known by Vic.ai, the externalId supplied will be used to resolve the account and perform an update of the data, otherwise, a new account will be inserted. If the upsert action is part of a syncRequest, you should include the syncRequest ID in the X-Request-Id header.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

header Parameters
X-Request-Id
string <uuid>

token to be able to correctly log associated requests

Request Body schema: application/json
required
externalId
string (ExternalId) <= 255 characters

The external id set by the ERP system. It does not have to be a UUID and can be any non empty string desired.

externalUpdatedAt
required
string <date-time>

Does not have UTC normalization.

number
required
string <number>
name
required
string <= 255 characters
ExternalData (object) or null

Responses

Request samples

Content type
application/json
{
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "number": "string",
  • "name": "string",
  • "externalData": { }
}

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "number": "string",
  • "name": "string",
  • "externalData": { }
}

Deletes an account

Use this request to delete data for a single account that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "number": "string",
  • "name": "string",
  • "externalData": { }
}

Attachments

Attachments are original invoice documents that can be processed by Vic.ai.

Supported content types

  • application/msword
  • application/pdf
  • application/vnd.ms-word.document.macroEnabled.12
  • application/vnd.ms-word.template.macroEnabled.12
  • application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • application/vnd.openxmlformats-officedocument.wordprocessingml.template
  • image/tiff
  • text/xml (See note below about supported EDI formats)
  • image/jpg
  • image/jpeg
  • image/png
  • image/gif
  • application/vnd.ms-excel
  • application/vnd.ms-excel.addin.macroenabled.12
  • application/vnd.ms-excel.sheet.binary.macroenabled.12
  • application/vnd.ms-excel.sheet.macroenabled.12
  • application/vnd.ms-excel.template.macroenabled.12
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • application/vnd.openxmlformats-officedocument.spreadsheetml.template

Supported EDI formats:

PEPPOL BIS Billing v3

Supported embedded attachment MIME codes:

  • application/pdf
  • image/jpeg
  • image/png
  • image/tiff

The API will ignore other attachment types.

Upload an attachment

Use this to upload an attachment to Vic.ai. The attachment will be created and processing enqueued automatically.

The response is a 201 with the attachment ID.

Authorizations:
BearerAuth
Request Body schema: multipart/form-data
required
file
required
string <binary>

Responses

Response samples

Content type
application/json
{
  • "id": "47"
}

Dimensions

Dimensions are part of your ERP Masterdata, and represent business categories that are associated with invoice line items, that Vic.ai can automatically assign to invoice line items. These operations allow querying and manipulation of the dimension data.

List all dimensions

Use this request to query the dimensions data that are stored in Vic.ai.

Authorizations:
BearerAuth
query Parameters
limit
integer [ 1 .. 100 ]

How many items to return at one time (max 100) (default 100)

cursor
string

Which item to start from. See Pagination for more information.

since
string <date-time>

Datetime value for incremental updates. NOTE: For external datetimes, the expected format is not in UTC. for vic-internal datetimes (see SinceIsExternal) the format is UTC.

useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

sortOrder
string
Default: "ASCENDING"
Enum: "ASCENDING" "DESCENDING"

what sort order should be used for queries

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a dimension

Create a new dimension in Vic.ai.

Authorizations:
BearerAuth
Request Body schema: application/json
required

Create a dimension.

externalId
string (ExternalId) <= 255 characters

The external id set by the ERP system. It does not have to be a UUID and can be any non empty string desired.

externalUpdatedAt
required
string <date-time>

Does not have UTC normalization.

name
required
string <= 255 characters

The name of the dimension.

type
string <= 255 characters

The dimension type.

typeName
string <= 255 characters

The dimension type name.

typeExternalId
string <= 255 characters

The type's external ID in the ERP system. If left unspecified, it will clear the existing value.

shortName
string <= 255 characters
ExternalData (object) or null

Responses

Request samples

Content type
application/json
{
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "name": "string",
  • "type": "string",
  • "typeName": "string",
  • "typeExternalId": "string",
  • "shortName": "string",
  • "externalData": { }
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "type": "string",
  • "typeName": "string",
  • "typeExternalId": "string",
  • "shortName": "string",
  • "externalData": { },
  • "displayName": "string",
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154"
}

Info for a specific dimension

Use this request to get data for a single dimension that is stored in Vic.ai.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "type": "string",
  • "typeName": "string",
  • "typeExternalId": "string",
  • "shortName": "string",
  • "externalData": { },
  • "displayName": "string",
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154"
}

Upserts a dimension

Use this request to update or insert dimensions data for one dimension into Vic.ai. Note: The insert portion of this will be changed to no longer function and the createDimension operation should be used instead. If the dimension is known by Vic.ai, the externalId supplied will be used to resolve the dimension and perform an update of the data, otherwise, a new dimension will be inserted. If the upsert action is part of a syncRequest, you should include the syncRequest ID in the X-Request-Id header.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

header Parameters
X-Request-Id
string <uuid>

token to be able to correctly log associated requests

Request Body schema: application/json
required
externalId
string (ExternalId) <= 255 characters

The external id set by the ERP system. It does not have to be a UUID and can be any non empty string desired.

externalUpdatedAt
required
string <date-time>

Does not have UTC normalization.

name
required
string <= 255 characters

The name of the dimension.

type
string <= 255 characters

The dimension type.

typeName
string <= 255 characters

The dimension type name.

typeExternalId
string <= 255 characters

The type's external ID in the ERP system. If left unspecified, it will clear the existing value.

shortName
string <= 255 characters
ExternalData (object) or null

Responses

Request samples

Content type
application/json
{
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "name": "string",
  • "type": "string",
  • "typeName": "string",
  • "typeExternalId": "string",
  • "shortName": "string",
  • "externalData": { }
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "type": "string",
  • "typeName": "string",
  • "typeExternalId": "string",
  • "shortName": "string",
  • "externalData": { },
  • "displayName": "string",
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154"
}

Deletes a dimension

Use this request to delete data for a single dimension that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "type": "string",
  • "typeName": "string",
  • "typeExternalId": "string",
  • "shortName": "string",
  • "externalData": { },
  • "displayName": "string",
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154"
}

Invoices

These routes give you read-only access to two types of invoices:

  • Invoices which have not yet been posted to the ERP system (restricted access).
  • Invoices which have been posted to the ERP system.

List all invoices

Use this request to query the invoice data that are stored in Vic.ai.

Authorizations:
BearerAuth
query Parameters
limit
integer [ 1 .. 100 ]

How many items to return at one time (max 100) (default 100)

cursor
string

Which item to start from. See Pagination for more information.

useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

since
string <date-time>

Datetime value for incremental updates. NOTE: For external datetimes, the expected format is not in UTC. for vic-internal datetimes (see SinceIsExternal) the format is UTC.

sortOrder
string
Default: "ASCENDING"
Enum: "ASCENDING" "DESCENDING"

what sort order should be used for queries

InvoiceState (string) or any

selects the state of invoices which are to be searched (defaults to POSTED)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create an invoice.

When creating an invoice, there are three steps to follow:

  1. Create the invoice with a POST to /invoices
  2. Upload the document with a POST to /invoice/{id}/document
  3. Process the document with a POST to /invoice/{id}/process

You can make the id the internal id (from vic.ai) or the external id (from your system).

Note

The maximum file size allowed to upload is 64MB.

Authorizations:
BearerAuth
Request Body schema: application/json
required
InvoiceExternalId (string) or null

The external id if it is known within the external system. This field can be null.

string or null

Where the invoice originated from.

transactionType
required
string (TransactionType)
Enum: "INVOICE" "CREDITNOTE"

The type of invoice transaction.

refNumber
string <= 255 characters

Number that appears on the invoice.

string or null
string or null
MonetaryValue (string)

The total amount of the invoice, including tax/VAT.

currency
string <ISO-4217> <= 3 characters

The currency code the invoice is in.

Language (string) or null
issueDate
string <date>

The date the invoice was issued on.

glDate
string <date>
dueDate
string <date>

The date the invoice is due on.

string or null
string or null
string or null
paymentRef
string <= 255 characters

The payment reference number. The KID is a customer identification number that is mandatory for invoices in Norway.

InvoicePaymentInfo (object) or null
InvoicePaymentTerm (object) or null

The payment term the invoice should be paid in. If the term is not known, pass null here.

CreditAccountRef (object) or null
(VendorLookup (VendorLookupByInternalId (object) or VendorLookupByExternalId (object) or VendorLookupByName (object) or VendorLookupByOrgNumberAndBankAccount (object) or VendorLookupByOrgNumber (object))) or null
Array of objects (CreateInvoiceLineItem)
Array of objects (BillOfLadingNumber)
Array of objects (InvoiceFieldInput)

Responses

Request samples

Content type
application/json
{
  • "externalId": "string",
  • "source": "Millum",
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "totalAmount": "1.00",
  • "currency": "str",
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "accountNumber": "string",
  • "servicePeriodStart": "2019-08-24",
  • "servicePeriodEnd": "2019-08-24",
  • "paymentRef": "string",
  • "paymentInfo": {
    },
  • "paymentTerm": {
    },
  • "creditAccount": {
    },
  • "vendor": {
    },
  • "lineItems": [
    ],
  • "bolNumbers": [
    ],
  • "fields": [
    ]
}

Response samples

Content type
application/json
{
  • "totalAmount": "1.00",
  • "amountWithoutTax": "1.00",
  • "amountTax": "1.00",
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "USD",
  • "customFields": [
    ],
  • "fields": [
    ],
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "source": "Millum",
  • "internalId": "string",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "string",
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "paymentTerm": {
    },
  • "paymentRef": "string",
  • "vendorInternalId": "47",
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "vendor": {
    },
  • "lineItems": [
    ],
  • "postingError": "string",
  • "documentUrl": "string",
  • "status": "NOT_READY",
  • "bolNumbers": [
    ],
  • "selfAssessedUseTaxAmount": "1.00",
  • "selfAssessedUseTaxAccount": "string"
}

Info for a specific invoice

Use this request to get data for a single invoice that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "totalAmount": "1.00",
  • "amountWithoutTax": "1.00",
  • "amountTax": "1.00",
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "USD",
  • "customFields": [
    ],
  • "fields": [
    ],
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "source": "Millum",
  • "internalId": "string",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "string",
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "paymentTerm": {
    },
  • "paymentRef": "string",
  • "vendorInternalId": "47",
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "vendor": {
    },
  • "lineItems": [
    ],
  • "postingError": "string",
  • "documentUrl": "string",
  • "status": "NOT_READY",
  • "bolNumbers": [
    ],
  • "selfAssessedUseTaxAmount": "1.00",
  • "selfAssessedUseTaxAccount": "string"
}

Asynchronous reply to invoice post or invoice transfer

Use this request to indicate that an invoice has been posted or transferred to the ERP system, in the case where you have not activated a subscription, or you have responded to the subscription with a 202-asynchronous response. Note that this operation can either be a confirmation, or a rejection, depending on the shape of the payload. Possible payloads:

  • InvoiceConfirm: used to confirm that the invoice data have been successfully posted to the ERP, possibly including a postingError.
    • Use of this postingError means that the invoice data are posted, but some secondary content needs amendation in the ERP that cannot be performed from the vic user interface (for example: a problem uploading the posted document).
  • InvoiceReject: used to communicate that the invoice data have NOT been successfully posted to the ERP, due to invalid data. This should NOT be used to communicate an error in posting due to a general failure such as a network issue or an availability issue with the ERP, in those or similar cases, a retry should be performed without notifying the vic system. Currently unsupported:
  • InvoiceClearError: the error set in an InvoiceConfirm operation should be cleared because the postingError has been resolved in the ERP. This cannot be used to clear an error due to InvoiceReject. Note that :id must be internalId for this route.
Authorizations:
BearerAuth
path Parameters
id
required
string

The internalId of the invoice which should be confirmed.

Request Body schema: application/json
required
One of
externalId
required
string (ExternalId) <= 255 characters

The external id set by the ERP system. It does not have to be a UUID and can be any non empty string desired.

externalUpdatedAt
required
string <date-time>
postingError
string

Responses

Request samples

Content type
application/json
Example
{
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "postingError": "string"
}

Response samples

Content type
application/json
{
  • "totalAmount": "1.00",
  • "amountWithoutTax": "1.00",
  • "amountTax": "1.00",
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "USD",
  • "customFields": [
    ],
  • "fields": [
    ],
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "source": "Millum",
  • "internalId": "string",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "string",
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "paymentTerm": {
    },
  • "paymentRef": "string",
  • "vendorInternalId": "47",
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "vendor": {
    },
  • "lineItems": [
    ],
  • "postingError": "string",
  • "documentUrl": "string",
  • "status": "NOT_READY",
  • "bolNumbers": [
    ],
  • "selfAssessedUseTaxAmount": "1.00",
  • "selfAssessedUseTaxAccount": "string"
}

Deletes an invoice

Use this request to delete data for a single invoice that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

string or null

selects the comment which is to be displayed

Responses

Response samples

Content type
application/json
{
  • "code": 100,
  • "message": "string"
}

Start the invoice processing.

Tells Vic that the invoice is ready to start being processed. Once this is called, it may not be called again.

Authorizations:
BearerAuth
path Parameters
id
required
string

The Invoice internal id or external id.

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "totalAmount": "1.00",
  • "amountWithoutTax": "1.00",
  • "amountTax": "1.00",
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "USD",
  • "customFields": [
    ],
  • "fields": [
    ],
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "source": "Millum",
  • "internalId": "string",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "string",
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "paymentTerm": {
    },
  • "paymentRef": "string",
  • "vendorInternalId": "47",
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "vendor": {
    },
  • "lineItems": [
    ],
  • "postingError": "string",
  • "documentUrl": "string",
  • "status": "NOT_READY",
  • "bolNumbers": [
    ],
  • "selfAssessedUseTaxAmount": "1.00",
  • "selfAssessedUseTaxAccount": "string"
}

Document for a specific invoice

Use this request to get the document associated with a single invoice that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The Invoice internal id or external id.

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "code": 100,
  • "message": "string"
}

Upload document invoice

This attaches a document to the invoice for processing. An external id must be specified for an invoice prior to calling this.

  • Once an invoice has been processed, you may not attach a new document.
  • Once a document has been attached to an invoice, it may not be changed. NOTE: The maximum file size allowed is 64MB.
Authorizations:
BearerAuth
path Parameters
id
required
string

The Invoice internal id or external id.

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Request Body schema: multipart/form-data
required
document
required
string <binary>

Responses

Response samples

Content type
application/json
{
  • "totalAmount": "1.00",
  • "amountWithoutTax": "1.00",
  • "amountTax": "1.00",
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "USD",
  • "customFields": [
    ],
  • "fields": [
    ],
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "source": "Millum",
  • "internalId": "string",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "string",
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "paymentTerm": {
    },
  • "paymentRef": "string",
  • "vendorInternalId": "47",
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "vendor": {
    },
  • "lineItems": [
    ],
  • "postingError": "string",
  • "documentUrl": "string",
  • "status": "NOT_READY",
  • "bolNumbers": [
    ],
  • "selfAssessedUseTaxAmount": "1.00",
  • "selfAssessedUseTaxAccount": "string"
}

Asynchronous reply to invoice post or invoice transfer

Used to confirm that the invoice data have been successfully posted to the ERP, possibly including a postingError. Use of this postingError means that the invoice data are posted, but some secondary content needs amendation in the ERP that cannot be performed from the vic user interface (for example: a problem uploading the posted document). Note: id must be the internalId of the invoice.

Authorizations:
BearerAuth
path Parameters
id
required
string

The internalId of the invoice which should be confirmed.

Request Body schema: application/json
required
externalId
required
string (ExternalId) <= 255 characters

The external id set by the ERP system. It does not have to be a UUID and can be any non empty string desired.

externalUpdatedAt
required
string <date-time>
postingError
string

Responses

Request samples

Content type
application/json
{
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "postingError": "string"
}

Response samples

Content type
application/json
{
  • "totalAmount": "1.00",
  • "amountWithoutTax": "1.00",
  • "amountTax": "1.00",
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "USD",
  • "customFields": [
    ],
  • "fields": [
    ],
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "source": "Millum",
  • "internalId": "string",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "string",
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "paymentTerm": {
    },
  • "paymentRef": "string",
  • "vendorInternalId": "47",
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "vendor": {
    },
  • "lineItems": [
    ],
  • "postingError": "string",
  • "documentUrl": "string",
  • "status": "NOT_READY",
  • "bolNumbers": [
    ],
  • "selfAssessedUseTaxAmount": "1.00",
  • "selfAssessedUseTaxAccount": "string"
}

Asynchronous reply to invoice post

Used to communicate that the invoice data have NOT been successfully posted to the ERP, due to invalid data. This should NOT be used to communicate an error in posting due to a general failure such as a network issue or an availability issue with the ERP, in those or similar cases, a retry should be performed without notifying the vic system. Note: id must be the internalId of the invoice.

Authorizations:
BearerAuth
path Parameters
id
required
string

The internalId of the invoice which should be confirmed.

Request Body schema: application/json
required
required
integer or null
required
string or null
reason
required
string

Responses

Request samples

Content type
application/json
{
  • "item": 0,
  • "field": "string",
  • "reason": "string"
}

Response samples

Content type
application/json
{
  • "totalAmount": "1.00",
  • "amountWithoutTax": "1.00",
  • "amountTax": "1.00",
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "USD",
  • "customFields": [
    ],
  • "fields": [
    ],
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "source": "Millum",
  • "internalId": "string",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "string",
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "paymentTerm": {
    },
  • "paymentRef": "string",
  • "vendorInternalId": "47",
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "vendor": {
    },
  • "lineItems": [
    ],
  • "postingError": "string",
  • "documentUrl": "string",
  • "status": "NOT_READY",
  • "bolNumbers": [
    ],
  • "selfAssessedUseTaxAmount": "1.00",
  • "selfAssessedUseTaxAccount": "string"
}

line items for a specific invoice

List all of the line items for the invoice. NOTE: They are ungrouped so that you may inspect and modify them as necessary.

Authorizations:
BearerAuth
path Parameters
id
required
string

The Invoice internal id or external id.

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Invoices for training

Invoices used for training AI models.

List all training invoices

Use this request to query the training invoice data that are stored in Vic.ai.

Authorizations:
BearerAuth
query Parameters
limit
integer [ 1 .. 100 ]

How many items to return at one time (max 100) (default 100)

cursor
string

Which item to start from. See Pagination for more information.

since
string <date-time>

Datetime value for incremental updates. NOTE: For external datetimes, the expected format is not in UTC. for vic-internal datetimes (see SinceIsExternal) the format is UTC.

sortOrder
string
Default: "ASCENDING"
Enum: "ASCENDING" "DESCENDING"

what sort order should be used for queries

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Info for a specific training invoice

Use this request to get data for a single training invoice that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

Responses

Response samples

Content type
application/json
{
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "string",
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "lineItems": [
    ],
  • "externalData": { },
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "bolNumbers": [
    ],
  • "fields": [
    ]
}

Upserts a training invoice

Use this request to upsert training invoice data for one invoice into Vic.ai.

When putting a new invoice into the system, an invoiceDocument will be required. If the training invoice already exists, an invoiceDocument will not be required.

All requests that need to have the invoiceDocument updated should have a multipart/form-data content type.

If the training invoice just needs to be updated without a document specified a content type of application/json is permitted.

If the invoice is known by Vic.ai, the externalId supplied will be used to resolve the invoice and perform an update of the data, otherwise, a new invoice will be created.

When updating a training invoice, the invoiceDocument is no longer required, and the Content-Type can be application/json

If the training invoice needs the underlying document updated, use a multipart/form-data to accomplish this. It will have the same format as the insert described above.

Some things to note about updating existing invoices.

  • The line items passed will be set as the desired state of the invoice.
  • Empty list of line items will cause all line items to be deleted.
  • Existing line items passed will be matched as best as possible. If they can not be matched they will be deleted and replaced with the desired items.
Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

Request Body schema: multipart/form-data
required
required
object (TrainingInvoiceUpsert)
invoiceDocument
string <binary>

Responses

Response samples

Content type
application/json
{
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "string",
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "lineItems": [
    ],
  • "externalData": { },
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "bolNumbers": [
    ],
  • "fields": [
    ]
}

Deletes a training invoice

Use this request to delete data for a single training invoice that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

Responses

Response samples

Content type
application/json
{
  • "transactionType": "INVOICE",
  • "refNumber": "string",
  • "poNumber": "string",
  • "description": "string",
  • "currency": "string",
  • "language": "en",
  • "issueDate": "2019-08-24",
  • "glDate": "2019-08-24",
  • "dueDate": "2019-08-24",
  • "paymentInfo": {
    },
  • "invoiceInfo": {
    },
  • "vendorExternalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "lineItems": [
    ],
  • "externalData": { },
  • "externalUpdatedAt": "2019-08-24T14:15:22Z",
  • "bolNumbers": [
    ],
  • "fields": [
    ]
}

Document for a specific training invoice

Use this request to get the document associated with a training invoice that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

Responses

Response samples

Content type
application/json
{
  • "code": 100,
  • "message": "string"
}

Payment batches

Payment batches are a collection of payments that are made to vendors.

List all payment batches

List all payment batches.

Authorizations:
BearerAuth
query Parameters
completedAtOrAfter
string <date-time>

Filter batches that were completed at or after the date time provided. This can be used in combination with completedAtOrBefore.

completedAtOrBefore
string <date-time>

Filter batches that were completed at or before the date time provided. This can be used in combination with completedAtOrAfter.

PaymentBatchStatus (string) or any

Selects the payment batches that match the status provided. When left unspecified, it is the same as if all was specified.

limit
integer [ 1 .. 100 ]

How many items to return at one time (max 100) (default 100)

cursor
string

Which item to start from. See Pagination for more information.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a payment batch

The batches returned may include payments and credits that could be rejected or voided. This is by design. If you are synchronizing with an ERP, it is most likely safe to discard the rejected payments or credits. When payments or credits are voided, this can happen for a variety of reasons.

The payment provider can not process that payment due to an error.
The vendor attached to that payment is missing required information or is no longer valid.
A stop payment was issued outside of Vic and support has had to go remediate.

By no means is this list exhaustive and if you have questions, please reach out to support.

Authorizations:
BearerAuth
path Parameters
id
required
string

The ID of the payment batch.

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "companyId": "string",
  • "processedAt": "2019-08-24T14:15:22Z",
  • "completedAt": "2019-08-24T14:15:22Z",
  • "approvedAt": "2019-08-24T14:15:22Z",
  • "rejectedAt": "2019-08-24T14:15:22Z",
  • "voidedAt": "2019-08-24T14:15:22Z",
  • "status": "pending_approval",
  • "payments": [
    ],
  • "credits": [
    ]
}

Payment terms

Payment terms are part of your ERP Masterdata, and represent payment terms that Vic.ai can automatically assign to invoices. Some vendors may have a default payment term, and some invoices may have a specific payment term. In either case, Vic.ai can automatically assign payment terms to invoices.

Get a list of payment terms

Get a list of payment terms.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "daysToPay": 1,
  • "description": "string",
  • "discountDays": 0,
  • "discountPercentage": "string"
}

Create a new payment term

Create a new payment term.

Authorizations:
BearerAuth
Request Body schema: application/json
required

Create a payment term.

required
string or null
daysToPay
required
integer >= 1

The number of days the invoice should be paid in.

string or null
integer or null
string or null

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "daysToPay": 1,
  • "description": "string",
  • "discountDays": 0,
  • "discountPercentage": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "daysToPay": 1,
  • "description": "string",
  • "discountDays": 0,
  • "discountPercentage": "string"
}

Update a payment term

Update a payment term.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the payment term

Request Body schema: application/json
required

Update a payment term.

required
string or null
daysToPay
required
integer >= 1

The number of days the invoice should be paid in.

string or null
integer or null
string or null

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "daysToPay": 1,
  • "description": "string",
  • "discountDays": 0,
  • "discountPercentage": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "daysToPay": 1,
  • "description": "string",
  • "discountDays": 0,
  • "discountPercentage": "string"
}

Delete a payment term

Delete a payment term.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the payment term

Responses

Response samples

Content type
application/json
{
  • "code": 100,
  • "message": "string"
}

Purchase orders

The purchase orders.

List purchase orders

List purchase orders.

Authorizations:
BearerAuth
query Parameters
limit
integer [ 1 .. 100 ]

How many items to return at one time (max 100) (default 100)

cursor
string

Which item to start from. See Pagination for more information.

since
string <date-time>

Datetime value for incremental updates. NOTE: For external datetimes, the expected format is not in UTC. for vic-internal datetimes (see SinceIsExternal) the format is UTC.

upto
string <date-time>

Datetime value for decremental updates.

status
string (PurchaseOrderStatus)
Default: "open"
Enum: "open" "closed"

selects the status of purchase orders which are to be searched

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a purchase order

Creates a purchase order in the Vic.ai system.

You are responsible for setting the amount on the purchase order which is the summation of all the purchase order line items.

Once the purchase order has been created and all manipulations are finished, you must call the processPurchaseOrder operation.

Optionally, to set a requestor, you can pass a requestor object with email or name.

Optionally, to set a site owner, you can pass a siteOwner object with email or name.

Authorizations:
BearerAuth
Request Body schema: application/json

Create a purchase order.

PurchaseOrderExternalId (string) or null
required
string or null
poNumber
required
string <= 255 characters

The purchase order number. This is used to match against invoices.

string or null
amount
required
string <decimal> (MonetaryValue)

The monetary value as a string. A float should not be used. The api will accept a float and it will be transformed into a monetary value, but for best results please use a string with the proper decimal precision.

Currency (string)

The currency that the purchase order uses.

string or null

The description of the purchase order.

PurchaseOrderRequestor (object) or null
PurchaseOrderSiteOwner (object) or null
string or null

When the purchase order was created.

required
(VendorLookup (VendorLookupByInternalId (object) or VendorLookupByExternalId (object) or VendorLookupByName (object) or VendorLookupByOrgNumberAndBankAccount (object) or VendorLookupByOrgNumber (object)))

The vendor of the purchase order.

required
Array of objects (CreatePurchaseOrderItem)

Responses

Request samples

Content type
application/json
{
  • "externalId": "string",
  • "issuedOn": "2019-08-24",
  • "poNumber": "12003400",
  • "deliverOn": "2019-08-24",
  • "amount": "1.00",
  • "currencyId": "USD",
  • "description": "string",
  • "requestor": {
    },
  • "siteOwner": {
    },
  • "createdOn": "2019-08-24",
  • "vendor": {
    },
  • "lineItems": [
    ]
}

Response samples

Content type
application/json
{
  • "internalId": "string",
  • "externalId": "string",
  • "vendor": {
    },
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "issuedOn": "2019-08-24",
  • "poNumber": "string",
  • "deliverOn": "2019-08-24",
  • "amount": "1.00",
  • "currencyId": "USD",
  • "status": "open",
  • "description": "string",
  • "lineItems": [
    ]
}

Get a purchase order

Get a purchase order.

Authorizations:
BearerAuth
path Parameters
purchaseOrderId
required
string

The internal id of the purchase order.

Responses

Response samples

Content type
application/json
{
  • "internalId": "string",
  • "externalId": "string",
  • "vendor": {
    },
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "issuedOn": "2019-08-24",
  • "poNumber": "string",
  • "deliverOn": "2019-08-24",
  • "amount": "1.00",
  • "currencyId": "USD",
  • "status": "open",
  • "description": "string",
  • "lineItems": [
    ]
}

Update a purchase order

Update a purchase order. Once finished updating the purchase order you should also also call processPurchaseOrder to kick off reprocessing purchase order matching.

Authorizations:
BearerAuth
path Parameters
purchaseOrderId
required
string

The id of the purchase order.

Request Body schema: application/json

Create a purchase order.

PurchaseOrderExternalId (string) or null
string or null

When the purchase order was issued.

poNumber
required
string <= 255 characters

The purchase order number. This is used to match against invoices.

string or null
amount
required
string <decimal> (MonetaryValue)

The monetary value as a string. A float should not be used. The api will accept a float and it will be transformed into a monetary value, but for best results please use a string with the proper decimal precision.

Currency (string)

The currency that the purchase order uses.

string or null

The description of the purchase order.

PurchaseOrderRequestor (object) or null
PurchaseOrderSiteOwner (object) or null
string or null

When the purchase order was created.

required
(VendorLookup (VendorLookupByInternalId (object) or VendorLookupByExternalId (object) or VendorLookupByName (object) or VendorLookupByOrgNumberAndBankAccount (object) or VendorLookupByOrgNumber (object)))

The vendor of the purchase order.

Responses

Request samples

Content type
application/json
{
  • "externalId": "string",
  • "issuedOn": "2019-08-24",
  • "poNumber": "12003400",
  • "deliverOn": "2019-08-24",
  • "amount": "1.00",
  • "currencyId": "USD",
  • "description": "string",
  • "requestor": {
    },
  • "siteOwner": {
    },
  • "createdOn": "2019-08-24",
  • "vendor": {
    }
}

Response samples

Content type
application/json
{
  • "internalId": "string",
  • "externalId": "string",
  • "vendor": {
    },
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "issuedOn": "2019-08-24",
  • "poNumber": "string",
  • "deliverOn": "2019-08-24",
  • "amount": "1.00",
  • "currencyId": "USD",
  • "status": "open",
  • "description": "string",
  • "lineItems": [
    ]
}

Delete a purchase order

Delete a purchase order. Once finished updating the purchase order you should also also call processPurchaseOrder to kick off reprocessing purchase order matching.

Authorizations:
BearerAuth
path Parameters
purchaseOrderId
required
string

The internal id of the purchase order.

Responses

Response samples

Content type
application/json
{
  • "code": 100,
  • "message": "string"
}

Process the purchase order

When the purchase order modifications are completed use this operation to let Vic know that it is ready to be processed. Once a purchase order is being processed, it can not be modified until completed.

Authorizations:
BearerAuth
path Parameters
purchaseOrderId
required
string

The internal id of the purchase order.

Responses

Response samples

Content type
application/json
{
  • "internalId": "string",
  • "externalId": "string",
  • "vendor": {
    },
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "issuedOn": "2019-08-24",
  • "poNumber": "string",
  • "deliverOn": "2019-08-24",
  • "amount": "1.00",
  • "currencyId": "USD",
  • "status": "open",
  • "description": "string",
  • "lineItems": [
    ]
}

Close a purchase order

Closes a purchase order.

Authorizations:
BearerAuth
path Parameters
purchaseOrderId
required
string

The internal id of the purchase order.

Responses

Response samples

Content type
application/json
{
  • "internalId": "string",
  • "externalId": "string",
  • "vendor": {
    },
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "issuedOn": "2019-08-24",
  • "poNumber": "string",
  • "deliverOn": "2019-08-24",
  • "amount": "1.00",
  • "currencyId": "USD",
  • "status": "open",
  • "description": "string",
  • "lineItems": [
    ]
}

Opens a purchase order

Opens a purchase order.

Authorizations:
BearerAuth
path Parameters
purchaseOrderId
required
string

The internal id of the purchase order.

Responses

Response samples

Content type
application/json
{
  • "internalId": "string",
  • "externalId": "string",
  • "vendor": {
    },
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "issuedOn": "2019-08-24",
  • "poNumber": "string",
  • "deliverOn": "2019-08-24",
  • "amount": "1.00",
  • "currencyId": "USD",
  • "status": "open",
  • "description": "string",
  • "lineItems": [
    ]
}

Add a line item to a purchase order.

Create a purchase order's line item.

Caution should be taken when creating a new line item in a purchase order. Each purchase order line item must have a line number and it must be unique among the other line items. It should be a non negative value.

Note: This action will change purchase order status from closed to open, if the purchase order is closed.

After creating the new purchase order line item, you must update the the purchase order's amount field. This should be done once you are finished manipulating all of the line items.

Once you are finished manipulating the purchase order you will need to call the processPurchaseOrder operation to kick off the matching process based on the updated information.

Authorizations:
BearerAuth
Request Body schema: application/json

Create a purchase order line item.

purchaseOrderId
required
string

The ID of the purchase order to attach this line item to.

required
string or null
string or null
UnitOfMeasure (string) or null
quantityAccepted
string <decimal>

The quantity accepted. Required when matchingType set to FOUR_WAY.

quantityReceived
string <decimal>

The quantity received. Required when matchingType set to THREE_WAY (default) or FOUR_WAY.

quantityRequested
required
string <decimal>

The quantity requested. Required for all matchingType values.

matchingType
string (PurchaseOrderLineItemMatchingType)
Enum: "TWO_WAY" "THREE_WAY" "FOUR_WAY"

The type of matching that should be done on the line item. Determines which quantity fields are required. TWO_WAY - Only the quantityRequested field is required. THREE_WAY (default) - The quantityRequested and quantityReceived fields are required. FOUR_WAY - The quantityRequested, quantityReceived, and quantityAccepted fields are required.

unitAmount
required
string <decimal> (MonetaryValue)

The monetary value as a string. A float should not be used. The api will accept a float and it will be transformed into a monetary value, but for best results please use a string with the proper decimal precision.

lineItemTotal
required
string <decimal> (MonetaryValue)

The monetary value as a string. A float should not be used. The api will accept a float and it will be transformed into a monetary value, but for best results please use a string with the proper decimal precision.

lineNumber
required
integer >= 1
Array of objects (DimensionRef)

Responses

Request samples

Content type
application/json
{
  • "purchaseOrderId": "string",
  • "productNumber": "string",
  • "productDescription": "string",
  • "unitOfMeasure": "kg",
  • "quantityAccepted": "1.0",
  • "quantityReceived": "12.3",
  • "quantityRequested": "1.0",
  • "matchingType": "TWO_WAY",
  • "unitAmount": "1.00",
  • "lineItemTotal": "1.00",
  • "lineNumber": 1,
  • "dimensions": [
    ]
}

Response samples

Content type
application/json
{
  • "internalId": "string",
  • "productNumber": "string",
  • "productDescription": "string",
  • "unitOfMeasure": "kg",
  • "quantityAccepted": "1.0",
  • "quantityRequested": "1.0",
  • "quantityReceived": "1.0",
  • "matchingType": "TWO_WAY",
  • "unitAmount": "1.00",
  • "lineItemTotal": "1.00",
  • "lineNumber": 1,
  • "dimensions": [
    ],
  • "invoiceItemsMatched": [
    ]
}

Update a purchase order's line item

Updates a purchase order's line item.

If there are existing matches made to an invoice that has been posted, you will not be able to update the purchase order line item.

If you update lineItemTotal you must update the purchase order's amount field which is the summation of all the line items. This should be done once you are finished manipulating all of the line items.

Once you are finished manipulating the purchase order you will need to call the processPurchaseOrder operation to kick off the matching process based on the updated information.

Authorizations:
BearerAuth
path Parameters
purchaseOrderLineItemId
required
string

The id of the purchase order line item.

Request Body schema: application/json

Update a purchase order line item.

required
string or null
string or null
UnitOfMeasure (string) or null
quantityAccepted
string <decimal>

The quantity accepted. Required when matchingType set to FOUR_WAY.

quantityReceived
string <decimal>

The quantity received. Required when matchingType set to THREE_WAY (default) or FOUR_WAY.

quantityRequested
required
string <decimal>

The quantity requested. Required for all matchingType values.

matchingType
string (PurchaseOrderLineItemMatchingType)
Enum: "TWO_WAY" "THREE_WAY" "FOUR_WAY"

The type of matching that should be done on the line item. Determines which quantity fields are required. TWO_WAY - Only the quantityRequested field is required. THREE_WAY (default) - The quantityRequested and quantityReceived fields are required. FOUR_WAY - The quantityRequested, quantityReceived, and quantityAccepted fields are required.

unitAmount
required
string <decimal> (MonetaryValue)

The monetary value as a string. A float should not be used. The api will accept a float and it will be transformed into a monetary value, but for best results please use a string with the proper decimal precision.

lineItemTotal
required
string <decimal> (MonetaryValue)

The monetary value as a string. A float should not be used. The api will accept a float and it will be transformed into a monetary value, but for best results please use a string with the proper decimal precision.

lineNumber
required
integer >= 1
Array of objects (DimensionRef)

Responses

Request samples

Content type
application/json
{
  • "productNumber": "string",
  • "productDescription": "string",
  • "unitOfMeasure": "kg",
  • "quantityAccepted": "1.0",
  • "quantityReceived": "12.3",
  • "quantityRequested": "1.0",
  • "matchingType": "TWO_WAY",
  • "unitAmount": "1.00",
  • "lineItemTotal": "1.00",
  • "lineNumber": 1,
  • "dimensions": [
    ]
}

Response samples

Content type
application/json
{
  • "internalId": "string",
  • "productNumber": "string",
  • "productDescription": "string",
  • "unitOfMeasure": "kg",
  • "quantityAccepted": "1.0",
  • "quantityRequested": "1.0",
  • "quantityReceived": "1.0",
  • "matchingType": "TWO_WAY",
  • "unitAmount": "1.00",
  • "lineItemTotal": "1.00",
  • "lineNumber": 1,
  • "dimensions": [
    ],
  • "invoiceItemsMatched": [
    ]
}

Delete a purchase order's line item

Delete a purchase order's line item.

If there are existing matches made to an invoice that has been posted, you will not be able to delete the purchase order line item.

After deleting the purchase order line item, you must update the the purchase order's amount field. This should be done once you are finished manipulating all of the line items.

Once you are finished manipulating the purchase order you will need to call the processPurchaseOrder operation to kick off the matching process based on the updated information.

Authorizations:
BearerAuth
path Parameters
purchaseOrderLineItemId
required
string

The id of the purchase order line item.

Responses

Response samples

Content type
application/json
{
  • "code": 100,
  • "message": "string"
}

Status

Status requests on the state of the Vic.ai system.

Health check

Use this request to obtain a health check statement.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "PASS",
  • "version": "string",
  • "company": "string"
}

Tags

Tags are part of your ERP Masterdata, and represent business categories that are associated with certain entities, like Vendor.

Get a list of tags

Get a list of tags. Tags are used to categorize entities. Currently the only entity that is taggable are Vendors using the /vendorTags endpoint. These are not the tags that are used to describe a group of companies.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new tag

Create a new tag.

Authorizations:
BearerAuth
Request Body schema: application/json
required

Create a tag.

value
required
string <= 255 characters

Responses

Request samples

Content type
application/json
{
  • "value": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "value": "string"
}

Update a tag

Update a tag.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the tag

Request Body schema: application/json
required

Update a tag.

value
required
string <= 255 characters

Responses

Request samples

Content type
application/json
{
  • "value": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "value": "string"
}

Delete a tag

Delete a tag. If you delete a tag, any entities that the tags is attached to will be deleted as well. This action can not be undone.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the tag

Responses

Response samples

Content type
application/json
{
  • "code": 100,
  • "message": "string"
}

Tax codes

The tax codes.

Creates a company's tax code

Creates a company's tax code

Authorizations:
BearerAuth
Request Body schema: application/json

Create a tax code.

code
required
string <= 255 characters
description
required
string <= 255 characters
rate
required
string <decimal>

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "description": "Tax code description",
  • "rate": "0.25"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "code": "string",
  • "description": "Tax code description",
  • "rate": "0.25"
}

Get the list of tax codes for a company

Get the list of tax codes for a company

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "code": "string",
  • "description": "Tax code description",
  • "rate": "0.25"
}

VAT codes

In some regions, VAT codes are part of your ERP Masterdata, that represent timeboxed VAT codes and VAT values that Vic.ai can automatically assign to invoice line items.

List all VAT codes

Use this request to query all the VAT code data that are stored in Vic.ai.

Authorizations:
BearerAuth
query Parameters
limit
integer [ 1 .. 100 ]

How many items to return at one time (max 100) (default 100)

cursor
string

Which item to start from. See Pagination for more information.

since
string <date-time>

Datetime value for incremental updates. NOTE: For external datetimes, the expected format is not in UTC. for vic-internal datetimes (see SinceIsExternal) the format is UTC.

sortOrder
string
Default: "ASCENDING"
Enum: "ASCENDING" "DESCENDING"

what sort order should be used for queries

vatCode
string

selects the VAT code which is to be displayed

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Info for a specific VAT code

Use this request to get data for a single VAT code that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "code": "string",
  • "description": "string",
  • "activeStartingAt": "2019-08-24T14:15:22Z",
  • "activeEndingAt": "2019-08-24T14:15:22Z",
  • "rate": 0,
  • "remoteData": { },
  • "defaultInvoiceCreditAccount": "string",
  • "vatCreditAccount": "string",
  • "vatDebitAccount": "string"
}

Upserts a VAT code

Use this request to upsert VAT code into Vic.ai. The request body should contain the VAT code object as JSON. If the VAT code is known by Vic.ai, the id supplied will be used to resolve the VAT code and perform an update of the data, otherwise, a new VAT code will be inserted.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Request Body schema: application/json
required
code
string <= 255 characters
description
string <= 255 characters
externalId
string (ExternalId) <= 255 characters

The external id set by the ERP system. It does not have to be a UUID and can be any non empty string desired.

externalUpdatedAt
required
string <date-time>

The date time when the invoice was updated in the ERP system. This does not have UTC normalization.

activeStartingAt
string <date-time>
activeEndingAt
string <date-time>
rate
number
remoteData
object
defaultInvoiceCreditAccount
string <= 255 characters
vatCreditAccount
string <= 255 characters
vatDebitAccount
string <= 255 characters

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "description": "string",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "activeStartingAt": "2019-08-24T14:15:22Z",
  • "activeEndingAt": "2019-08-24T14:15:22Z",
  • "rate": 0,
  • "remoteData": { },
  • "defaultInvoiceCreditAccount": "string",
  • "vatCreditAccount": "string",
  • "vatDebitAccount": "string"
}

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "code": "string",
  • "description": "string",
  • "activeStartingAt": "2019-08-24T14:15:22Z",
  • "activeEndingAt": "2019-08-24T14:15:22Z",
  • "rate": 0,
  • "remoteData": { },
  • "defaultInvoiceCreditAccount": "string",
  • "vatCreditAccount": "string",
  • "vatDebitAccount": "string"
}

Deletes a VAT code

Use this request to delete data for a single VAT code that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "code": "string",
  • "description": "string",
  • "activeStartingAt": "2019-08-24T14:15:22Z",
  • "activeEndingAt": "2019-08-24T14:15:22Z",
  • "rate": 0,
  • "remoteData": { },
  • "defaultInvoiceCreditAccount": "string",
  • "vatCreditAccount": "string",
  • "vatDebitAccount": "string"
}

Vendors

Vendors are part of your ERP Masterdata, and represent companies that produce invoices. In order to be associated with an invoice, key data about the vendor must be stored in Vic.ai. These operations allow querying and manipulation of the vendor data.

Info for a specific vendor

Use this request to get data for a single vendor that is stored in Vic.ai.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "name": "string",
  • "email": "user@example.com",
  • "description": "string",
  • "phone": "string",
  • "addressStreet": "string",
  • "addressCity": "string",
  • "addressState": "string",
  • "addressPostalCode": "string",
  • "countryCode": "US",
  • "currency": "USD",
  • "confirmedAt": "2019-08-24T14:15:22Z",
  • "state": "CONFIRMED",
  • "taxInfo": {
    },
  • "defaultPaymentInfo": {
    },
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "vendorGroupId": "c4299feb-c5fa-4e0b-a7a6-51fbfbe0854d",
  • "externalData": { },
  • "errors": [
    ]
}

Upserts a vendor

Updates or inserts a vendor into the Vic.ai system. All fields passed are set on the vendor. All fields that are omitted from the request body are considered to be null and will be set to null. If the vendor is known by Vic.ai, the externalId supplied will be used to resolve the vendor and perform an update of the data, otherwise, a new vendor will be inserted. If the upsert action is part of a syncRequest, you should include the syncRequest ID in the X-Request-Id header.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

header Parameters
X-Request-Id
string <uuid>

token to be able to correctly log associated requests

Request Body schema: application/json
required
externalId
string (ExternalId) <= 255 characters

The external id set by the ERP system. It does not have to be a UUID and can be any non empty string desired.

externalUpdatedAt
required
string <date-time>

The date time when the invoice was updated in the ERP system. This does not have UTC normalization.

name
string <= 255 characters
Email (string) or null
string or null
string or null
string or null
string or null
string or null
CountryCode (string) or null
currency
string <ISO-4217> (Currency) <= 3 characters

The ISO-4217 currency code.

string or null
state
string (VendorState)
Enum: "CONFIRMED" "UNCONFIRMED"
object (VendorTaxInfo)
object (PaymentInfo)
string or null

The id of the PaymentTerm a vendor uses.

string or null

The VendorGroup id the vendor is attached to.

ExternalData (object) or null
Array of objects (VendorManager)
Array of objects (VendorRemoteError)

The errors that occurred in the external ERP system.

Responses

Request samples

Content type
application/json
{
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "name": "string",
  • "email": "user@example.com",
  • "phone": "string",
  • "addressStreet": "string",
  • "addressCity": "string",
  • "addressState": "string",
  • "addressPostalCode": "string",
  • "countryCode": "US",
  • "currency": "USD",
  • "confirmedAt": "2019-08-24T14:15:22Z",
  • "state": "CONFIRMED",
  • "taxInfo": {
    },
  • "defaultPaymentInfo": {
    },
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "vendorGroupId": "c4299feb-c5fa-4e0b-a7a6-51fbfbe0854d",
  • "externalData": { },
  • "managers": [
    ],
  • "errors": [
    ]
}

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "name": "string",
  • "email": "user@example.com",
  • "description": "string",
  • "phone": "string",
  • "addressStreet": "string",
  • "addressCity": "string",
  • "addressState": "string",
  • "addressPostalCode": "string",
  • "countryCode": "US",
  • "currency": "USD",
  • "confirmedAt": "2019-08-24T14:15:22Z",
  • "state": "CONFIRMED",
  • "taxInfo": {
    },
  • "defaultPaymentInfo": {
    },
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "vendorGroupId": "c4299feb-c5fa-4e0b-a7a6-51fbfbe0854d",
  • "externalData": { },
  • "errors": [
    ]
}

Deletes a vendor

Use this request to delete data for a single vendor that is stored in Vic.ai

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

Responses

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "name": "string",
  • "email": "user@example.com",
  • "description": "string",
  • "phone": "string",
  • "addressStreet": "string",
  • "addressCity": "string",
  • "addressState": "string",
  • "addressPostalCode": "string",
  • "countryCode": "US",
  • "currency": "USD",
  • "confirmedAt": "2019-08-24T14:15:22Z",
  • "state": "CONFIRMED",
  • "taxInfo": {
    },
  • "defaultPaymentInfo": {
    },
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "vendorGroupId": "c4299feb-c5fa-4e0b-a7a6-51fbfbe0854d",
  • "externalData": { },
  • "errors": [
    ]
}

Completes the response callback cycle resulting from a 202

Use this post to report vendor update failure errors back to Vic.ai. Strictly a response to the callbacks.

  • The X-Request-Id header is required.
  • The id MUST be a Vendor internalId.
Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

header Parameters
X-Request-Id
string <uuid>

token to be able to correctly log associated requests

Request Body schema: application/json
required
required
Array of objects (VendorRemoteError)

Responses

Request samples

Content type
application/json
{
  • "errors": [
    ]
}

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "name": "string",
  • "email": "user@example.com",
  • "description": "string",
  • "phone": "string",
  • "addressStreet": "string",
  • "addressCity": "string",
  • "addressState": "string",
  • "addressPostalCode": "string",
  • "countryCode": "US",
  • "currency": "USD",
  • "confirmedAt": "2019-08-24T14:15:22Z",
  • "state": "CONFIRMED",
  • "taxInfo": {
    },
  • "defaultPaymentInfo": {
    },
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "vendorGroupId": "c4299feb-c5fa-4e0b-a7a6-51fbfbe0854d",
  • "externalData": { },
  • "errors": [
    ]
}

Clears errors on the Vendor.

Used to clear errors that have been fixed in the ERP system.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the database entry

query Parameters
useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

header Parameters
X-Request-Id
string <uuid>

token to be able to correctly log associated requests

Responses

Response samples

Content type
application/json
{
  • "internalId": "47",
  • "internalUpdatedAt": "2019-08-24T14:15:22Z",
  • "externalId": "21b31bc7-1267-4335-893c-d7fe4706a238",
  • "externalUpdatedAt": "2021-06-29T17:20:53.154",
  • "name": "string",
  • "email": "user@example.com",
  • "description": "string",
  • "phone": "string",
  • "addressStreet": "string",
  • "addressCity": "string",
  • "addressState": "string",
  • "addressPostalCode": "string",
  • "countryCode": "US",
  • "currency": "USD",
  • "confirmedAt": "2019-08-24T14:15:22Z",
  • "state": "CONFIRMED",
  • "taxInfo": {
    },
  • "defaultPaymentInfo": {
    },
  • "paymentTermId": "80b25998-53d5-4563-abd4-ea6566e3cf2b",
  • "vendorGroupId": "c4299feb-c5fa-4e0b-a7a6-51fbfbe0854d",
  • "externalData": { },
  • "errors": [
    ]
}

Delete vendor group

Delete vendor group.

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

The id of the vendor group

Responses

Response samples

Content type
application/json
{
  • "code": 100,
  • "message": "string"
}

Vendor groups

Vendors can be grouped together in Vic.ai. This is especially useful for purchase order matching where you want to match a purchase order to a group of vendors.

List all vendors

Use this request to query the vendor data that are stored in Vic.ai.

Authorizations:
BearerAuth
query Parameters
limit
integer [ 1 .. 100 ]

How many items to return at one time (max 100) (default 100)

cursor
string

Which item to start from. See Pagination for more information.

since
string <date-time>

Datetime value for incremental updates. NOTE: For external datetimes, the expected format is not in UTC. for vic-internal datetimes (see SinceIsExternal) the format is UTC.

confirmed
boolean
Default: true

selects if confirmed vendors are to be displayed.

unconfirmed
boolean
Default: true

selects if unconfirmed vendors are to be displayed.

useSystem
string
Default: "EXTERNAL"
Enum: "INTERNAL" "EXTERNAL" "internal" "external"

Which system to use for id or updatedAt filters.

sortOrder
string
Default: "ASCENDING"
Enum: "ASCENDING" "DESCENDING"

what sort order should be used for queries

state
string (VendorStateFilter)
Enum: "ACTIVE" "PENDING" "PREDICTED" "ERRORED"

Filter vendors by state.

  • PENDING - The vendor is not confirmed, has no errors, and was not predicted. It is pending to be confirmed.
  • ACTIVE - The vendor is confirmed and has no errors.
  • PREDICTED - The vendor was predicted by Vic.
  • ERRORED - The vendor has errors set.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List all vendor groups

List all vendor groups.

Authorizations:
BearerAuth
query Parameters
limit
integer [ 1 .. 100 ]

How many items to return at one time (max 100) (default 100)

cursor
string

Which item to start from. See Pagination for more information.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a vendor group

Create a vendor group.

Authorizations:
BearerAuth
Request Body schema: application/json

Create a vendor group.

name
required
string

The name of the vendor group

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string"
}

Update the vendor group

Update the vendor group.

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

The id of the vendor group

Request Body schema: application/json

Update a vendor group.

name
required
string

The name of the vendor group

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string"
}

Vendor tags

Vendor tags are used to categorize vendors using tags.

Get a list of vendor tags

Get a list of vendor tags.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new vendor tag

Create a new vendor tag. A vendor is not allowed to have the same tag attached multiple times.

Authorizations:
BearerAuth
Request Body schema: application/json
required

Create a vendor tag.

vendorId
required
string
tagId
required
string

Responses

Request samples

Content type
application/json
{
  • "vendorId": "string",
  • "tagId": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "vendorId": "string",
  • "tagId": "string"
}

Delete a vendor tag

Delete a vendor tag.

Authorizations:
BearerAuth
path Parameters
id
required
string

The id of the vendor tag

Responses

Response samples

Content type
application/json
{
  • "code": 100,
  • "message": "string"
}

Webhooks

Subscriptions

You can subscribe to all events in the Vic API system or a subset of the events. At the moment, each company may only have one subscription specified.

Create and Update Subscription

To create or update a subscription with the Vic API, you can pass the following.

curl --request PUT \
  --url http://api.us.vic.ai/v0/subscription \
  --header 'Authorization: Bearer MYBEARERTOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "callbackUrl": "https://yourCallbackUrl",
  "accessToken": "unique-token-per-client",
  "expiresAt": "2024-01-01T00:00:00Z"
}'

If you wish to only subscribe to specific events you may pass an array of event names.

curl --request PUT \
  --url http://api.us.vic.ai/v0/subscription \
  --header 'Authorization: Bearer MYBEARERTOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "callbackUrl": "https://yourCallbackUrl",
  "accessToken": "unique-token-per-client",
  "expiresAt": "2024-01-01T00:00:00Z",
  "events": ["payment_batch_processed"]
}'

If you need to update your subscription to receive all events after trimming it down, you may pass "events":["all"]. When passing all, it must be set by itself.

curl --request PUT \
  --url http://api.us.vic.ai/v0/subscription \
  --header 'Authorization: Bearer MYBEARERTOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "callbackUrl": "https://yourCallbackUrl",
  "accessToken": "unique-token-per-client",
  "expiresAt": "2024-01-01T00:00:00Z",
  "events": ["all"]
}'

Unsubscribe

You can delete a subscription by doing the following. Once the subscription is deleted, events will stop going to the callback url.

curl --request DELETE \
  --url http://api.us.vic.ai/v0/subscription \
  --header 'Authorization: Bearer MYBEARERTOKEN'

Events

These are the V1 events you can subscribe to. These will be sent as a POST to https://yourCallbackUrl/events.

  • all - This is a special form, that specifies that you want all events sent to your webhook.
  • payment_batch_processed

The following V0 events may be specified. They will be sent to the original callback paths where the event name was in the path.

  • vendorNew - POST https://yourCallbackUrl/vendorNew
  • invoicePost - POST https://yourCallbackUrl/invoicePost
  • invoiceTransfer - POST https://yourCallbackUrl/invoiceTransfer
  • syncRequest - POST https://yourCallbackUrl/syncRequest

Event Details

The newer webhook endpoints will be sent to https://yourCallbackUrl/events. The receiver is expected to handle everything asynchronously via this method. We do not parse parse the response body and will ignore it.

  • All 2XX responses will be treated as successful.
  • 401 and 403 responses will be treated as failures and be retried with an exponential backoff. Once the retries have been exhausted, the event is discarded.
  • All other 4XX responses will be treated as successful. If something is to be rejected, you will need to make the appropriate calls to the Vic API to complete the asynchronous handshake. Example: confirming or rejecting an invoice post.
  • All 5XX responses will be treated as a failure and will be retried with an exponential backoff. Once the retries have been exhausted, the event is discarded.
  • All events retried will be reattempted at least 5 times.

NOTE: The integrating system has 15 seconds to respond. After the time has passed it will be considered a failure, and a retry will be sent for events going to https://yourCallbackUrl/events.

The general structure of the webhook event will be as follows.

{
  "event": "the_event_name",
  "data": {
    "id": "123",
    "something": "value"
  }
}

There will be a top level field event that describes what the type of event is. There will also be a data envelope that will contain the data for the event.

Payment Batch Processed

This event is emitted from the Vic system when a batch of payments has been sent to the payment processor and a successful response has been obtained. The payload for this event matches almost exactly what you will receive in the getPaymentBatch operation.

Only approved credits and payments will be emitted with the event. Voided and rejected payments will not be sent. If you need these values, you should call getPaymentBatch in order to fetch them.

Here is an example of an $200 invoice being paid in full with a $20 credit note being applied. This will bring the total batch payment to $180. The credit note applied is not subtracted from the payment in this breakdown because ERPs typically need entries of the payment being applied and the credit note being used in conjunction with that credit note.

{
  "event": "payment_batch_processed",
  "data": {
    "id": "f1c2384f-57d8-41fe-afa6-17caf62b2a3f",
    "name": "Batch 2023-10-01 001",
    "processedAt": "2023-10-01T19:12:00Z",
    "approvedAt": "2023-10-01T19:12:00Z",
    "rejectedAt": null,
    "voidedAt": null,
    "status": "approved",
    "companyId": "123",
    "payments": [
      {
        "id": "edb3a624-9f12-4cd8-adb8-4d9a5ec0b48b",
        "amount": "200.00",
        "settlementAmount": "200.00",
        "settlementCurrencyId": "USD",
        "exchangeRate": "1.0",
        "discountAmount": "0.00",
        "currencyId": "USD",
        "status": "approved",
        "voidedAt": null,
        "rejectedAt": null,
        "approvedAt": "2023-10-01T19:12:00Z",
        "fundedAt": null,
        "costAccount": {
          "internalId": "1",
          "externalId": "cost-account-id-in-erp",
        },
        "invoice": {
          "internalId": "876",
          "externalId": "invoice-id-in-erp"
        },
        "vendor": {
          "internalId": "409",
          "externalId": "vendor-id-in-erp"
        },
      }
    ],
    "credits": [
      {
        "id": "091f257a-9b6e-4797-bcb6-ccd36dda260f",
        "amount": "20.00",
        "settlementAmount": "20.00",
        "settlementCurrencyId": "USD",
        "exchangeRate": "1.0",
        "discountAmount": "0.00",
        "currencyId": "USD",
        "status": "approved",
        "voidedAt": null,
        "rejectedAt": null,
        "approvedAt": "2023-10-01T19:12:00Z",
        "fundedAt": null,
        "invoice": {
          "internalId": "900",
          "externalId": "credit-note-id-in-erp"
        },
        "vendor": {
          "internalId": "409",
          "externalId": "vendor-id-in-erp"
        },
      }
    ]
  }
}

Get current webhook subscription

Get the current webhook subscription if one exists.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{}

Create new webhook subscription

This request is used to configure or modify a new subscription to user and automated actions. You must supply a callback url and set an access token that Vic.ai can use to authenticate itself in your system. Notifications of user actions will proceed via the documented schema. The callback url must be https.

Authorizations:
BearerAuth
Request Body schema: application/json
required
callbackUrl
required
string <uri>
accessToken
required
string <= 1024 characters
expiresAt
required
string <date-time>
Array of WebhookEventName (strings) or null

The list of events to subscribe to. If you wish to subscribe to all events simply pass ["all"]. If you are updating the subscription and wish to leave the events subscribed to alone, this field should be left unspecified or null.

Responses

Callbacks

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}

Callback payload samples

Callback
Content type
application/json
{
  • "event": "all",
  • "data": {
    }
}

Delete webhook subscription

This request is used to cancel a subscription to user actions. In conjunction with a post reqeust, you may use this as a first step to update subscription URLs or authorization tokens.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
"OK"