Fred EdiAgri Api (v1)

Download OpenAPI specification:

Fred EdiAgri API

This API manages EDI (Electronic Data Interchange) data in an agricultural context: ingestion and parsing of EDI files (EDIFACT, Agrial formats), catalogs, products, customers and invoices, and the integration with the Fred accounting backend (via REST and Azure Service Bus). It is part of the larger Fred platform and is consumed by other Fred services.

Authentication

All endpoints are protected and require a valid Fred bearer token, except where explicitly marked as anonymous. Authentication and authorization follow the common Inqom mechanism shared by every Fred microservice.

See the shared Inqom authentication documentation for how to obtain a token and call the API behind the gateway.

Environments

Environment Base URL
Production https://api.inqom.com/ediagri
Staging https://api-staging.inqom.com/ediagri

Catalog

Get a catalog by identifier

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
catalogId
required
integer <int32>

Responses

Response samples

Content type
{
  • "Id": 0,
  • "Name": "string"
}

Retrieves all catalogs associated with the specified enterprise

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

Responses

Response samples

Content type
[
  • {
    }
]

Create a new catalog

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
Request Body schema:
Name
required
string non-empty

Responses

Request samples

Content type
{
  • "Name": "string"
}

Response samples

Content type
{
  • "Id": 0,
  • "Name": "string"
}

Company

Retrieves a list of companies for the specified enterprise.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The unique identifier of the enterprise to retrieve companies for.

Responses

Response samples

Content type
[
  • {
    }
]

Retrieves the accounting folders for a specified company within an enterprise.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The unique identifier of the enterprise that owns the company.

companyId
required
integer <int32>

The unique identifier of the company to retrieve accounting folders for.

Responses

Response samples

Content type
[
  • {
    }
]

Cooperative

Get a cooperative by identifier

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
cooperativeId
required
integer <int32>

Responses

Response samples

Content type
{
  • "Id": 0,
  • "Name": "string",
  • "Siret": "string",
  • "Account": {
    },
  • "Catalog": {
    },
  • "CustomerCount": 0
}

Updates a cooperative

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
cooperativeId
required
integer <int32>
Request Body schema:
Name
required
string non-empty
CatalogId
required
integer <int32>
AccountId
required
integer <int32>

Responses

Request samples

Content type
{
  • "Name": "string",
  • "CatalogId": 0,
  • "AccountId": 0
}

Response samples

Content type
{
  • "Id": 0,
  • "Name": "string",
  • "Siret": "string",
  • "Account": {
    },
  • "Catalog": {
    },
  • "CustomerCount": 0
}

Get all cooperatives

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

Responses

Response samples

Content type
[
  • {
    }
]

Creates a new cooperative

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
Request Body schema:
Name
required
string non-empty
Siret
required
string non-empty
CatalogId
required
integer <int32>
AccountId
required
integer <int32>

Responses

Request samples

Content type
{
  • "Name": "string",
  • "Siret": "string",
  • "CatalogId": 0,
  • "AccountId": 0
}

Response samples

Content type
{
  • "Id": 0,
  • "Name": "string",
  • "Siret": "string",
  • "Account": {
    },
  • "Catalog": {
    },
  • "CustomerCount": 0
}

Search for cooperatives based on the provided query parameters

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
Request Body schema:
PageNumber
required
integer <int32>
Default: 1
PageSize
required
integer <int32>
Default: 100
SearchText
string or null
SortColumn
string or null
Enum: "Name" "Catalog" "Siret" "Account" "Journal" "CustomerCount"
SortDirection
string or null
Enum: "Ascending" "Descending"

Responses

Request samples

Content type
{
  • "PageNumber": 1,
  • "PageSize": 100,
  • "SearchText": "string",
  • "SortColumn": "Name",
  • "SortDirection": "Ascending"
}

Response samples

Content type
{
  • "Items": [
    ],
  • "PageNumber": 1,
  • "PageSize": 1,
  • "TotalCount": 1,
  • "PageCount": 0,
  • "HasPreviousPage": false,
  • "HasNextPage": false
}

Customer

Get a customer by identifier

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
customerId
required
integer <int32>

Responses

Response samples

Content type
{
  • "Id": 0,
  • "CompanyId": 0,
  • "AccountingFolderId": 0,
  • "AccountingFolderName": "string",
  • "Name": "string",
  • "Reference": "string",
  • "Siret": "string",
  • "IsReady": true
}

