On this page we explain the usage of every method that is provided by our API.

Check the details for each one and also you can see the Examples page where we show how to use it on code.

Every update we make on our API will be reflected on this Documentation page.

Once again if needed feel free to contact us.

In order to call the non-authenticating endpoints you need to send an Access Token through the request headers.

 

To receive this token you have to call the GenerateAccessToken endpoint that can create two types of tokens:

 

  • IP bound token with an Expiration Time
    • Will only work for the IP that requested the Token and for the minutes specified on the tokenLifeTime

 

  • Unrestricted token
    • Will work for an unlimited time, is not IP bound and will be accepted as long as the credentials stay the same. (This type of token is created by having the Credentials’ tokenLifeTime set to “Never”).

 

After receiving the token, you can do requests to the other endpoints by sending this token through the Authorization Request header.

When making requests to the API if the target Drive FX installation has a pending maintenance, the API will automatically run it. The request made to the API will be lost and will have to be sent again.

 

These maintenances should not take more than 3-5 minutes and the partners are notified with advance.

 

  • Parameters
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure
 

 

In case of error:

 

 

JSON Specification for Generate Access Token

 

Credentials

Name Type DriveFX Entity DriveFX Field Observations
backendUrl* String URL of the DriveFX installation
appId* String Id provided by PHC
userCode* String User of the App
password* String Password of the app
company String The name of the companies Database.

This field only needs to be added if the user has more than one Database and wants to specify it, otherwise it will go to the default one

tokenLifeTime String Time in minutes before the Access Token expires and a new one is required.

Default value of 30 minutes.

 

It is possible to create a Token that does not expire and is always accepted by this API by sending this value as “Never”.

 

* – Required

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

If the option value is “0”:

 

 

If the option value is “1”:

 

 

If the option value is “2”:

 

 

In case of error:

 

 

 

JSON Specification for Create Document

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
option* Integer 0 – Send document by email

1 – Return document pdf link to print

2- Create document without signing (WARNING – For this to work the Document Type must allow drafts. If the document type does not allow drafts  the document WILL BE SIGNED)

requestedFields String Array The DriveFX document entity fields to be returned on Success (Check FtVO’s entity fields that you can use here)
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to

Ex. “Impressão Minimal Simples”

emailBody String Send document by email with specific body
emailSubject String Send document by email with specific subject

 

Customer **

Name Type DriveFX Entity DriveFX Field Observations
number** Integer Cl no  
estab Integer Cl estab By default it goes 0
name** String Cl nome  
address** String Cl morada  
postalCode** String Cl codpost  
city** String Cl local
country** String Cl pais Can be set with the full name or the alpha-2 letter ISO3166 format

Ex. “PT”, “ES”,”US” (See here)

email** String Cl email
taxNumber** String Cl ncont
abbreviatedName** String Cl nome2

 

Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer        – Type of document to create

Defaults:

1 – Invoice

2 – Invoice/Receipt

3 – Simple Invoice

4 – Delivery Note

5 – Credit Note

6 – Debit Note

7 – Other Documents

8 – Credit Note

customerName String      Ft nome
customerNumber** Integer Cl nome
customerEstab Integer Cl estab by default it goes 0
currency String Ft moeda ISO4217 code of the currency to be used (See codes here)

When not set the default value is ‘EUR’.

IMPORTANT: If the set value is not ‘EUR’ the Product’s unitPrice will be set with this currency

salesmanName String Ft vendnm
invoicingAddress1 String Ft morada
invoicingAddress2 String Ft morada2
invoicingPostalCode String Ft codpost
invoicingLocality String Ft local
documentDate**** String Ft fdata Format: “1900-01-01 00:00:00Z”
documentTime String Ft fhora Format: “00:00:00”
dueDate String Ft pdata Format: “1900-01-01 00:00:00Z”
documentObservations String Ft obs
dueDate String Ft pdata Format: “1900-01-01 00:00:00Z”
financialDiscount Double Ft efinv Financial discount (not including tax)
IMPORTANT: When this value is set there is no need to set the financialDiscountInPercentage
financialDiscountInPercentage Double Ft fin Percentage of financial discount (not including tax)
IMPORTANT: When this value is set there is no need to set the financialDiscount
unloadAddress1 String Ft moradato
unloadAddress2 String Ft morada2to
unloadPostalCode String Ft codpostto
unloadLocality String Ft localto
unloadCountry String Ft paisto Can be set with the full name or the alpha-2 letter ISO3166 format

