Documents
A Document can be a Quotation, a Sales order or any kind of sellable or purchasable document. It owns a set of Document lines and can be assigned some attachments.
Document methods
Search
Returns a list of all Documents matching some specified search criteria.
Method
| GET | /api/externals/v1/documents |
|---|
Arguments
- winLangID (long): Windows Language Identifier of the resulting data
- storeID (long): ID of the Store owning the searched Documents
- contactID (long): ID of the Contact owning the searched Documents
- projectID (long): ID of the Project owning the searched Documents
- documentTypeID (long): ID of the Document type of the searched Documents
- internalCode (string): Internal code of the searched Documents
- keyword (string): Searched keyword
- minDate (datetime): Minimum date of the searched Documents
- maxDate (datetime): Maximum date of the searched Documents
- dateKind (string): Type of date used by the minDate and/or maxDate arguments. Allowed values: "CreationDate", "LastModificationDate"
- idsOnly (boolean, true): If true, returns only a set of Document IDs
- detailedView (boolean, false): If true, returns additional information about the matching Documents (e.g.
"documentLines","styles","payments","attachments")
Body
(none)
Response
The search service returns a JSON message with the list of items matching the specified search criteria:
{
"documents": [
{
"id": long,
"storeID": long,
"projectID": long,
"documentType": {
"id": long,
"description": string
},
"internalCode": string,
"currencyCode": string,
"number": string,
"date": datetime,
"deliveryDate": datetime,
"reference": string,
"status": string, // (See "Document status possible values" below)
"contact": {
"id": long,
"code": string,
"title": string,
"firstName": string,
"lastName": string,
"companyName": string,
"mobilePhone": string,
"homePhone": string,
"emailAddress": string,
"isSubjectToTax1": boolean,
"isSubjectToTax2": boolean,
"isSubjectToTax3": boolean,
"isSubjectToTaxDEEE": boolean,
"isSubjectToTaxDEA": boolean,
"mainAddress": {
"street1": string,
"street2": string,
"street3": string,
"zipCode": string,
"city": string,
"countryCode": string,
"externalAddressID": string
}
},
"mainAddress": {
"title": string,
"firstName": string,
"lastName": string,
"companyName": string,
"street1": string,
"street2": string,
"street3": string,
"zipCode": string,
"city": string,
"countryCode": string
},
"billingAddress": {
"title": string,
"firstName": string,
"lastName": string,
"companyName": string,
"street1": string,
"street2": string,
"street3": string,
"zipCode": string,
"city": string,
"countryCode": string
},
"deliveryAddress": {
"title": string,
"firstName": string,
"lastName": string,
"companyName": string,
"street1": string,
"street2": string,
"street3": string,
"zipCode": string,
"city": string,
"countryCode": string
},
"documentLines": [
{
"id": long,
"number": string,
"positionNumber": string,
"description": string,
"product": {
"id": long,
"catalogID": long,
"isActive": boolean,
"isStored": boolean,
"code": string,
"finish": string,
"description": string,
"category": string,
"categoryGroup": string,
"width": double,
"height": double,
"depth": double,
"weight": double,
"volume": double,
"salesUnitCode": string,
"purchaseUnitCode": string,
"unitCostPrice": double,
"unitSalesPrice": double,
"isTax2Reducible": boolean,
"deeeUnitAmount": double,
"deaUnitAmount": double,
"deaProductCode": string,
"deaIsAFixAmount": boolean,
"notes": string,
"productPicturePath": string,
},
"quantity": double,
"hingingSide": string, // "L" = Left, "R" = Right
"eanCode": string,
"orderCode": string,
"unitCostPrice": double,
"unitSalesPrice": double, // Original unit sales price excluding taxes, eco-participations and discounts
"unitSalesPriceIT": double, // Theoretical unit sales price including taxes and eco-participations but excluding discounts
"totalCostPrice": double,
"discountPercentage": double, // Discount percentage applied on the Document line sales price
"totalSalesPrice": double, // Total sales price excluding taxes and eco-participations but including discounts
"tax1Rate": double,
"tax1Amount": double,
"tax2Rate": double,
"tax2Amount": double,
"tax3Rate": double,
"tax3Amount": double,
"totalDEEEAmountIT": double, // DEEE total amount including taxes
"totalDEAAmountIT": double, // DEA total amount including taxes
"discountAmountIT": double, // Discount amount applied on the total price including taxes
"categoryDiscountAmountIT": double, // Discount amount applied on the Document line grouping category total price including taxes
"totalSalesPriceIT": double, // Total price on the Document line including all taxes, eco-participations and discounts
"notes": string,
"parentID": long,
"styleUID": string,
"isEditable": boolean,
"stockQuantity": double // Only if you have access to the stock module
}
],
"discountPercentage": double, // Global discount percentage applied to the total price of the document lines
"totalSalesPrice": double, // Final price excluding taxes, eco-participations, fixed fees and shipping fees but including the global discount percentage
"totalTax1Amount": double,
"totalTax2Amount": double,
"totalTax3Amount": double,
"totalDEEEAmount": double, // DEEE total amount excluding taxes
"totalDEAAmount": double, // DEA total amount excluding taxes
"totalDEEEAmountIT": double, // DEEE total amount including taxes
"totalDEAAmountIT": double, // DEA total amount including taxes
"discountAmountIT": double, // Global discount amount including taxes
"shippingFees": {
"description": string,
"amount": double, // Shipping fees total amount excluding taxes
"tax1Amount": double,
"tax2Amount": double,
"tax3Amount": double,
"amountIT": double // Shipping fees total amount including taxes
},
"fixedFees": {
"description": string,
"amount": double, // Fixed fees total amount excluding taxes
"tax1Amount": double,
"tax2Amount": double,
"tax3Amount": double,
"amountIT": double // Fixed fees total amount including taxes
},
"totalSalesPriceIT": double, // Final price including all taxes, fees and discounts
"styles": [
{
"uid": string,
"features": [
{
"option": {
"id": long,
"featureID": long,
"code": string,
"orderCode": string,
"description": string,
"notes": string
},
"id": long,
"code": string,
"orderCode": string,
"description": string,
"sortSequence": double,
"notes": string
}
],
"id": long,
"catalogID": long,
"code": string,
"orderCode": string,
"description": string,
"priceLevel": int,
"notes": string
}
],
"payments": [
{
"paymentMethod": {
"id": long,
"description": string,
"isADeposit": boolean
},
"paymentType": {
"id": long,
"description": string
},
"status": string, // (See "Payment status possible values" below)
"percentage": double,
"amount": double,
"date": datetime,
"isPaid": boolean,
"paidAmount": double,
"paymentDate": datetime
}
] ,
"attachments": [
{
"id": long,
"url": string,
"description": string,
"fileTypeID": int, // (See "Possible attachment types" below)
"fileAssociateTypeID": int, // (See "Possible attachment types" below)
"creationDate": datetime
}
],
"creationDate": datetime,
"modificationDate": datetime,
"isEditable": boolean
}
]
"winLangID": long,
"success": boolean,
"message": string,
"rowCount": long
}
Document status possible values
The document "status" field can take several values:
| Status | Description |
|---|---|
| "" | Active / In progress (modifiable) |
| "A" | Cancelled |
| "O" | Confirmed / Transformed |
| "P" | Partially confirmed |
| "S" | Ended |
Some additional statuses may exist for Documents which type work with the Manual Document Validation system activated (use of the "Modify" and "Save" buttons), because they invlove dealing with several versions of the same Document:
| Status | Description |
|---|---|
| "M" | Cancelled version |
| "T" | Temporary (under modification) |
| "V" | Previous version |
Payment status possible values
The payment "status" field can take several values:
| Status | Description |
|---|---|
| "" | Active / In progress (modifiable) |
| "P" | Paid |
| "R" | Rejected |
| "W" | Pending |
Possible attachment types
The description of the attachment types depends on 2 values: “fileTypeID” and “fileAssociateTypeID”
| fileTypeID | fileAssociateTypeID | Description of attachment type |
|---|---|---|
| 242 | * | Perspective view |
| 243 | * | Thumbnail |
| 244 | * | Plan view |
| 245 | * | Elevation view |
| 247 | * | WorkTop view |
| 255 | * | External attachment |
| 0 | 216 | Signed Document |
| 0 | 217 | Measurement Report |
| 0 | 222 | Supplier Purchase Order |
| 0 | 223 | Supplier Receipt Note |
| 0 | 224 | Customer Receipt Note |
| 0 | 225 | Customer Invoice |
| 0 | 226 | Proof of Payment |
Details
Returns the details of the Document which documentTypeID and documentID are provided in the URL.
Method
| GET | /api/externals/v1/documents/{documentTypeID}/{documentID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be returned
- documentID (long): (provided in the path): ID of the Document to be returned
- winLangID (long): Windows Language Identifier of the resulting data
- detailedView (boolean, false): If true, returns additional information about the matching Document (e.g.
"documentLines","styles","payments","attachments")
Body
(none)
Response
Same format as the one returned by the « Document search » method.
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Create
Creates a new empty Document with the specified information.
Method
| POST | /api/externals/v1/documents/{documentTypeID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be created
Body
{
"projectID": long, // ID of the Project owning the Document to be created
"winLangID": long,
"internalCode": string, // Internal code of the Document to be created
"documentExternalCode": string // (deprecated) Same as the internalCode, the value is ignored if internalCode is set
}
Response
{
"documentTypeID": long, // The Document type ID
"documentID": long, // When successful, the created documentID
"storeID": long, // When successful, the ID of the Store owning the created Document
"success": boolean,
"message": string,
"rowCount": long
}
Update
Update document specifications.
Method
| PUT | /api/externals/v1/documents/{documentTypeID}/{documentID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be updated
- documentID (long): (provided in the path): ID of the Document to be updated
Body
{
"internalCode": string, // new Document internalCode
}
Response
{
"documentTypeID": long, // When successful, the documentTypeID of the updated Document
"documentID": long, // When successful, the documentID of the updated Document
"storeID": long, // When successful, the storeID of the updated Document
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Clone
Creates an exact copy of the specified Document (or its latest version) in its related Project.
Method
| POST | /api/externals/v1/documents/{documentTypeID}/{documentID}/clone |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
Body
{
"winLangID": long
}
Response
{
"documentTypeID": long, // When successful, the created documentTypeID
"documentID": long, // When successful, the created documentID
"storeID": long, // When successful, the ID of the Store owning the created Document
"success": boolean,
"message": string,
"rowCount": long,
"winLangID": long
}
Cancel
Asks for the cancellation of the Document which documentTypeID and documentID are provided in the URL.
Method
| DELETE | /api/externals/v1/documents/{documentTypeID}/{documentID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be cancelled
- documentID (long): (provided in the path): ID of the Document to be cancelled
Body
{
"cancellationNotes": string, // Comment about the Document cancellation
"cancellationReasonID": string // ID of the cancellation reason (cf. “Document cancellation reasons” for available values)
}
Response
{
"documentTypeID": long, // When successful, the cancelled documentTypeID
"documentID": long, // When successful, the cancelled documentID
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Cancel reasons
Returns the list of available Reasons why a Document of a specific Kind (Sales/Purchase) could be cancelled.
Method
| GET | /api/externals/v1/documents/cancellationReasons |
|---|
Arguments
- documentTypeKind (int): Kind of the searched Document type cancellation reasons (0 = Purchase Document Types, 1 = Sales Document Types)
- winLangID (long): Windows Language Identifier of the resulting data
Body
(none)
Response
{
"cancellationReasons": [
{
"id": long, // ID of the Cancellation reason
"description": string
}
]
"winLangID": long,
"success": boolean,
"message": string,
"rowCount": long
}
Transform
Generates a new Document with the specified Document Type from a given source Document (or its latest version).
Method
| POST | /api/externals/v1/documents/{documentTypeID}/{documentID}/ generate/{destinationDocumentTypeID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the source Document to be transformed
- documentID (long): (provided in the path): ID of the Document to be transformed
- destinationDocumentTypeID: (provided in the path): ID of the Document Type of the Document to be generated
Body
{
"winLangID": long
}
Response
{
"documentTypeID": long, // When successful, the created documentTypeID
"documentID": long, // When successful, the created documentID
"storeID": long, // When successful, the ID of the Store owning the created Document
"success": boolean,
"message": string,
"rowCount": long,
"winLangID": long
}
Set status to “processed”
Updates the specified Document status to “processed” (“O”).
Method
| PUT | /api/externals/v1/documents/{documentTypeID}/{documentID}/status/processed |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
Body
(none)
Response
{
"documentTypeID": long, // When successful, the updated documentTypeID
"documentID": long, // When successful, the updated documentID
"storeID": long,
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Document additional methods
Addresses update
Update the addresses of a document. If deliveryAddress or BillingAddress is not provided, it is replaced by mainAddress
Method
| PUT | /api/externals/v1/documents/{documentTypeID}/{documentID}/address |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
Body
{
"mainAddress": {
"title": string,
"firstName": string,
"lastName": string,
"companyName": string,
"street1": string,
"street2": string,
"street3": string,
"zipCode": string,
"city": string,
"countryCode": string
},
"deliveryAddress": {
"title": string,
"firstName": string,
"lastName": string,
"companyName": string,
"street1": string,
"street2": string,
"street3": string,
"zipCode": string,
"city": string,
"countryCode": string
},
"billingAddress": {
"title": string,
"firstName": string,
"lastName": string,
"companyName": string,
"street1": string,
"street2": string,
"street3": string,
"zipCode": string,
"city": string,
"countryCode": string
}
}
Response
{
"documentTypeID": long, // When successful, the updated documentTypeID
"documentID": long, // When successful, the updated documentID
"storeID": long, // When successful, the document storeID
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Payment create
This method is used for payments managed by an external system.
For the document specified, all unpaid payments are deleted and a line is created for the new payment. If the amount is less than the document amount, a balance line is created. The amount of this balance line is the difference between the document amount and the amount paid.
At the end, a new deposit invoice can be generated.
Method
| POST | /api/externals/v1/documents/{documentTypeID}/{documentID}/payments |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document for which a payment must be paid
- documentID (long): (provided in the path): ID of the Document for which a payment must be paid
- winLangID (long): Windows Language Identifier of the resulting data
Body
{
"paymentDate": string, // Date of the payment
"paidAmount": string, // Amount of the payment
"paymentTypeID": long, // Identifiant of the payment type
"internalCode": string, // Code of the payment in the external system
"ignorePaymentLimit": boolean // Limit or not the payment amount in relation to the document amount.
}
If the paymentTypeID is not specified, the first configurated payment type will be used.
If you want to pay more than the document amount, set ignorePaymentLimit to false. Else set it to true.
Response
{
"success": boolean,
"message": string,
"storeID": long, // When successful, the ID of the Store owning the created document (invoice)
"documentTypeID": long, // When successful, the created documentTypeID
"documentID": long, // When successful, the created documentID
"documentNumber": long, // When successful, the created documentNumber
"projectID": long, // When successful, the ID of the project owning the created document (invoice)
"projectUID": long // When successful, the UID of the project owning the created document (invoice)
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Payment update
Sets a payment as “paid” for the specified Document and Payment method, and generates a new Deposit Invoice.
Method
| PUT | /api/externals/v1/documents/{documentTypeID}/{documentID}/payments |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document for which a payment must be paid
- documentID (long): (provided in the path): ID of the Document for which a payment must be paid
- paymentMethodID (long): ID of the Payment must be paid
- paymentDate (datetime): Date of the payment
- winLangID (long): Windows Language Identifier of the resulting data
Body
(none)
Response
{
"success": boolean,
"message": string,
"storeID": long, // When successful, the ID of the Store owning the created document (invoice)
"documentTypeID": long, // When successful, the created documentTypeID
"documentID": long, // When successful, the created documentID
"documentNumber": long, // When successful, the created documentNumber
"projectID": long, // When successful, the ID of the project owning the created document (invoice)
"projectUID": long // When successful, the UID of the project owning the created document (invoice)
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Configuration list import
Adds a new list of configurations from Inspi 3D Configurator to the Document which documentTypeID and documentID are provided in the URL.
Method
| POST | /api/externals/v1/documents/{documentTypeID}/{documentID}/configurations |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
Body
{
"inspi3d": true, // Reserved, for internal use
"configs": [
string // List of configurationData from Inspi 3D Configurator
]
}
Response
{
"documentTypeID": long, // When successful, the updated documentTypeID
"documentID": long, // When successful, the updated documentID
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Document type methods
Search
Returns a list of all Document Types matching some specified search criteria.
Method
| GET | /api/externals/v1/documents/types |
|---|
Arguments
- winLangID (long): Windows Language Identifier of the resulting data
- kind (int): Kind of the searched Document Types (0 = Purchase Document Types, 1 = Sales Document Types)
- keyword (string): Searched keyword
- idsOnly (boolean, true): If true, returns only a set of Store IDs
- detailedView (boolean, false): If true, returns additional information about the matching Document Types
Body
(none)
Response
The search service returns a JSON message with the list of items matching the specified search criteria:
{
"documentTypes": [
{
"id": long,
"description": string,
"kind": int,
"isCancellable": boolean
}
]
"winLangID": long,
"success": boolean,
"message": string,
"rowCount": long
}
Details
Returns the details of the DocumentType which documentTypeID is provided in the URL.
Method
| GET | /api/externals/v1/documents/types/{documentTypeID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document Type to be returned
- winLangID (long): Windows Language Identifier of the resulting data
- detailedView (boolean, false): If true, returns additional information about the matching Document Type
Body
(none)
Response
Same format as the one returned by the « Document Type search » method.
Documents
Returns a list of all Documents of the Document type which documentTypeID is provided in the URL and matching some specified search criteria.
Method
| GET | /api/externals/v1/documents/{documentTypeID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document Type of the searched Documents
- winLangID (long): Windows Language Identifier of the resulting data
- storeID (long): ID of the Store owning the searched Documents
- contactID (long): ID of the Contact owning the searched Documents
- projectID (long): ID of the Project owning the searched Documents
- internalCode (string): Internal code of the searched Documents
- keyword (string): Searched keyword
- minDate (datetime): Minimum date of the searched Documents
- maxDate (datetime): Maximum date of the searched Documents
- dateKind (string): Type of date used by the minDate and/or maxDate arguments. Allowed values: "CreationDate", "LastModificationDate"
- idsOnly (boolean, true): If true, returns only a set of Document IDs
- detailedView (boolean, false): If true, returns additional information about the matching Documents (e.g.
"documentLines","styles","payments","attachments")
Body
(none)
Response
Same format as the one returned by the « Document search » method.
Document line methods
Create
Adds a new Document line to the Document which documentTypeID and documentID are provided in the URL and links it to the specified Product, with the given quantity.
Method
| POST | /api/externals/v1/documents/{documentTypeID}/{documentID}/lines |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
Body
{
"catalogID": long, // ID of the Catalog owning the Product to be added
"productID": long, // ID of the Product to be added
"storeID": long, // ID of the Store owning the Product to be added
"quantity": double // Quantity of Product to be added to the Document
}
Response
{
"documentTypeID": long, // When successful, the updated documentTypeID
"documentID": long, // When successful, the updated documentID
"documentLineID": long, // When successful, the added documentLineID
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Update
Updates the Document line which documentTypeID, documentID and documentLineID are provided in the URL.
Method
| PUT | /api/externals/v1/documents/{documentTypeID}/{documentID}/lines/{documentLineID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
- documentLineID (long): (provided in the path): ID of the Document line to be modified
Body
{
"quantity": double // New Quantity of the Document line
}
Response
{
"documentTypeID": long, // When successful, the updated documentTypeID
"documentID": long, // When successful, the updated documentID
"documentLineID": long, // When successful, the updated documentLineID
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Delete
Removes the Document line documentLine from the Document which documentTypeID, documentID and are provided in the URL.
Method
| DELETE | /api/externals/v1/documents/{documentTypeID}/{documentID}/lines/{documentLineID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
- documentLineID (long): (provided in the path): ID of the Document line to be deleted
Body
(none)
Response
{
"documentTypeID": long, // When successful, the updated documentTypeID
"documentID": long, // When successful, the updated documentID
"documentLineID": long, // When successful, the deleted documentLineID
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Product reservation
Reservation of a product in stock
Method
| PUT | /api/externals/v1/documents/{documentTypeID}/{documentID}/reserve |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
- documentLineID (long): ID of the Document line to be reserved
- productID (long): ID of the product to be reserved
- qteReserve (long): Quantity to be reserved
Body
(none)
Response
{
"documentTypeID": long, // When successful, the updated documentTypeID
"documentID": long, // When successful, the updated documentID
"documentLineID": long, // When successful, the reserved documentLineID
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Document pricing methods
Fixed fee recommended
Returns the recommended fixed fee for the specified document (or its latest version)
Method
| GET | /api/externals/v1/documents/{documentTypeID}/{documentID}/fixedFee |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
Body
(none)
Response
{
"description": string,
"amount": float,
"tax1Amount": float,
"tax2Amount": float,
"tax3Amount": float,
"amountIT": float
}
Fixed fee amount update
Updates the fixed fee for the specified document
Method
| PUT | /api/externals/v1/documents/{documentTypeID}/{documentID}/fixedFee |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
- fixedFeeAmount (float): Amount of the new fixed fee (taxes not included)
Body
(none)
Response
{
"documentTypeID": long, // When successful, the updated documentTypeID
"documentID": long, // When successful, the updated documentID
"storeID": long, // When successful, the document storeID
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Shipping fee recommended
Returns the recommended shipping fee for the specified document (or its latest version)
Method
| GET | /api/externals/v1/documents/{documentTypeID}/{documentID}/shippingFee |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
Body
(none)
Response
{
"description": string,
"amount": float,
"tax1Amount": float,
"tax2Amount": float,
"tax3Amount": float,
"amountIT": float
}
Shipping fee amount Update
Updates the shipping fee for the specified document
Method
| PUT | /api/externals/v1/documents/{documentTypeID}/{documentID}/shippingFee |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
- shippingFeeAmount (float): Amount of the new shipping fee (taxes not included)
Body
(none)
Response
{
"documentTypeID": long, // When successful, the updated documentTypeID
"documentID": long, // When successful, the updated documentID
"storeID": long, // When successful, the document storeID
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Promotions applicable
Returns all promotions that can be applied to the document (or its latest version)
Method
| GET | /api/externals/v1/documents/{documentTypeID}/{documentID}/promotions |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
Body
(none)
Response
{
"promotions": [
{
"id": long,
"desc": string,
"notes": string,
"beginDate": datetime ,
"endDate": datetime,
"ruleId": long,
"applicablePromotionRules": [
{
"id": long,
"applicationNotes": string
}
]
}
],
"winLangID": long,
"success": boolean,
"message": string,
"rowCount": long
}
Promotion apply
Applies the specified promotion/promotion rule to the specified document
Method
| PUT | /api/externals/v1/documents/{documentTypeID}/{documentID}/promotions/{promotionID}/{promotionRuleID} |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
- promotionID (long): (provided in the path): ID of the Promotion to be applied
- promotionRuleID (long): (provided in the path): ID of the Promotion Rule to be applied
Body
(none)
Response
{
"document": {
"id": long,
"documentType": long
},
"winLangID": long,
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Promotion cancel
Removes the promotion applied to the specified document.
Method
| DELETE | /api/externals/v1/documents/{documentTypeID}/{documentID}/promotions |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be modified
- documentID (long): (provided in the path): ID of the Document to be modified
Body
(none)
Response
{
"document": {
"id": long,
"documentType": long
},
"winLangID": long,
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
Document export methods
Accounting export
Returns a list of documents with the required information to be sent to any external accounting system.
Method
| GET | /api/externals/v1/documents/accounting |
|---|
Arguments
- saleDocument (long): 0 for a list of purchase documents, 1 for a list of sales documents
- winLangID (long): Windows Language Identifier of the resulting data
- accountingSending (boolean): Checks if the documents were already sent to any accounting system
- minDate (datetime): Minimum date of the Documents for accounting export
- maxDate (datetime): Maximum date of the searched Documents for accounting export
- groupingMode (long): Grouping mode for accounting export - 1 : Products - 2 : account
- storeID (long): ID of the Store owning for accounting export
Body
(none)
Response
{
"AccountingExport": [
{
"documentDate": datetime,
"docType": string,
"documentSens": string,
"documentType": string,
"documentTypeLabel": string,
"documentNumber": long,
"documentProjectCode": string,
"documentProjectInfo": string,
"contactID": string,
"documentContactInfo": string,
"documentAccountingType": string,
"documentAccountingCategory": string,
"documentProductCategory": string,
"documentBillingAddressCountry": string,
"documentInfo": string,
"debitAmount": float,
"creditAmount": float,
"documentTaxRate": float,
"exportLineIndex": long,
"currendyISOCode": string,
"storeCode": string
}
],
"success": boolean,
"message": string,
"rowCount": long
}
PDF export
Returns a PDF serialization of the Document which documentTypeID and documentID are provided in the URL.
Method
| GET | /api/externals/v1/documents/{documentTypeID}/{documentID}/report |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be returned
- documentID (long): (provided in the path): ID of the Document to be returned
- winLangID (long): Windows Language Identifier of the resulting data
- reportSettings (string): The url-encoded settings for the report. If a setting is not present then its default value is used. The settings are Boolean values represented as 1 for True and 0 for False.
The format before urlEncoding is the following:{OPTION_ID}={1|0},{OPTION_ID}={1|0}
Example :
If you want the “PRINTER_HeaderPaper” option as True and “DISPLAY_Options” as False, the value before encoding is:
PRINTER_HeaderPaper=1,DISPLAY_Options=0
and the final value is:
PRINTER_HeaderPaper%3D1%2CDISPLAY_Options%3D0
Body
(none)
Response
{
"documentTypeID": long,
"documentID": long,
"base64PDF": string,
"winLangID": long,
"success": boolean,
"message": string,
"rowCount": long
}
The response documentID may be different from the one passed as an argument.
This is the case if a more recent version of the document exists.
PDF export settings
Returns the list of available settings for a PDF serialization of the Document which documentTypeID and documentID are provided in the URL.
Method
| GET | /api/externals/v1/documents/{documentTypeID}/{documentID}/report/settings |
|---|
Arguments
- documentTypeID (long): (provided in the path): ID of the Document type of the Document to be returned
- documentID (long): (provided in the path): ID of the Document to be returned
- winLangID (long): Windows Language Identifier of the resulting data
Body
(none)
Response
{
"settings": [
{
"id": string,
"value": boolean
}
],
"winLangID": long,
"success": boolean,
"message": string,
"rowCount": long
}