Update a customer

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
customerId
required
integer <int32>
Request Body schema:
Name
string or null
CompanyId
integer <int32>
AccountingFolderId
integer <int32>

Responses

Request samples

Content type
{
  • "Name": "string",
  • "CompanyId": 0,
  • "AccountingFolderId": 0
}

Response samples

Content type
{
  • "Id": 0,
  • "CompanyId": 0,
  • "AccountingFolderId": 0,
  • "AccountingFolderName": "string",
  • "Name": "string",
  • "Reference": "string",
  • "Siret": "string",
  • "IsReady": true
}

Search for customers based on the provided query parameters

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
Request Body schema:
PageNumber
required
integer <int32>
Default: 1
PageSize
required
integer <int32>
Default: 100
FileBatchId
integer <int32>
SearchText
string or null
HasReadyCustomers
boolean
SortColumn
string or null
Value: "Name"
SortDirection
string or null
Enum: "Ascending" "Descending"

Responses

Request samples

Content type
{
  • "PageNumber": 1,
  • "PageSize": 100,
  • "FileBatchId": 0,
  • "SearchText": "string",
  • "HasReadyCustomers": true,
  • "SortColumn": "Name",
  • "SortDirection": "Ascending"
}

Response samples

Content type
{
  • "Items": [
    ],
  • "PageNumber": 1,
  • "PageSize": 1,
  • "TotalCount": 1,
  • "PageCount": 0,
  • "HasPreviousPage": false,
  • "HasNextPage": false
}

Import customers from a CSV file

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
query Parameters
cooperativeId
required
integer <int32>
Request Body schema: multipart/form-data
file
string <binary>

Responses

Response samples

Content type
{
  • "SuccessfulRecords": 0,
  • "Errors": [
    ],
  • "FailedRecords": 0,
  • "RecordCount": 0
}

FecImport

Get a FEC import by operation Id

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
operationId
required
integer <int32>

Responses

Response samples

Content type
{
  • "Id": 0,
  • "AccountingFirmId": 0,
  • "AccountingFolderId": 0,
  • "OperationId": 0,
  • "Status": "Waiting"
}

Update the status of a FEC import

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
fecImportId
required
integer <int32>
Request Body schema:
string
Enum: "Waiting" "Send" "Done" "Error"

Responses

Request samples

Content type
"Waiting"

Response samples

Content type
{
  • "Id": 0,
  • "AccountingFirmId": 0,
  • "AccountingFolderId": 0,
  • "OperationId": 0,
  • "Status": "Waiting"
}

FileBatch

Get a file batch by identifier.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

fileBatchId
required
integer <int32>

The identifier of the file batch.

Responses

Response samples

Content type
{
  • "Id": 0,
  • "CooperativeId": 0,
  • "CatalogId": 0,
  • "CreatedByUserId": 0,
  • "CreatedAt": "2019-08-24T14:15:22Z",
  • "Status": "Received",
  • "ErrorCodes": [
    ],
  • "WarningCodes": [
    ]
}

Update a file batch.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

fileBatchId
required
integer <int32>

The identifier of the file batch.

Request Body schema:

The command to update the file batch.

CooperativeId
required
integer <int32>

Responses

Request samples

Content type
{
  • "CooperativeId": 0
}

Response samples

Content type
{
  • "Id": 0,
  • "CooperativeId": 0,
  • "CatalogId": 0,
  • "CreatedByUserId": 0,
  • "CreatedAt": "2019-08-24T14:15:22Z",
  • "Status": "Received",
  • "ErrorCodes": [
    ],
  • "WarningCodes": [
    ]
}

Get all product mappings for a specific file batch.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

fileBatchId
required
integer <int32>

The identifier of the file batch.

Responses

Response samples

Content type
[
  • {
    }
]

EdiAgriFileBatches_GetFileBatchCustomerMappings

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
fileBatchId
required
integer <int32>

Responses

Response samples

Content type
[
  • {
    }
]

Search for file batches based on the provided query parameters.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

Request Body schema:

The search query parameters.