Ex. “PT”, “ES”,”US” (See here)

loadAddress1 String Ft moradafrom
loadAddress2 String Ft morada2from
loadPostalCode String Ft codpostfrom
loadLocality String Ft localfrom
loadCountry String Ft paisfrom Can be set with the full name or the alpha-2 letter ISO3166 format

Ex. “PT”, “ES”,”US” (See here)

loadDate String Ft datacarga Format: “1900-01-01 00:00:00Z”
loadTime String Ft hcarga Format:”00:00”
unloadDate String Ft datadescarga Format: “1900-01-01 00:00:00Z”
unloadTime String Ft hdescarga Format:”00:00”
registration String Ft matricula
paymentTerms String Ft tpdesc Name of the payment term on Drive FX.

 

Important: If the set value doesn’t exist the invoice will be created with no payment terms

customerAbbreviatedName String Ft nome2
isImportSeries Boolean Parameter that specifies if document series is of type import or not
signature String Ft assinatura
impUniqueID String Ft impUniqueID
signatureDate String Ft signatureDate Format: “1900-01-01 00:00:00Z”
signatureHour String Ft signatureHour Format:”00:00”
keyVersion String Ft versaochave  

 

Products

Name Type DriveFX Entity DriveFX Field Observations
reference* String Fi ref Product reference
customerReference String Fi cliref Customer reference
designation* String Fi design
unitCode String Fi unidade
unitPrice* Double Fi epv/pvmoeda The unit price of the product.

By default the unitPrice is in Euros

The unitPrice will be set in the currency provided through the Document object Currency field

discount1 Integer Fi desconto
discount2 Integer Fi desc2
discount3 Integer Fi desc3 Important: In order to see more than 2 discounts it is needed to change the “Number of discounts on invoicing documents” parameter
discount4 Integer Fi desc4 Important: In order to see more than 2 discounts it is needed to change the “Number of discounts on invoicing documents” parameter
discount5 Integer Fi desc5 Important: In order to see more than 2 discounts it is needed to change the “Number of discounts on invoicing documents” parameter
discount6 Integer Fi desc6 Important: In order to see more than 2 discounts it is needed to change the “Number of discounts on invoicing documents” parameter
quantity* Integer Fi qtt
taxIncluded Boolean Fi ivaincl Indicates if the unit price includes tax
taxExemptionCode String Fi codmotiseimp
taxPercentage Integer Percentage of tax. Used with taxRegion to define the Fi tabiva field
taxRegion String Accepts one of the following regions: ‘PT’, ‘PT-AC’, ‘PT-MA’. Used with taxPercentage to define the Fi tabiva field
originDocumentNumber*** Integer The number of the document we want to copy from
originDocumentType*** Integer The type of the document we want to copy from
warehouse Integer Fi armazem Number of the origin warehouse of the product

 

* – Required

** – Customer can be referenced in two ways:

  • On the Document’s customerNumber field (referencing an existent Customer)
  • As an object (passing this object will also create/update the customer on DriveFX)

*** – Required when copying products from another document

**** – WARNING: Documents have to be issued sequentially, meaning:

  • If you issue a document with today’s date, you can’t issue a document for yesterday
  • If you issue a document with tomorrow’s date you can only issue documents from that day forward

 

Examples

Credit Notes:

The JSON structure for a credit note is slightly different, mainly on the Product side

Firstly we need to change the docType field from the Document request object to 5 (Credit Note).

On Product we only have to pass the following fields:

  • reference (required) – Product reference
  • originDocumentNumber (required) – Origin document’s Number
  • originDocumentType (required) – Origin document’s Type
  • quantity(optional) – Product Quantity

Note: You can find the document type values by going to Company Settings page and selecting Invoicing Types.

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure
 

 

In case of error:

 

 

 

JSON Specification for Cancel Document

 

Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer Type of document to create
documentNumber* String Ft fno  

* – Required

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure
 

 

In case of error:

 

 

JSON Specification for Fetch Document

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to Ex. “Impressão Minimal Simples”
requestedFields String Array The DriveFX document entity fields to be returned on Success (Check FtVO’s entity fields that you can use here)

 

Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer Type of document to create
documentNumber* String Ft fno  

