Version 2.0
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:
{
"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 calledid
customTag
becomesmetadata
- The use of
lastUpdate
(previously knowed aslastModDate
) 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 Name | New Name | Role |
---|---|---|
orderBy | orderBy | The field name to sort by |
order | sortOrder | The order to sort by |
limit | limit | The limit of the number of results |
offset | skip | The 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
- Transactions
- Transactions Usages
Modifications resource by resource
Portal
Portal schema modifications
- additions
lastUpdate
: Last entity modification date
- modifications
_id
becomesid
customTag
becomesmetadata
enterprise.vat
The European intra-Community VAT identifier becomesenterprise.vatId
pack
which could have had valuespro
orfurious
now have the valuesPRO
orFURIOUS
recurrence
which could have had valuesnone
,monthly
,yearly
orbi-yearly
now have the valuesNONE
,MONTHLY
,YEARLY
orBI_YEARLY
- deletions
accountantLockPeriod
field is deleted
Portal endpoints modifications
- Update current Portal
- body parameters modified
enterprise.vat
The European intra-Community VAT identifier becomesenterprise.vatId
- body parameters modified
Customers
Customers schema modifications
- additions
portalId
: Unique identifier of the portal ownwing this resourcelastUpdate
: Last entity modification date
- modifications
_id
becomesid
customTag
becomesmetadata
vat
The European intra-Community VAT identifier becomesvatId
- deletions
deleted
field is deleted.payments
field is deleted. You need use the List transaction of a customer endpoint to retrieve Transactions
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
- new query parameters
- Create a Customer
- body parameters modified
vat
The European intra-Community VAT identifier is replaced byvatId
- body parameters modified
- Update a Customer
- body parameters modified
vat
The European intra-Community VAT identifier is replaced byvatId
- body parameters modified
Customers new webhook
Items
Items schema modifications
- additions
portalId
: Unique identifier of the portal ownwing this resourcelastUpdate
: Last entity modification date
- modifications
_id
becomesid
customTag
becomesmetadata
isService
was a boolean and becomestype
which can have one of values [PRODUCT
orSERVICE
]
- 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
- new query parameters
- Create an Item
- body parameters modified
isService
was a boolean and becomestype
which can have one of values [PRODUCT
orSERVICE
]
- body parameters modified
- Update an Item
- body parameters modified
isService
was a boolean and becomestype
which can have one of values [PRODUCT
orSERVICE
]
- body parameters modified
Items new webhook
Documents
Documents schema modifications
- additions
portalId
: Unique identifier of the portal ownwing this resourcelastUpdate
: Last entity modification date
- modifications
_id
becomesid
customTag
becomesmetadata
subtype
: new possible values:ORDER_FORM
,DELIVERY_NOTE
andCUSTOM
type
: new possible value:OTHER
for subtypeORDER_FORM
,DELIVERY_NOTE
andCUSTOM
status
: a new possible valueCLOSED
exist forOTHER
document typerefInt
becomesreferenceInternal
amountVats
becomesvatSummary
amountVats.amountVat
becomesvatSummary.vatPart
historyEmails
becomesmessages
and have a new fieldinboxUrl
representing the url to see this document in INFast INBoxhistoryEmails.source
becomesmessages.source
and have had possible valuesportal
orcustomer
have now valuesPORTAL
orCUSTOMER
from.vat
The European intra-Community VAT identifier becomesfrom.vatId
to.vat
The European intra-Community VAT identifier becomesto.vatId
lines
has know 3 different schemas to representitem
,group
orcomment
- no changes for
group
andcomment
- for
item
:lineType
wasproduct
is nowITEM
productId
becomesitemId
isService
was a boolean and becomestype
which can have one of values [PRODUCT
orSERVICE
]isNewLine
: Only use on situation invoice. True if this line was not on quotation and not on a previous situationcomputeMethod
: To avoid rounding issues, this specify which reference field to consider for the price:PRICE
,AMOUNT
, orAMOUNT_WITH_VAT
.
- for
group
:lineType
wasgroup
is nowGROUP
- for
comment
:lineType
wascomment
is nowCOMMENT
- no changes for
deposit
: has some new fieldsreferenceTemporary
,originalQuotationReferenceTemporary
andoriginalQuotationDepositPercent
deposit.payedDate
becomesdeposit.paidDate
prevDoc.refInt
becomesprevDoc.referenceInternal
nextDoc
has a new fieldreferenceTemporary
- deletions
deleted
field is deleted.payments
field is deleted. You need you the List Transaction Usage of a document endpoint to retrieve Transaction Usages
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
- new query parameters
- Create Document
- body parameters modified
- See schema modification
- body parameters modified
- Send a message about document
- the endpoint in V1 was
/api/v1/documents/:id/email
, now it's/api/v2/documents/:id/messages
- the endpoint in V1 was
- 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 datafield
, 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],
}
}
}