PageNumber
required
integer <int32>
Default: 1
PageSize
required
integer <int32>
Default: 100
Status
string or null
Enum: "Received" "InProcess" "Waiting" "Ready" "Done" "Error"
SearchText
string or null
SortColumn
string or null
Value: "CreatedAt"
SortDirection
string or null
Enum: "Ascending" "Descending"
FileBatchId
integer <int32>

Responses

Request samples

Content type
{
  • "PageNumber": 1,
  • "PageSize": 100,
  • "Status": "Received",
  • "SearchText": "string",
  • "SortColumn": "CreatedAt",
  • "SortDirection": "Ascending",
  • "FileBatchId": 0
}

Response samples

Content type
{
  • "Items": [
    ],
  • "PageNumber": 1,
  • "PageSize": 1,
  • "TotalCount": 1,
  • "PageCount": 0,
  • "HasPreviousPage": false,
  • "HasNextPage": false
}

Create a new file batch.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

Request Body schema: multipart/form-data
Files
required
Array of strings <binary> [ items <binary > ]

Responses

Response samples

Content type
{
  • "Id": 0,
  • "CooperativeId": 0,
  • "CatalogId": 0,
  • "CreatedByUserId": 0,
  • "CreatedAt": "2019-08-24T14:15:22Z",
  • "Status": "Received",
  • "ErrorCodes": [
    ],
  • "WarningCodes": [
    ]
}

Delete file batches.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

Request Body schema:

The command to delete file batches.

FileBatchIds
required
Array of integers <int32> [ items <int32 > ]

Responses

Request samples

Content type
{
  • "FileBatchIds": [
    ]
}

Start processing a file batch.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

fileBatchId
required
integer <int32>

The identifier of the file batch.

Responses

Response samples

Content type
{
  • "IsSuccess": true,
  • "Errors": [
    ]
}

Set a file batch as ready.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

fileBatchId
required
integer <int32>

The identifier of the file batch.

Responses

Response samples

Content type
{
  • "Id": 0,
  • "CooperativeId": 0,
  • "CatalogId": 0,
  • "CreatedByUserId": 0,
  • "CreatedAt": "2019-08-24T14:15:22Z",
  • "Status": "Received",
  • "ErrorCodes": [
    ],
  • "WarningCodes": [
    ]
}

Set a file batch as error.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

fileBatchId
required
integer <int32>

The identifier of the file batch.

Request Body schema:

The command to set the file batch as error.

ErrorCodes
required
Array of strings

Responses

Request samples

Content type
{
  • "ErrorCodes": [
    ]
}

Response samples

Content type
{
  • "Id": 0,
  • "CooperativeId": 0,
  • "CatalogId": 0,
  • "CreatedByUserId": 0,
  • "CreatedAt": "2019-08-24T14:15:22Z",
  • "Status": "Received",
  • "ErrorCodes": [
    ],
  • "WarningCodes": [
    ]
}

Send file batches invoices in accounting folder.

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

The identifier of the accounting firm (enterprise).

Request Body schema:

The command to send file batches.

FileBatchIds
required
Array of integers <int32> [ items <int32 > ]

Responses

Request samples

Content type
{
  • "FileBatchIds": [
    ]
}

Product

Get a product by identifier

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
productId
required
integer <int32>

Responses

Response samples

Content type
{
  • "Id": 0,
  • "Code": "string",
  • "Label": "string",
  • "ContributionAccount": {
    },
  • "SupplyAccount": {
    },
  • "TaxAccount": {
    },
  • "MeasureUnit": "string",
  • "CatalogId": 0,
  • "ProductFamilyId": 0,
  • "IsReady": true,
  • "IsContributionAccountRequired": true,
  • "IsSupplyAccountRequired": true
}

Update a product

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
productId
required
integer <int32>
Request Body schema:
Id
required
integer <int32>
ContributionAccountId
integer <int32>
SupplyAccountId
integer <int32>
TaxAccountId
integer <int32>

Responses

Request samples

Content type
{
  • "Id": 0,
  • "ContributionAccountId": 0,
  • "SupplyAccountId": 0,
  • "TaxAccountId": 0
}

Response samples

Content type
{
  • "Id": 0,
  • "Code": "string",
  • "Label": "string",
  • "ContributionAccount": {
    },
  • "SupplyAccount": {
    },
  • "TaxAccount": {
    },
  • "MeasureUnit": "string",
  • "CatalogId": 0,
  • "ProductFamilyId": 0,
  • "IsReady": true,
  • "IsContributionAccountRequired": true,
  • "IsSupplyAccountRequired": true
}