* – Required

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:

 

 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

 

If the option value is “0”:

 

 

If the option value is “1”:

 

 

In case of error:

 

 

JSON Specification for Create Receipt

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to

Ex. “Impressão Minimal Simples”

option* Integer 0 – Send document by email

1 – Return document pdf link to print

requestedFields String Array The DriveFX document entity fields to be returned on Success (Check ReVO’s entity fields that you can use here)

Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer Type of document to create
documentNumber* String Ft fno  

* – Required

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure
 

 

In case of error:

 

 

JSON Specification for Fetch Document for Receipts

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to

Ex. “Impressão Minimal Simples”

requestedFields String Array The DriveFX document entity fields to be returned on Success (Check ReVO’s entity fields that you can use here)

 

Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer Type of document to create
documentNumber* String Re rno  

* – Required

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

If the option value is “0”:

 

If the option value is “1”:

 

In case of error:

 

 

JSON Specification for Create Internal Document

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
option* Integer 0 – Send document by email

1 – Return document pdf link to print

requestedFields String Array The DriveFX document entity fields to be returned on Success (Check BoVO’s entity fields that you can use here)
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to

Ex. “Impressão Minimal Simples”

emailBody String Send document by email with specific body
emailSubject String Send document by email with specific subject

 

Customer **

Name Type DriveFX Entity DriveFX Field Observations
number** Integer Cl no
estab Integer Cl estab By default it goes 0
name** String Cl nome
address** String Cl morada
postalCode** String Cl codpost
city** String Cl local
country** String Cl pais Can be set with the full name or the alpha-2 letter ISO3166 format

Ex. “PT”, “ES”,”US” (See here)

email** String Cl email
taxNumber** String Cl ncont
abbreviatedName** String Cl nome2  

 

Supplier **

Name Type DriveFX Entity DriveFX Field Observations
number** Integer Fl no
estab Integer Fl estab By default it goes 0
name** String Fl nome
address** String Fl morada
postalCode** String Fl codpost
city** String Fl local
country** String Fl pais Can be set with the full name or the alpha-2 letter ISO3166 format

Ex. “PT”, “ES”,”US” (See here)

email** String Fl email
taxNumber** String Fl ncont
abbreviatedName** String Fl nome2  

 

Internal Document 

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer        – Type of document to create

Defaults:

1 – Client Order

2 – Internal Consumption

3 – Worksheet

4 – Stock Transfer

5 – Order to Supplier

6 – Initial Stock

 

number Integer      Bo obrano Important:

The number can only be set for internal documents that can’t be communicated to SAFT(must be type Internal Document/Others).

 

The document type alsoneeds to have:

– The parameter “Permite alterar o Número do Dossier” (Allows for changing the Binder Number) set to true

– The parameter “Permite ter dossiers Rascunho” (Enables Draft binders) set to false

customerName String      Bo nome
customerNumber** Integer Cl no
customerEstab Integer Cl estab By default it goes 0
supplierName String Bo nome
supplierNumber Integer Fl no
supplierEstab Integer Fl estab By default it goes 0
salesmanName String Bo vendnm
issuingAddress1 String Bo morada
issuingAddress2 String Bo morada2
issuingPostalCode String Bo codpost
issuingLocality String Bo local
documentDate String Bo dataobra Format: “1900-01-01 00:00:00Z”
documentTime String Bo horaobra Format: “00:00:00”
description String Bo obranome
documentObservations String Bo obs
unloadAddress1 String Bo moradato
unloadAddress2 String Bo morada2to
unloadPostalCode String Bo codpostto
unloadLocality String Bo localto
unloadCountry String Bo paisto Can be set with the full name or the alpha-2 letter ISO3166 format

Ex. “PT”, “ES”,”US” (See here)

loadAddress1 String Bo moradafrom
loadAddress2 String Bo morada2from
loadPostalCode String Bo codpostfrom
loadLocality String Bo localfrom
loadCountry String Bo paisfrom Can be set with the full name or the alpha-2 letter ISO3166 format

Ex. “PT”, “ES”,”US” (See here)

customerAbbreviatedName String Bo name2  

 

Products

