Appearance
Documentation for invoices
Description
This endpoint allows you to retrieve a list of all the invoices stored in the system. It is useful for managing and querying invoices in your application.
Fields
| Field | Description | Data Type |
|---|---|---|
| id | Unique identifier for the object | String |
| invoiceNumber | Invoice number | String |
| issueDate | Issue date of the invoice | String |
| societyId | Identifier of the society | String |
| sellerId | Identifier of the seller | String |
| buyerId | Identifier of the buyer | String |
| typeId | Type of the invoice | String |
| classTypeId | Class type of the invoice | String |
| documentTypeId | Document type of the invoice | String |
| totalAmount | Total amount of the invoice | Number |
| status | Status of the invoice | String |
| description | Description of the invoice | String |
| taxableBase | Taxable base amount | Number |
| taxAmount | Tax amount | Number |
| buyerAddress | Address of the buyer | String |
| sellerAddress | Address of the seller | String |
| withholdingId | Withholding identifier | Number |
| withholdingAmount | Amount of withholding | Number |
| paymentMethodId | Payment method identifier | String |
| expirationDate | Expiration date of the invoice | String |
| originalInvoiceId | Original invoice identifier | String |
| documentFileId | Document file identifier | String |
| domainId | Domain identifier | String |
| externalId | External identifier | String |
| campaignId | Campaign identifier | Number |
| extraData | Additional data | Object |
| createdAt | Creation date of the record | String |
| updatedAt | Last update date of the record | String |
| deletedAt | Deletion date of the record, if applicable | String |
| enterprice | Represents business entities | Enterprice |
| seller | Information about the selling party | Seller |
| buyer | Information about the purchasing party | Buyer |
| type | Specifies the category or classification | Type |
| classType | Defines the class or subset within a type | ClassType |
| documentType | Indicates the kind of document involved | DocumentType |
| items | Array items | Array[Items] |
| withholding | It refers to a portion of income that is held back by an entity | Withholding |
| documentFile | document link to invoice | DocumentLink |
| labels | Array labels | Array[Label] |
Enterprice
| Field | Description | Data Type |
|---|---|---|
| nif | Unique identifier for the entity | String |
| businessName | Name of the business | String |
| societyRole | Role of the society | Boolean |
| status | Validation status | String |
| validationDate | Date of validation | String |
Seller
| Field | Description | Data Type |
|---|---|---|
| nif | Unique identifier for the entity | String |
| businessName | Name of the business | String |
| societyRole | Role of the society | Boolean |
| status | Validation status | String |
| validationDate | Date of validation | String |
Buyer
| Field | Description | Data Type |
|---|---|---|
| nif | Unique identifier for the entity | String |
| businessName | Name of the business | String |
| societyRole | Role of the society | Boolean |
| status | Validation status | String |
| validationDate | Date of validation | String |
Type
| Field | Description | Data Type |
|---|---|---|
| id | Unique identifier for the type | String |
| name | Name of the type | String |
| createdAt | Creation date of the type | String |
| updatedAt | Last update date of the type | String |
| deletedAt | Deletion date of the type (if applicable) | String |
ClassType
| Field | Description | Data Type |
|---|---|---|
| id | Unique identifier for the class type | String |
| name | Name of the class type | String |
| createdAt | Creation date of the class type | String |
| updatedAt | Last update date of the class type | String |
| deletedAt | Deletion date of the class type (if applicable) | String |
DocumentType
| Field | Description | Data Type |
|---|---|---|
| id | Unique identifier for the document type | String |
| name | Name of the document type | String |
| createdAt | Creation date of the document type | String |
| updatedAt | Last update date of the document type | String |
| deletedAt | Deletion date of the document type (if applicable) | String |
Items
| Field | Description | Data Type |
|---|---|---|
| id | Unique identifier for the record | String |
| invoiceId | Unique identifier for the associated invoice | String |
| articleId | Unique identifier for the article | String |
| quantity | Quantity of the article | Integer |
| unitPrice | Unit price of the article | Float |
| unitPriceOriginal | Original unit price of the article | Float |
| totalItemCost | Total cost of the article | Float |
| totalItemAmount | Total amount of the article | Float |
| description | Description of the article (nullable) | String |
| taxRate | Applied tax rate | Float |
| taxRateAmount | Amount of tax applied | Float |
| withholdingRate | Applied withholding rate | Float |
| withholdingAmount | Amount withheld | Float |
| articleName | Name of the article | String |
| articleCode | Code of the article (nullable) | String |
| createdAt | Creation date and time of the record | String |
| updatedAt | Last update date and time of the record | String |
| deletedAt | Deletion date and time of the record (if applicable) | String |
| article | Additional information about the article (nullable) | String |
Withholding
| Field | Description | Data Type |
|---|---|---|
| id | Unique identifier for the record | Integer |
| name | Name of the record | String |
| reason | Reason for the record | String |
| value | Value associated with the record | Integer |
| scope | Scope of the record | String |
| createdAt | Creation date and time of the record | String |
| updatedAt | Last update date and time of the record | String |
| deletedAt | Deletion date and time of the record (if applicable) | String |
DocumentFile
| Field | Description | Data Type |
|---|---|---|
| id | Unique identifier for the record | String |
| societyId | Identifier for the society | String |
| documentName | Name of the document | String |
| documentFileLink | URL link to the document file | String |
| documentFileTypeId | Identifier for the document file type | String |
| status | Processing status of the document | String |
| comments | Additional comments (nullable) | String |
| source | Source of the document | String |
| createdAt | Creation date and time of the record | String |
| updatedAt | Last update date and time of the record | String |
| deletedAt | Deletion date and time of the record (if applicable) | String |
| documentFileType | Details of the document file type | Object |
| ├── id | Unique identifier for the document type | String |
| ├── name | Name of the document type | String |
| ├── createdAt | Creation date and time of the document type | String |
| ├── updatedAt | Last update date and time of the document type | String |
| └── deletedAt | Deletion date and time of the document type (if applicable) | String |
Labels
| Field | Description | Data Type |
|---|---|---|
| id | Unique identifier for the record | String |
| invoiceId | Unique identifier for the associated invoice | String |
| itemId | Unique identifier for the item (nullable) | String |
| productAndServiceId | Unique identifier for the product or service (nullable) | String |
| amount | Amount related to the record | String |
| domainId | Identifier for the domain | String |
| analyticCodeId | Unique identifier for the analytic code | String |
| cropId | Unique identifier for the crop | Integer |
| createdAt | Creation date and time of the record | String |
| updatedAt | Last update date and time of the record | String |
| deletedAt | Deletion date and time of the record (if applicable) | String |
| crop | Details of the crop | Object |
| ├── id | Unique identifier for the crop | Integer |
| ├── name | Name of the crop | String |
| ├── domainId | Identifier for the domain | String |
| ├── createdAt | Creation date and time of the crop | String |
| ├── updatedAt | Last update date and time of the crop | String |
| └── deletedAt | Deletion date and time of the crop (if applicable) | String |
| analyticCode | Details of the analytic code | Object |
| ├── id | Unique identifier for the analytic code | String |
| ├── code | Code for the analytic category | String |
| ├── name | Name of the analytic category | String |
| ├── enterpriseTypeId | Identifier for the type of enterprise | Integer |
| ├── domainId | Identifier for the domain | String |
| ├── createdAt | Creation date and time of the analytic code | String |
| ├── updatedAt | Last update date and time of the analytic code | String |
| └── deletedAt | Deletion date and time of the analytic code (if applicable) | String |
List Invoices
http
GET /invoicesResponse
json
{
"data": [
{
"id": "2d89643d-f88f-45ca-962f-6fbb68158716",
"invoiceNumber": "JFSXRG8W-0032154309",
"issueDate": "2024-12-17T00:00:00.000Z",
"societyId": "508074363",
"sellerId": "B12345677",
"buyerId": "508074363",
"typeId": "REC",
"classTypeId": "OO",
"documentTypeId": "FC",
"totalAmount": 9832.5,
"status": "completed",
"description": null,
"taxableBase": 9832.5,
"taxAmount": 0,
"buyerAddress": "\n",
"sellerAddress": null,
"withholdingId": 1,
"withholdingAmount": 0,
"paymentMethodId": null,
"expirationDate": null,
"originalInvoiceId": null,
"documentFileId": "43ded804-84d5-4cc5-9d12-856ad612b4bb",
"domainId": "AGG",
"externalId": null,
"campaignId": 6,
"extraData": {},
"createdAt": "2024-12-17T16:08:38.671Z",
"updatedAt": "2024-12-18T21:51:08.556Z",
"deletedAt": null,
"enterprice": {
"nif": "508074363",
"businessName": "AGGRARIA LAGAR LDA",
"societyRole": true,
"status": "validated",
"validationDate": "2024-10-25"
},
"seller": {
"nif": "B12345677",
"businessName": "2023 ABM OBRAS",
"societyRole": true,
"status": "validated",
"validationDate": "2024-10-03"
},
"buyer": {
"nif": "508074363",
"businessName": "AGGRARIA LAGAR LDA",
"societyRole": true,
"status": "validated",
"validationDate": "2024-10-25"
},
"type": {
"id": "REC",
"name": "RECIBIDA",
"createdAt": "2024-07-08T14:57:42.177Z",
"updatedAt": "2024-07-08T14:57:42.177Z",
"deletedAt": null
},
"classType": {
"id": "OO",
"name": "Original",
"createdAt": "2024-07-08T14:59:24.493Z",
"updatedAt": "2024-07-08T14:59:24.493Z",
"deletedAt": null
},
"documentType": {
"id": "FC",
"name": "Factura Completa",
"createdAt": "2024-07-08T15:01:23.173Z",
"updatedAt": "2024-07-08T15:01:23.173Z",
"deletedAt": null
},
"items": [
{
"id": "6c518201-f928-4a42-a785-415470e16b51",
"invoiceId": "2d89643d-f88f-45ca-962f-6fbb68158716",
"articleId": "75070a18-6a4b-4bbf-a85e-963ad74ea4ac",
"quantity": 1,
"unitPrice": 9832.5,
"unitPriceOriginal": 9832.5,
"totalItemCost": 9832.5,
"totalItemAmount": 9832.5,
"description": null,
"taxRate": 0,
"taxRateAmount": 0,
"withholdingRate": 0,
"withholdingAmount": 0,
"articleName": "IVA 23%",
"articleCode": null,
"createdAt": "2024-12-17T16:08:38.679Z",
"updatedAt": "2024-12-17T16:08:38.679Z",
"deletedAt": null,
"article": null
}
],
"withholding": {
"id": 1,
"name": "0%",
"reason": "Sin retenciones",
"value": 0,
"scope": "all",
"createdAt": "2024-08-21T13:41:33.881Z",
"updatedAt": "2024-08-21T13:41:33.881Z",
"deletedAt": null
},
"paymentMethod": null,
"documentFile": {
"id": "43ded804-84d5-4cc5-9d12-856ad612b4bb",
"societyId": "508074363",
"documentName": "2023-08-16.14.35.41-GMTDOC069.pdf",
"documentFileLink": "https://aarpia-document-files-dev.s3.eu-west-1.amazonaws.com/CBI/508074363/43ded804-84d5-4cc5-9d12-856ad612b4bb.pdf",
"documentFileTypeId": "N3.16",
"status": "processed",
"comments": null,
"source": "agg",
"createdAt": "2024-12-03T11:29:06.385Z",
"updatedAt": "2024-12-17T16:08:38.865Z",
"deletedAt": null,
"documentFileType": {
"id": "N3.16",
"name": "FACTURA RECIBIDA ORDINARIA",
"createdAt": "2024-10-09T14:53:14.876Z",
"updatedAt": "2024-10-09T14:53:14.876Z",
"deletedAt": null
}
},
"accountingEntries": [],
"labels": [
{
"id": "f0e18f8a-9336-4428-8c5c-9cb6eb2fb6be",
"invoiceId": "2d89643d-f88f-45ca-962f-6fbb68158716",
"itemId": null,
"productAndServiceId": null,
"amount": "0.1",
"domainId": "AGG",
"analyticCodeId": "a2a1b4e1-a965-4175-ae90-cd3e070e9810",
"cropId": 6,
"createdAt": "2024-12-18T21:51:08.186Z",
"updatedAt": "2024-12-18T21:51:08.186Z",
"crop": {
"id": 6,
"name": "MAIZ",
"domainId": "AGG",
"createdAt": "2024-12-13T18:52:28.171Z",
"updatedAt": "2024-12-13T18:52:28.171Z",
"deletedAt": null
},
"analyticCode": {
"id": "a2a1b4e1-a965-4175-ae90-cd3e070e9810",
"code": "04.03",
"name": "MAQUINAS",
"enterpriseTypeId": 1,
"domainId": "AGG",
"createdAt": "2024-12-13T19:07:35.898Z",
"updatedAt": "2024-12-13T19:07:35.898Z",
"deletedAt": null
}
},
{
"id": "e8064cea-1291-4423-b628-169c8bfe02c0",
"invoiceId": "2d89643d-f88f-45ca-962f-6fbb68158716",
"itemId": null,
"productAndServiceId": null,
"amount": "0.2",
"domainId": "AGG",
"analyticCodeId": "eed8269f-9f40-4f5b-a64b-026963f3859d",
"cropId": 5,
"createdAt": "2024-12-18T21:51:08.186Z",
"updatedAt": "2024-12-18T21:51:08.186Z",
"crop": {
"id": 5,
"name": "ALMENDRO",
"domainId": "AGG",
"createdAt": "2024-12-13T18:52:28.122Z",
"updatedAt": "2024-12-13T18:52:28.122Z",
"deletedAt": null
},
"analyticCode": {
"id": "eed8269f-9f40-4f5b-a64b-026963f3859d",
"code": "02.04",
"name": "INSECTICIDA",
"enterpriseTypeId": 1,
"domainId": "AGG",
"createdAt": "2024-12-13T19:07:35.898Z",
"updatedAt": "2024-12-13T19:07:35.898Z",
"deletedAt": null
}
}
]
}
],
"meta": {
"itemsPerPage": 20,
"totalItems": 96,
"currentPage": 1,
"totalPages": 5,
"sortBy": [
[
"createdAt",
"DESC"
]
]
},
"links": {
"current": "http://develop.aarpia.digital/invoicing/v1.0/invoice?page=1&limit=20&sortBy=createdAt:DESC",
"next": "http://develop.aarpia.digital/invoicing/v1.0/invoice?page=2&limit=20&sortBy=createdAt:DESC",
"last": "http://develop.aarpia.digital/invoicing/v1.0/invoice?page=5&limit=20&sortBy=createdAt:DESC"
}
}Retrieve Invoices
http
GET /invoices/<id>Response
json
{
"id": "2d89643d-f88f-45ca-962f-6fbb68158716",
"invoiceNumber": "JFSXRG8W-0032154309",
"issueDate": "2024-12-17T00:00:00.000Z",
"societyId": "508074363",
"sellerId": "B12345677",
"buyerId": "508074363",
"typeId": "REC",
"classTypeId": "OO",
"documentTypeId": "FC",
"totalAmount": 9832.5,
"status": "completed",
"description": null,
"taxableBase": 9832.5,
"taxAmount": 0,
"buyerAddress": "\n",
"sellerAddress": null,
"withholdingId": 1,
"withholdingAmount": 0,
"paymentMethodId": null,
"expirationDate": null,
"originalInvoiceId": null,
"documentFileId": "43ded804-84d5-4cc5-9d12-856ad612b4bb",
"domainId": "AGG",
"externalId": null,
"campaignId": 6,
"extraData": {},
"createdAt": "2024-12-17T16:08:38.671Z",
"updatedAt": "2024-12-18T21:51:08.556Z",
"deletedAt": null,
"enterprice": {
"nif": "508074363",
"businessName": "AGGRARIA LAGAR LDA",
"societyRole": true,
"status": "validated",
"validationDate": "2024-10-25"
},
"seller": {
"nif": "B12345677",
"businessName": "2023 ABM OBRAS",
"societyRole": true,
"status": "validated",
"validationDate": "2024-10-03"
},
"buyer": {
"nif": "508074363",
"businessName": "AGGRARIA LAGAR LDA",
"societyRole": true,
"status": "validated",
"validationDate": "2024-10-25"
},
"type": {
"id": "REC",
"name": "RECIBIDA",
"createdAt": "2024-07-08T14:57:42.177Z",
"updatedAt": "2024-07-08T14:57:42.177Z",
"deletedAt": null
},
"classType": {
"id": "OO",
"name": "Original",
"createdAt": "2024-07-08T14:59:24.493Z",
"updatedAt": "2024-07-08T14:59:24.493Z",
"deletedAt": null
},
"documentType": {
"id": "FC",
"name": "Factura Completa",
"createdAt": "2024-07-08T15:01:23.173Z",
"updatedAt": "2024-07-08T15:01:23.173Z",
"deletedAt": null
},
"items": [
{
"id": "6c518201-f928-4a42-a785-415470e16b51",
"invoiceId": "2d89643d-f88f-45ca-962f-6fbb68158716",
"articleId": "75070a18-6a4b-4bbf-a85e-963ad74ea4ac",
"quantity": 1,
"unitPrice": 9832.5,
"unitPriceOriginal": 9832.5,
"totalItemCost": 9832.5,
"totalItemAmount": 9832.5,
"description": null,
"taxRate": 0,
"taxRateAmount": 0,
"withholdingRate": 0,
"withholdingAmount": 0,
"articleName": "IVA 23%",
"articleCode": null,
"createdAt": "2024-12-17T16:08:38.679Z",
"updatedAt": "2024-12-17T16:08:38.679Z",
"deletedAt": null,
"article": null
}
],
"withholding": {
"id": 1,
"name": "0%",
"reason": "Sin retenciones",
"value": 0,
"scope": "all",
"createdAt": "2024-08-21T13:41:33.881Z",
"updatedAt": "2024-08-21T13:41:33.881Z",
"deletedAt": null
},
"paymentMethod": null,
"documentFile": {
"id": "43ded804-84d5-4cc5-9d12-856ad612b4bb",
"societyId": "508074363",
"documentName": "2023-08-16.14.35.41-GMTDOC069.pdf",
"documentFileLink": "https://aarpia-document-files-dev.s3.eu-west-1.amazonaws.com/CBI/508074363/43ded804-84d5-4cc5-9d12-856ad612b4bb.pdf",
"documentFileTypeId": "N3.16",
"status": "processed",
"comments": null,
"source": "agg",
"createdAt": "2024-12-03T11:29:06.385Z",
"updatedAt": "2024-12-17T16:08:38.865Z",
"deletedAt": null,
"documentFileType": {
"id": "N3.16",
"name": "FACTURA RECIBIDA ORDINARIA",
"createdAt": "2024-10-09T14:53:14.876Z",
"updatedAt": "2024-10-09T14:53:14.876Z",
"deletedAt": null
}
},
"accountingEntries": [],
"labels": [
{
"id": "f0e18f8a-9336-4428-8c5c-9cb6eb2fb6be",
"invoiceId": "2d89643d-f88f-45ca-962f-6fbb68158716",
"itemId": null,
"productAndServiceId": null,
"amount": "0.1",
"domainId": "AGG",
"analyticCodeId": "a2a1b4e1-a965-4175-ae90-cd3e070e9810",
"cropId": 6,
"createdAt": "2024-12-18T21:51:08.186Z",
"updatedAt": "2024-12-18T21:51:08.186Z",
"crop": {
"id": 6,
"name": "MAIZ",
"domainId": "AGG",
"createdAt": "2024-12-13T18:52:28.171Z",
"updatedAt": "2024-12-13T18:52:28.171Z",
"deletedAt": null
},
"analyticCode": {
"id": "a2a1b4e1-a965-4175-ae90-cd3e070e9810",
"code": "04.03",
"name": "MAQUINAS",
"enterpriseTypeId": 1,
"domainId": "AGG",
"createdAt": "2024-12-13T19:07:35.898Z",
"updatedAt": "2024-12-13T19:07:35.898Z",
"deletedAt": null
}
},
{
"id": "e8064cea-1291-4423-b628-169c8bfe02c0",
"invoiceId": "2d89643d-f88f-45ca-962f-6fbb68158716",
"itemId": null,
"productAndServiceId": null,
"amount": "0.2",
"domainId": "AGG",
"analyticCodeId": "eed8269f-9f40-4f5b-a64b-026963f3859d",
"cropId": 5,
"createdAt": "2024-12-18T21:51:08.186Z",
"updatedAt": "2024-12-18T21:51:08.186Z",
"crop": {
"id": 5,
"name": "ALMENDRO",
"domainId": "AGG",
"createdAt": "2024-12-13T18:52:28.122Z",
"updatedAt": "2024-12-13T18:52:28.122Z",
"deletedAt": null
},
"analyticCode": {
"id": "eed8269f-9f40-4f5b-a64b-026963f3859d",
"code": "02.04",
"name": "INSECTICIDA",
"enterpriseTypeId": 1,
"domainId": "AGG",
"createdAt": "2024-12-13T19:07:35.898Z",
"updatedAt": "2024-12-13T19:07:35.898Z",
"deletedAt": null
}
}
]
}Create Invoices
http
POST /invoicesRequest body
json
{
"sellerId": "B90355322",
"buyerId": "A28985992",
"societyId": "B90355322",
"classTypeId": "OO",
"documentTypeId": "FA",
"description": "description",
"buyerAddress": "buyerAddress",
"sellerAddress": "sellerAddress",
"comment": "test comment",
"externalId": "externalId",
"extraData": {
"name": "extraData"
},
"campaignId": 1,
"items": [
{
"articleId": "7b460314-2e40-4af8-a408-a0ea06e35ede",
"quantity": 2,
"unitPrice": 10,
"description": "des"
},
{
"articleId": "ab367fc2-51c1-4f4c-94bd-ef94872595fb",
"quantity": 1,
"unitPrice": 10,
"description": "des"
},
{
"articleId": "6ed84f22-fd41-4e12-9f19-e5fe8544b199",
"quantity": 3,
"unitPrice": 13
}
]
}