Skip to main content

Version 2.0

· 8 min read

INFast API 2.0 is a big milestone for the Intia team. This changelog lists all the changes compared to INFast API 1.0.

The objectives of this new version are:

  • Clean up the API design for more consistency,
  • Provide a foundation for our future developments,
  • Support a global overhaul of INFast.

You may also notice a change in the documentation. Indeed, we have decided to switch to Docusaurus. The goal is to provide you with cleaner, more functional documentation. You can easily make test requests directly in the API documentation. Here are the updates:

New Address

The first change is the new address for API V2. The base address is now https://api.infast.fr/api/v2. For consistency, the OAuth endpoint is now at this address: https://api.infast.fr/api/v2/oauth2/token.

It is also worth noting that there is no more demonstration platform for this version. We now invite you to use dedicated test accounts on the production platform. Feel free to contact support via chat for subscription issues or if you need us to transfer your data from the demo environment to the production environment.

New Response Format

All our endpoints now follow the same response format. The same applies to errors and Webhooks. Specifically, the change from the previous version is that responses are now encapsulated in a data field. For example:

Sample get Items response
{
"data": [
{
"id": "63e3c82675de4f6978054579",
"portalId": "63e3c82675de4f6978054555",
"name": "Item #1",
[Truncated]
},
{
"id": "666aa62f18a3a96aeb5d00b2",
"portalId": "63e3c82675de4f6978054555",
"name": "Item #2",
[Truncated]
},
{
"id": "666aa63fe883e6236f34ae07",
"portalId": "63e3c82675de4f6978054555",
"name": "Item #3",
[Truncated]
}
]
}

Update on Base Entity Models

We have revised the naming of the basic properties of our entities. This page presents the common properties. Key points to remember when transitioning from the previous version:

  • _id is now called id
  • customTag becomes metadata
  • The use of lastUpdate (previously knowed as lastModDate) is now generalized

Product becomes Item

In the previous version, we referred to Product to describe what the company sold. We now refer to it as Item (to avoid saying a Product with type = product). Functionally, the entity remains the same. Note that this also applies to fields that reference this Item (e.g., itemId instead of productId).

Pagination Parameters

For consistency, the pagination parameters on list requests (for example here for Items) have been renamed:

Old NameNew NameRole
orderByorderByThe field name to sort by
ordersortOrderThe order to sort by
limitlimitThe limit of the number of results
offsetskipThe number of results to skip (for pagination)

Transaction and Transaction Usage

This new version provides read access to Transactions and Transaction Usages. Specifically, it allows you to track the movement of money and its accounting implications. More simply: tracking payments, and more 🤓.

These pages explains everything about Transaction and Transaction Usage

Transaction and Transaction Usage endpoints

Modifications resource by resource

Portal

Portal schema modifications

  • additions
    • lastUpdate: Last entity modification date
  • modifications
    • _id becomes id
    • customTag becomes metadata
    • enterprise.vat The European intra-Community VAT identifier becomes enterprise.vatId
    • pack which could have had values pro or furious now have the values PRO or FURIOUS
    • recurrence which could have had values none, monthly, yearly or bi-yearly now have the values NONE, MONTHLY, YEARLY or BI_YEARLY
  • deletions
    • accountantLockPeriod field is deleted

Portal endpoints modifications

  • Update current Portal
    • body parameters modified
      • enterprise.vat The European intra-Community VAT identifier becomes enterprise.vatId

Customers

Customers schema modifications

  • additions
    • portalId: Unique identifier of the portal ownwing this resource
    • lastUpdate: Last entity modification date
  • modifications
    • _id becomes id
    • customTag becomes metadata
    • vat The European intra-Community VAT identifier becomes vatId
  • deletions

Customers new endpoints

Customers endpoints modifications

  • List Customers
    • new query parameters
      • orderby: allow new possible values [lastUpdate, name, reference, phone, dueAmount, documentsCount]
      • updatedSince
      • updatedUntil
      • minimumDueAmount
      • maximumDueAmount
      • documentStatus
  • Create a Customer
    • body parameters modified
      • vat The European intra-Community VAT identifier is replaced by vatId
  • Update a Customer
    • body parameters modified
      • vat The European intra-Community VAT identifier is replaced by vatId