Name Type DriveFX Entity DriveFX Field Observations
reference* String Bi ref Product reference
customerReference String Bi cliref Customer reference
designation* String Bi design
unitCode String Bi unidade
unitPrice* Double Bi epv
discount1 Integer Bi desconto
discount2 Integer Bi desc2
quantity* Integer Bi qtt
warehouse Integer Bi armazem Number of the origin warehouse of the product
targetWarehouse Integer Bi ar2mazem Number of the destination warehouse of the product
taxIncluded Boolean Bi ivaincl Indicates if the unit price includes tax
taxPercentage Integer Percentage of tax. Used with taxRegion to define the Bi tabiva field
taxRegion String Accepts one of the following regions: ‘PT’, ‘PT-AC’, ‘PT-MA’. Used with taxPercentage to define the Bi tabiva field
originDocumentNumber*** Integer The number of the internal document we want to copy from
originDocumentType*** Integer The type of the internal document we want to copy from

 

* – Required

** – Customer/Supplier can be referenced in two ways:

  • On the Internal Document’s customerNumber/supplierNumber field (referencing an existent Customer/Supplier)
  • As an object (passing this object will also create/update the customer/suppleir on DriveFX)

*** – Required when copying products from another internal document

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure
 

 

In case of error:

 

 

 

JSON Specification for Cancel Internal Document

 

Internal Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer Type of document to create
documentNumber* String Ft fno  

* – Required

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure
 

 

In case of error:

 

 

JSON Specification for Fetch Internal Document

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to Ex. “Impressão Minimal Simples”
requestedFields String Array The DriveFX document entity fields to be returned on Success (Check BoVO’s entity fields that you can use here)

 

Internal Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer Type of document to create
documentNumber* String Ft fno  

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure
 

In case of error:

 

 

JSON Specification for Search Entities

 

Query Object

Name Type DriveFX Entity DriveFX Field Observations
distinct Boolean Add the equivalent of SQL’s DISTINCT expression to the search
entityName* String The name of the DriveFX entity to search for

The searchable entities can be found here (Just remove the VO when adding the name

Ex: FtVO => Ft, ClVO => Cl)

filterCod String
filterItems Object Array The equivalent of  SQL’s WHERE expression

(See item 1)

groupByItems String Array The equivalent of  SQL’s GROUP BY expression

(Can only be used when the SelectItems and orderByItems fields are defined. See item 2)

joinEntities Object Array The equivalent of  SQL’s JOIN expression

(Can only be used when the SelectItems and orderByItems fields are defined. See item 3)

limit Integer Record limit
offset Integer Offset from the first record
ndoc** Integer Document Type

Defaults:

1 – Invoice

2 – Invoice/Receipt

3 – Simple Invoice

4 – Delivery Note

5 – Credit Note

6 – Debit Note

7 – Other Documents

8 – Credit Note

orderByItems

 

Object Array The equivalent of  SQL’s ORDER BY expression

(See item 4)

SelectItems*** String Array The fields to be returned populated.

The equivalent of SQL’s SELECT expression.

(Important: the entity will still return some unrequested fields, but only the ones passed through this property will hold their true value)

* – Required

** – Required when searching for documents (Ft,Fi,Bo, etc.)

*** – Required when either joinEntities or groupItems are defined

 

 

filterItems

 

 

ComparisonEnum

Operator Value (Integer)
None -1
EQUAL 0
NOT EQUAL 1
GREATER 2
GREATER OR EQUAL 3
LESS 4
LESS OR EQUAL 5
START WITH 6
NOT START WITH 7
END WITH 8
NOT END WITH 9
CONTAIN 10
NOT CONTAIN 11
EXISTS 12
EQUAL LIKE 13
NOT EQUAL LIKE 14
IN 15
NOT EXIST 16
NOT IN 17
BLANK 18
IS NULL 19
IS NOT NULL 20

 

FilterGroupItemEnum

Symbol Value (Integer)
None 0
AND 1
AND NOT 2
AND BRACKET 3
AND NOT BRACKET 4
BRACKET AND BRACKET 5
BRACKET AND NOT BRACKET 6
BRACKET AND 7
BRACKET AND NOT 8
OR 9
OR NOT 10
OR BRACKET 11
OR NOT BRACKET 12
BRACKET OR BRACKET 13
BRACKET OR NOT BRACKET 14
BRACKET OR 15
BRACKET OR NOT 16
CLOSE BRACKET “)”