Search for products based on the provided query parameters

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
Request Body schema:
PageNumber
required
integer <int32>
Default: 1
PageSize
required
integer <int32>
Default: 100
FileBatchId
integer <int32>
CatalogId
integer <int32>
ProductFamilyId
integer <int32>
HasContributionAccount
boolean
HasSupplyAccount
boolean
HasTaxAccount
boolean
HasReadyProducts
boolean
SearchText
string or null
SortColumn
string or null
Enum: "Code" "Label"
SortDirection
string or null
Enum: "Ascending" "Descending"

Responses

Request samples

Content type
{
  • "PageNumber": 1,
  • "PageSize": 100,
  • "FileBatchId": 0,
  • "CatalogId": 0,
  • "ProductFamilyId": 0,
  • "HasContributionAccount": true,
  • "HasSupplyAccount": true,
  • "HasTaxAccount": true,
  • "HasReadyProducts": true,
  • "SearchText": "string",
  • "SortColumn": "Code",
  • "SortDirection": "Ascending"
}

Response samples

Content type
{
  • "Items": [
    ],
  • "PageNumber": 1,
  • "PageSize": 1,
  • "TotalCount": 1,
  • "PageCount": 0,
  • "HasPreviousPage": false,
  • "HasNextPage": false
}

Import products

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
Request Body schema: multipart/form-data
File
required
string <binary>

Responses

Response samples

Content type
{
  • "SuccessfulRecords": 0,
  • "Errors": [
    ],
  • "FailedRecords": 0,
  • "RecordCount": 0
}

ProductFamily

Get a product family by identifier

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
productFamilyId
required
integer <int32>

Responses

Response samples

Content type
{
  • "Id": 0,
  • "Code": "string",
  • "Label": "string",
  • "ContributionAccount": {
    },
  • "SupplyAccount": {
    },
  • "TaxAccount": {
    },
  • "ProductCount": 0,
  • "CatalogId": 0
}

Update a product family

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
productFamilyId
required
integer <int32>
Request Body schema:
Label
string or null
Code
required
string non-empty
ContributionAccountId
integer <int32>
SupplyAccountId
integer <int32>
TaxAccountId
integer <int32>

Responses

Request samples

Content type
{
  • "Label": "string",
  • "Code": "string",
  • "ContributionAccountId": 0,
  • "SupplyAccountId": 0,
  • "TaxAccountId": 0
}

Response samples

Content type
{
  • "Id": 0,
  • "Code": "string",
  • "Label": "string",
  • "ContributionAccount": {
    },
  • "SupplyAccount": {
    },
  • "TaxAccount": {
    },
  • "ProductCount": 0,
  • "CatalogId": 0
}

Get all product families

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>

Responses

Response samples

Content type
[
  • {
    }
]

Search for product families based on the provided query parameters

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
Request Body schema:
PageNumber
required
integer <int32>
Default: 1
PageSize
required
integer <int32>
Default: 100
CatalogId
integer <int32>
HasContributionAccount
boolean
HasSupplyAccount
boolean
HasTaxAccount
boolean
SearchText
string or null
SortColumn
string or null
Enum: "Code" "Label"
SortDirection
string or null
Enum: "Ascending" "Descending"

Responses

Request samples

Content type
{
  • "PageNumber": 1,
  • "PageSize": 100,
  • "CatalogId": 0,
  • "HasContributionAccount": true,
  • "HasSupplyAccount": true,
  • "HasTaxAccount": true,
  • "SearchText": "string",
  • "SortColumn": "Code",
  • "SortDirection": "Ascending"
}

Response samples

Content type
{
  • "Items": [
    ],
  • "PageNumber": 1,
  • "PageSize": 1,
  • "TotalCount": 1,
  • "PageCount": 0,
  • "HasPreviousPage": false,
  • "HasNextPage": false
}

Import product families

Authorizations:
oauth2
path Parameters
enterpriseId
required
integer <int32>
Request Body schema: multipart/form-data
File
required
string <binary>

Responses

Response samples

Content type
{
  • "SuccessfulRecords": 0,
  • "Errors": [
    ],
  • "FailedRecords": 0,
  • "RecordCount": 0
}