Customers new webhook

Items

Items schema modifications

  • additions
    • portalId: Unique identifier of the portal ownwing this resource
    • lastUpdate: Last entity modification date
  • modifications
    • _id becomes id
    • customTag becomes metadata
    • isService was a boolean and becomes type which can have one of values [PRODUCT or SERVICE]
  • deletions
    • deleted field is deleted.

Items endpoints modifications

  • List Items
    • new query parameters
      • orderby: allow new possible values [lastUpdate, name, type, reference, price]
      • updatedSince
      • updatedUntil
      • type
      • minimumPrice
      • maximumPrice
  • Create an Item
    • body parameters modified
      • isService was a boolean and becomes type which can have one of values [PRODUCT or SERVICE]
  • Update an Item
    • body parameters modified
      • isService was a boolean and becomes type which can have one of values [PRODUCT or SERVICE]

Items new webhook

Documents

Documents schema modifications

  • additions
    • portalId: Unique identifier of the portal ownwing this resource
    • lastUpdate: Last entity modification date
  • modifications
    • _id becomes id
    • customTag becomes metadata
    • subtype: new possible values: ORDER_FORM, DELIVERY_NOTE and CUSTOM
    • type: new possible value: OTHER for subtype ORDER_FORM, DELIVERY_NOTE and CUSTOM
    • status: a new possible value CLOSED exist for OTHER document type
    • refInt becomes referenceInternal
    • amountVats becomes vatSummary
    • amountVats.amountVat becomes vatSummary.vatPart
    • historyEmails becomes messages and have a new field inboxUrl representing the url to see this document in INFast INBox
    • historyEmails.source becomes messages.source and have had possible values portal or customer have now values PORTAL or CUSTOMER
    • from.vat The European intra-Community VAT identifier becomes from.vatId
    • to.vat The European intra-Community VAT identifier becomes to.vatId
    • lines has know 3 different schemas to represent item, group or comment
      • no changes for group and comment
      • for item:
        • lineType was product is now ITEM
        • productId becomes itemId
        • isService was a boolean and becomes type which can have one of values [PRODUCT or SERVICE]
        • isNewLine: Only use on situation invoice. True if this line was not on quotation and not on a previous situation
        • computeMethod: To avoid rounding issues, this specify which reference field to consider for the price: PRICE, AMOUNT, or AMOUNT_WITH_VAT.
      • for group:
        • lineType was group is now GROUP
      • for comment:
        • lineType was comment is now COMMENT
    • deposit: has some new fields referenceTemporary, originalQuotationReferenceTemporary and originalQuotationDepositPercent
    • deposit.payedDate becomes deposit.paidDate
    • prevDoc.refInt becomes prevDoc.referenceInternal
    • nextDoc has a new field referenceTemporary
  • deletions

Documents new endpoints

Documents endpoints modifications

  • List Documents
    • new query parameters
      • orderby: allow new possible values [lastUpdate, emitDate, to.name, reference, amount]
      • subtype
      • reference
      • customerId
      • updatedSince
      • updatedUntil
      • startEmitDate
      • endEmitDate
      • minimumAmount
      • maximumAmount
      • minimumAmountWithVat
      • maximumAmountWithVat
  • Create Document
    • body parameters modified
      • See schema modification
  • Send a message about document
    • the endpoint in V1 was /api/v1/documents/:id/email, now it's /api/v2/documents/:id/messages
  • Add a payment
    • response schema has changed as payments have been replaced by transactions. See the endpoint definition

Documents webhook modifications

  • invoice.paid

    As payment has been replaced by Transactions and Transaction Usages the payload of the webhook event invoice.paid change. Instead return the paid document in data field, now we return an object with the document and all its transaction usages:

{
id: string,
portalId: string,
event: {
eventId: string,
data: {
document: Document,
transactionUsages: [TransactionUsage],
}
}
}

Webhooks

Webhooks new endpoints