17

OPEN BRACKET “(” 18

 

groupByItems

 

 

 

joinEntities

 

 

JoinsTypeEnum

Tipo Valor
Inner 0
Left 1
Right 2
All 3

 

orderByItems

 

 

OrderTypesEnum

Order Value (Integer)
None -1
Ascending 0
Descending 1

 

 

Examples

 

Get all customers:

Sending the following queryObject to the endpoint will list with all the customers

 

 

SQL Equivalent:

 

 

Get customer by number:

Sending the following queryObject to the endpoint will register a list containing the customer with that number as the response

 

 

SQL Equivalent:

 

 

 

Get last invoice with client by invoice number:

Sending the following queryObject to the endpoint will receive a list containing all invoices for that user in the specified date period

 

SQL Equivalent:

 

Get invoice by client number and date period:

Sending the following queryObject to the endpoint will receive a list containing all invoices for that user in the specified date period

 

SQL Equivalent:

 

Important: Looking closely to the filterItems array, you will notice a couple of empty records, this is due to the filterItems array being used as a way to pass a query, and in order to pass some symbols or operators (like “(“  or “AND”) we have to pass some empty records with a defined groupItem.

Taking the object specification as such:

 

Breaking down each of the items on this example’s filter we are able to see the SQL forming:

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

  • In case of success:
 

  • In case of error:
 

 

 

 

JSON Specification for Create Customer

 

Customer

Name Type DriveFX Entity DriveFX Field Observations
number Integer
name* String
address String
postalCode String
city String
country* String Can be set with the full name or the alpha-2 letter ISO3166 format

Ex. “PT”, “ES”,”US” (See here)

email String
taxNumber String Required when DriveFX Application parameter “Tax number required” is True
phone String
mobilePhone String
iban String
bic String
observations String
abbreviatedName String

* – Required

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

  • In case of success:
 

  • In case of error:
 

 

JSON Specification for Create Product

 

Product

Name Type DriveFX Entity DriveFX Field Observations
reference String
designation* String
unitCode String
family String The name of the family of product. Must be the same present in StFami entity
category Integer Category for inventory

(See item 5)

unitPrice1 Double
taxIncluded1 Boolean
unitPrice2 Double
taxIncluded2 Boolean
unitPrice3 Double
taxIncluded3 Boolean
unitPrice4 Double
taxIncluded4 Boolean
isService Boolean
taxExemptionCode String
taxPercentage Integer
taxRegion String Should be in the2 letter ISO3166 format

Ex. “PT”, “ES”,”US”

observations String
tecDescription String
agreedPrice Double
agreedPriceIvaIncl Boolean  

* – Required

 

 

Category

 

Category accept one of the following integers

Description Value (Integer)
Other 0
Goods 1
Finished and intermediate products 2
Raw, subsidiar and consumption materials 3
By-products, waste and refuse 4
Ongoing Products and Works 5

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure can be empty.

This method will return all the analysis available in Drive FX.

 

In this List result the “fusqlid” to get specific analysis in method “runAnalysis”. Check the runAnalysis Chapter.

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:

a) The following example it is an analysis with variables:

 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

  • In case of success:

It return the data of the analysis, for example:

 

 

If the option value is “0”:

 

 

If the option value is “1”:

 

 

In case of error:

 

In this case, that analysis require variables (assuming that developer did not pass them to method) The API suggest the correct “variables” structure for the analysis:

 

b) If analysis doesn’t require variables, In the body of the POST a JSON structure like this one has to be passed:

 

 

JSON Specification for Run Analysis

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
option Integer 0 – Return the analysis values as JSON

1 – Return the analysis as XLSX file

(If no option is specified the default option will be 0)

 

Analysis

Name Type DriveFX Entity DriveFX Field Observations
Id* Integer  

 

 

Variables** (array of variables)

Name Type DriveFX Entity DriveFX Field Observations
no* Integer Number of Variable
name* String Name of variable
Value* String Value of Analysis Variable

* – required

** – required if analysis require variables

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

  • In case of success:

It return the data of the analysis, for example:

 

a) In case of NOT set in configuration the email:

 

 

b) In case of SET in configuration the email:

 

 

JSON Specification for Get Reporting

 

Reporting

Name Type DriveFX Entity DriveFX Field Observations
operation* Integer Specifies the type of reporting that is being requested.

1 – SAF-T

configuration* Object The configuration for each Operation

*required

 

 

Configuration for Operation = 1 (SAF-T)

Name Type DriveFX Entity DriveFX Field Observations
month* Integer Month of the SAF-T reporting
year* String Year of the SAF-T reporting
cae* String
email String If this is passed in configuration, it will be sent and url link does not come in result

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

  • In case of success:
 

  • In case of error:
 

 

JSON Specification for Update Company

 

Customer

Name Type DriveFX Entity DriveFX Field Observations
name String E1 nomecomp
address String E1 morada
locality String E1 local
postalCode String E1 codpost
phone String E1 telefone
taxNumber String E1 ncont
nameForDocuments String E1 doctitu
headerForDocuments String E1 doccabe
footerForDocuments String E1 docmens
shareCapital Double E1 capsocial  

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

If the option value is “0”:

 

 

If the option value is “1”:

 

 

If the option value is “2”:

 

 

In case of error:

 

 

 

JSON Specification for Create Document

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
option* Integer 0 – Send document by email

1 – Return document pdf link to print

requestedFields String Array The DriveFX document entity fields to be returned on Success (Check FoVO’s entity fields that you can use here)
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to

Ex. “Impressão Minimal Simples”

emailBody String Send document by email with specific body
emailSubject String Send document by email with specific subject

 

Supplier **

Name Type DriveFX Entity DriveFX Field Observations
number** Integer Fl no  
name** String Fl nome  
address** String Fl morada  
postalCode** String Fl codpost  
city** String Fl local
email** String Fl email
taxNumber** String Fl ncont
abbreviatedName** String Fl nome2

 

Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer        – Type of document to create

 

documentNumber* String        – Number of document to create

 

supplierName String Fo nome
supplierNumber** Integer Fl no
invoicingAddress1 String Fo morada
invoicingAddress2 String Fo morada2
invoicingPostalCode String Fo codpost
invoicingLocality String Fo local
documentDate String Fo data Format: “1900-01-01 00:00:00Z”
financialDiscount Double Fo efinv Financial discount (not including tax)
IMPORTANT: When this value is set there is no need to set the financialDiscountInPercentage
financialDiscountInPercentage Double Fo fin Percentage of financial discount (not including tax)
IMPORTANT: When this value is set there is no need to set the financialDiscount
documentTime String Fo hora Format: “00:00:00”
dueDate String Fo pdata Format: “1900-01-01 00:00:00Z”
supplierAbbreviatedName String Fo nome2

 

Products

Name Type DriveFX Entity DriveFX Field Observations
reference* String Fn ref Product reference
designation* String Fn design
unitPrice* Double Fn epv/pvmoeda The unit price of the product.

By default the unitPrice is in Euros

The unitPrice will be set in the currency provided through the Document object Currency field

discount1 Integer Fn desconto
discount2 Integer Fn desc2
discount3 Integer Fn desc3 Important: In order to see more than 2 discounts it is needed to change the “Number of discounts on purchase documents” parameter
discount4 Integer Fn desc4 Important: In order to see more than 2 discounts it is needed to change the “Number of discounts on purchase documents” parameter
discount5 Integer Fn desc5 Important: In order to see more than 2 discounts it is needed to change the “Number of discounts on purchase documents” parameter
discount6 Integer Fn desc6 Important: In order to see more than 2 discounts it is needed to change the “Number of discounts on purchase documents” parameter
quantity* Integer Fn qtt
taxIncluded Boolean Fn ivaincl Indicates if the unit price includes tax
taxExemptionCode String Fn codmotiseimp
taxPercentage Integer Percentage of tax. Used with taxRegion to define the Fn tabiva field
taxRegion String Accepts one of the following regions: ‘PT’, ‘PT-AC’, ‘PT-MA’. Used with taxPercentage to define the Fn tabiva field
warehouse Integer Fn armazem Number of the origin warehouse of the product

 

* – Required

** – Supplier can be referenced in two ways:

  • On the Document’s supplierNumber field (referencing an existent Supplier)
  • As an object (passing this object will also create/update the supplier on DriveFX)

Examples

Creating a Purchase:

The JSON structure for creating a new purchase:

Firstly we need to change the docType field from the Document request object to 2 (V/Fatura).

On Product we only have to pass the following fields:

  • reference (required) – Product reference
  • quantity(optional) – Product Quantity
  • designation(optional) – Product designation
  • unitPrice(optional) – Product price

Note: You can find the document type values by going to Company Settings page and selecting Account receivable /payable transaction codes.

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure
 

 

In case of error:

 

 

JSON Specification for Fetch Document

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to Ex. “Impressão Minimal Simples”
requestedFields String Array The DriveFX document entity fields to be returned on Success (Check FoVO’s entity fields that you can use here)

 

Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer Type of document to create
documentNumber* String Ft fno  

* – Required

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

  • In case of success:

Returns a JSON with a template of an instance object of the entity requested

 

  • In case of error:
 

 

JSON Specification for Get new instance

 

Name Type Observations
entity String Required, must me the table name of entity for example: Cl, Ft, Re, etc

If the request is an addon table, must be passed like this: uXXXX_table_name.

ndoc Integer Optional, it is necessary only if entity requested uses document types, like invoices, receipts, etc

  • Method
    • The method to be called is:
    • This method can be used to insert, update and delete records from the Drive FX.
    • The “operation” option on the itemVO should be used on the method to define what we want to do. Check the type of operations allowed in this table.

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

  • In case of success:
 

  • In case of error:
 

 

JSON Specification for save instance

 

Name Type Observations
entity String Required, must me the table name of entity for example: Cl, Ft, Re, etc

If the request is an addon table, must be passed like this: uXXXX_table_name.

ndoc Integer Optional, it is necessary only if entity requested uses document types, like invoices, receipts, etc
itemVO Object Required. The object passed to this property is a copy of the one acquired on /getNew, but with all the changes made by the implementation to be saved in record


Operation Type

This field on the ItemVO structure defines what we want to do for this record. we can insert, update and delete a existing record.

 

Operation Type Description
1 Insert Record
2 Update Record
3 Delete Record

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
 

  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

  • In case of success:

Returns a JSON with an Array of entity objects of the entity requested saved in DriveFX

 

  • In case of error:
 

 

JSON Specification for fetch records of a given entity

 

Name Type Observations
entity String Required, must me the table name of entity for example: Cl, Ft, Re, etc

If the request is an addon table, must be passed like this: uXXXX_table_name.

 

  • Parameters
    • In the request headers the Authorization header must have the Access Token:
      • Authorization: {{accessToken}}
    • In the body of the POST a JSON structure like this one has to be passed:
  • Return Information
    • Any call made to this method will return a JSON information with this structure

 

If the option value is “0”:

 

 

If the option value is “1”:

 

 

In case of error:

 

 

 

JSON Specification for Create Document

 

Request Options

Name Type DriveFX Entity DriveFX Field Observations
option* Integer 0 – Send document by email

1 – Return document pdf link to print

requestedFields String Array The DriveFX document entity fields to be returned on Success (Check ReVO’s entity fields that you can use here)
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to

Ex. “Recibo Minimal”

emailBody String Send document by email with specific body
emailSubject String Send document by email with specific subject
toProcess Integer 0 – Just create Receipt
1 – To process Receipt

 

Customer *

Name Type DriveFX Entity DriveFX Field Observations
number* Integer Cl no  
estab Integer Cl estab By default it goes 0

 

Document

Name Type DriveFX Entity DriveFX Field Observations
docType* Integer        – Type of document to create

Defaults:

1 – Normal Receipt

 

Invoices

Name Type DriveFX Entity DriveFX Field Observations
invoiceStamp* String Ft ftstamp Stamp of invoice to be in receipt
valueToReceive Double Rl erec Value to receive for that invoice

By default is the total of invoice

 

* – Required

Examples

Create receipt for 2 invoices:

The JSON structure to create one receipt with 2 invoices and regularize part of both invoices

Firstly we need to change the docType field from the Document request object to 1 (Normal Receipt).

On Invoices List we only have to pass the following fields:

  • invoiceStamp(required) – invoice refere
  • valueToReceive(optional) – Is the partial value to receive from specific invoice (by default is total of invoice)

Note: You can find the receipt document type values by going to Company Settings page and selecting Receipt Series.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Start typing and press Enter to search