Sale API - Apigee (1.5.0)
Download OpenAPI specification:Download
Sale API documentation
Authentication & Authorization
You will need to be identified before calling any endpoints.
In order to be recognized and authorized to access our Sale API, we put in place 2 mechanisms:
- Authentication mechanism is done with a client id dedicated to you.
Remember that the client id provided should be shared with care.
The client id must be inserted in the header of the request in the appropriate field - Authorization mechanism is done by a well-known authorization flow for REST Web API: Basic auth flow.
Get Sales data
Get sales data filtered by parameters
Authorizations:
query Parameters
| pageNumber | integer <int32> (PageNumberParam) [ 1 .. 1000 ] Default: 1 Example: pageNumber=2 The page number |
| pageSize | integer <int32> (PageSizeParam) [ 1 .. 1000 ] Default: 1000 Example: pageSize=2 The page size |
| lastModifiedDateFrom | string <date-time> (lastModifiedDateFromParam) Example: lastModifiedDateFrom=2024-05-02T10:00:00 Date from for last update date of data |
| lastModifiedDateTo | string <date-time> (lastModifiedDateToParam) Example: lastModifiedDateTo=2024-05-02T10:00:00 Date to for last update date of data |
| externalRef | string (ExternalRefQueryParam) <= 255 characters Example: externalRef=1000045 Identifier of the external reference |
| source | string (SourceQueryParam) <= 255 characters Example: source=GENES Source of the external reference |
| withExternalRef | boolean (WithExternalRefQueryParam) Default: false Example: withExternalRef=true Return the external reference if set to true |
| billToCode | integer <int32> (BillToCode) Example: billToCode=1000001 Bill to code of the sale |
| customerType | string (CustomerType) Enum: "B2B" "B2C" Customer type of the sale |
Responses
Response samples
- 200
- 400
{- "pagination": {
- "next": "/sale-erm/v1/sales?page=3&size=50",
- "previous": "/sale-erm/v1/sales?page=1&size=50",
- "pageTotal": "3",
- "totalElements": "125"
}, - "sales": [
- {
- "code": 1000001,
- "billToCode": "1000089",
- "sellerCode": "",
- "sellerExternalRef": "IUA829",
- "vehicleCode": "1001852",
- "date": "2024-10-10T17:31:00",
- "currency": "EUR",
- "amountInclVat": "100",
- "amountExclVat": "95.5",
- "customerType": "B2B",
- "lines": [
- {
- "number": 1,
- "articleCode": 1000003,
- "unitPriceInclVat": 12.5,
- "unitPriceExclVat": 11.5,
- "quantity": 4,
- "quantityUOM": "PCE"
}, - {
- "number": 2,
- "articleCode": 1000075,
- "unitPriceInclVat": 12.5,
- "unitPriceExclVat": 11.5,
- "quantity": 4,
- "quantityUOM": "PCE"
}, - {
- "number": 3,
- "articleCode": 1000234,
- "unitPriceInclVat": 12.5,
- "unitPriceExclVat": 11.5,
- "quantity": 1,
- "quantityUOM": "PCE"
}
], - "references": [
- {
- "source": "ES_EQUITY",
- "externalRef": "12345",
- "country_code": "ES",
- "lastModifiedDate": "2024-12-27T12:23:23"
}
]
}
]
}Create sale data
Create sale
Authorizations:
Request Body schema: application/json
| externalRef required | string (ExternalRef) <= 255 characters Source application code of the sale |
| billToExternalRef | string <= 255 characters External ref of the bill to |
| sellerExternalRef | string (SellerExternalRef) <= 255 characters External ref of the seller |
| vehicleExternalRef | string <= 255 characters External ref of the vehicle |
| invoiceDocumentExternalRef | string (InvoiceDocumentExternalRef) <= 255 characters The external reference of the invoice document |
| date | string <date-time> (SaleDate) Date of the sale |
| currency | string (CurrencyEnum) Enum: "EUR" "CHF" "GBP" "RON" |
| amountInclVat | number <float> (AmountInclVat) Total amount of the sale including VAT |
| amountExclVat | number <float> (AmountExclVat) Total amount of the sale without VAT |
| customerType | string (CustomerType) Enum: "B2B" "B2C" |
Array of objects (CreateSaleLineQueryDTO) List of lines of the sale |
Responses
Request samples
- Payload
Create a sale with the given information
{- "externalRef": "12345",
- "billToExternalRef": "AA123",
- "sellerExternalRef": "IUA829",
- "vehicleExternalRef": "UYT9182",
- "date": "2024-10-10T17:31:00",
- "currency": "EUR",
- "amountInclVat": "100",
- "amountExclVat": "95.5",
- "invoiceDocumentExternalRef": "GJ3040384",
- "customerType": "B2C",
- "lines": [
- {
- "number": 1,
- "articleExternalRef": "1000003",
- "unitPriceInclVat": 12.5,
- "unitPriceExclVat": 11.5,
- "quantity": 4,
- "quantityUOM": "PCE"
}, - {
- "number": 2,
- "articleExternalRef": "1000075",
- "unitPriceInclVat": 12.5,
- "unitPriceExclVat": 11.5,
- "quantity": 4,
- "quantityUOM": "PCE"
}, - {
- "number": 3,
- "articleExternalRef": "1000234",
- "unitPriceInclVat": 12.5,
- "unitPriceExclVat": 11.5,
- "quantity": 1,
- "quantityUOM": "PCE"
}
]
}Response samples
- 200
- 400
{- "code": "1000293"
}Get invoice document for a specific sale
Get invoice document for a specific sale
Authorizations:
path Parameters
| code required | integer <int32> (SaleCode) Example: 1000001 Targeted sale code |
Responses
Response samples
- 400
- 401
- 404
- 422
- 500
{- "errors": [
- {
- "error": "string",
- "property": "string"
}
]
}Create a job
Create a job
Authorizations:
Request Body schema: application/json
object (JobQueryDTO) | |||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||
Responses
Request samples
- Payload
Create a job with the given information
{- "jobs": {
- "contractorCode": "100176",
- "customerCode": "100176",
- "customerSiteCode": "100001",
- "subscriptionCode": "100178",
- "serviceProviderSiteCode": "100176",
- "customerPurchaseOrderNumber": "BA123889",
- "contractorPurchaseOrderNumber": "BA123889",
- "vehicleCode": "100176",
- "initialStateCode": "100878",
- "finalStateCode": "100345",
- "scheduledDate": "2024-03-01",
- "executionDate": "2024-03-03",
- "dueDateCode": "100178",
- "executionSiteCode": "100179",
- "executionLocation": "45.759971, 3.128251",
- "mileage": 120000,
- "mileageUOM": "km",
- "workingHours": 300,
- "status": "INITIALIZED",
- "items": [
- {
- "articleCode": 100176,
- "quantity": 1,
- "quantityUOM": "ea",
- "sourceType": "SERVICE_PROVIDER",
- "dot": "2525",
- "serialNumber": "XX123",
- "remainingTreadDepth": 2.5,
- "remainingTreadDepthUOM": "mm",
- "regrooved": false,
- "tighteningTorque": 200,
- "axlePosition": 1,
- "wheelPosition": 2,
- "removedArticle": {
- "articleCode": 100176,
- "destination": "STORAGE",
- "dot": "2525",
- "serialNumber": "XX123",
- "remainingTreadDepth": 2.5,
- "remainingTreadDepthUOM": "mm",
- "regrooved": false
}
}
], - "defectToFixCodes": [
- 100017,
- 100018
], - "defectToCancelCodes": [
- 100019,
- 100020
], - "extension": {
- "dueDateSeverity": "HIGH",
- "dueDateName": "+15JOURS",
- "dueDateDaysNumber": 10,
- "registrationNumber": "XX-123-YY",
- "customerVehicleReference": "1040",
- "customerName": "Logistic AB",
- "vehicleTypeCode": "SEMI_TRAILER",
- "customerSiteCity": "Corbas",
- "serviceProviderSiteName": "ERM Corbas",
- "customerType": "B2B"
}
}
}Response samples
- 200
- 400
- 401
{- "code": "100001"
}Get Jobs data
List all the jobs where the service provider site belong to the preferred sites list defined for the user.
Authorizations:
query Parameters
| customerCode | integer <int64> (PartyCodeQueryParam) Example: customerCode=1000001 Filters by the customer code (corresponds to the party code in the Party repository). |
| executionDateFrom | string <date> (ExecutionDateQueryParam) Example: executionDateFrom=2028-09-10 Filters by the start of the actual execution date range (inclusive). |
| executionDateTo | string <date> (ExecutionDateQueryParam) Example: executionDateTo=2028-09-10 Filters by the end of the actual execution date range (inclusive). |
| lastModifiedDateFrom | string <date-time> (lastModifiedDateFromParam) Example: lastModifiedDateFrom=2024-05-02T10:00:00 Filters last modified on or after this date. Supports 'YYYY-MM-DDThh:mm:ss' format. |
| lastModifiedDateTo | string <date-time> (lastModifiedDateToParam) Example: lastModifiedDateTo=2024-05-02T10:00:00 Filters last modified on or before this date. Supports 'YYYY-MM-DDThh:mm:ss' format. |
| pageNumber | integer <int32> (PageNumberParam) [ 1 .. 1000 ] Default: 1 Example: pageNumber=2 The page number |
| pageSize | integer <int32> (PageSizeParam) [ 1 .. 1000 ] Default: 1000 Example: pageSize=2 The page size |
| scheduledDateFrom | string <date> (ScheduledDateQueryParam) Example: scheduledDateFrom=2028-09-10 Filters by the start of the scheduled execution date range (inclusive). |
| scheduledDateTo | string <date> (ScheduledDateQueryParam) Example: scheduledDateTo=2028-09-10 Filters by the end of the scheduled execution date range (inclusive). |
| siteCode | integer <int64> (SiteCodeQueryParam) Example: siteCode=1000001 Filters by the vehicle site code (corresponds to the site code in the Site repository). |
| status | Array of strings (JobStatusQueryParam) Default: ["INITIALIZED","DRAFTED","TO_BE_EXECUTED","CLOSED"] Items Enum: "INITIALIZED" "DRAFTED" "TO_BE_EXECUTED" "CLOSED" Example: status=INITIALIZED&status=TO_BE_EXECUTED By default, all statuses are returned, but one or more specific statuses can be specified for filtering. |
| withExtension | boolean (WithExtensionQueryParam) Default: false Example: withExtension=true Whether to include the extension data |
| customerName | string (CustomerNameQueryParam) <= 255 characters Example: customerName=Logistic AB Customer name, search string using a like |
| customerVehicleReference | string (CustomerVehicleReferenceQueryParam) <= 255 characters Example: customerVehicleReference=1040 Customer vehicle reference, search string using a like |
| registrationNumber | string (RegistrationNumberQueryParam) <= 255 characters Example: registrationNumber=XX-123-YY Registration number, search string using a like. Special characters and spaces ignored |
| serviceProviderSiteName | string (ServiceProviderSiteNameQueryParam) <= 255 characters Example: serviceProviderSiteName=ERM Corbas Service provider site name, search string using a like |
Responses
Response samples
- 200
- 400
- 401
- 404
{- "pagination": {
- "next": "/sale-erm/v1/jobs?pageNumber=3&pageSize=50",
- "previous": "/sale-erm/v1/jobs?pageNumber=1&pageSize=50",
- "pageTotal": "3",
- "totalElements": "125"
}, - "jobs": [
- {
- "code": "1000001",
- "contractorCode": "100176",
- "customerCode": "100176",
- "customerSiteCode": "100001",
- "subscriptionCode": "100178",
- "serviceProviderSiteCode": "100176",
- "customerPurchaseOrderNumber": "BA123889",
- "contractorPurchaseOrderNumber": "BA123889",
- "vehicleCode": "100176",
- "initialStateCode": "100878",
- "finalStateCode": "100345",
- "scheduledDate": "2024-11-15T10:00:00",
- "executionDate": "2024-11-20T15:30:00",
- "dueDateCode": "100178",
- "executionSiteCode": "100179",
- "executionLocation": "123 Main St, Cityville",
- "mileage": 15000,
- "mileageUOM": "KM",
- "workingHours": 300,
- "status": "COMPLETED",
- "items": [
- {
- "articleCode": "100176",
- "quantity": "1",
- "quantityUOM": "ea",
- "sourceType": "SERVICE_PROVIDER",
- "dot": "2525",
- "serialNumber": "XX123",
- "remainingTreadDepth": "8",
- "treadDepthUOM": "mm",
- "regrooved": false,
- "tighteningTorque": 200,
- "axlePosition": 1,
- "wheelPosition": 2,
- "removedArticles": [
- {
- "articleCode": 100178,
- "destination": "STORAGE",
- "dot": "2525",
- "serialNumber": "XX123",
- "remainingTreadDepth": "8",
- "treadDepthUOM": "mm",
- "regrooved": false
}
]
}
], - "defectToFixCodes": [
- "100234",
- "100678"
], - "defectToCancelCodes": [
- "100890"
], - "lastModifiedDate": "2024-12-27T12:23:23",
- "lastModifiedBy": "api_user",
- "extensions": {
- "dueDateSeverity": "HIGH",
- "dueDateName": "+15JOURS",
- "dueDateDaysNumber": 10,
- "registrationNumber": "XX-123-YY",
- "customerVehicleReference": 1040,
- "customerName": "Logistic AB",
- "vehicleTypeCode": "SEMI_TRAILER",
- "customerSiteCity": "Corbas",
- "serviceProviderSiteName": "ERM Corbas",
- "customerType": "B2B"
}
}
]
}Get a job
Get a job if the service provider site belong to the preferred sites list defined for the user.
Authorizations:
path Parameters
| jobCode required | integer <int64> (JobCode) Example: 1000001 Targeted job code |
query Parameters
| withExtension | boolean (WithExtensionQueryParam) Default: false Example: withExtension=true Whether to include the extension data |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
{- "job": {
- "code": "1000001",
- "contractorCode": "100176",
- "customerCode": "100176",
- "customerSiteCode": "100001",
- "subscriptionCode": "100178",
- "serviceProviderSiteCode": "100176",
- "customerPurchaseOrderNumber": "BA123889",
- "contractorPurchaseOrderNumber": "BA123889",
- "vehicleCode": "100176",
- "initialStateCode": "100878",
- "finalStateCode": "100345",
- "scheduledDate": "2024-11-15T10:00:00",
- "executionDate": "2024-11-20T15:30:00",
- "dueDateCode": "100178",
- "executionSiteCode": "100179",
- "executionLocation": "123 Main St, Cityville",
- "mileage": 15000,
- "mileageUOM": "KM",
- "workingHours": 300,
- "status": "COMPLETED",
- "items": [
- {
- "articleCode": "100176",
- "quantity": "1",
- "quantityUOM": "ea",
- "sourceType": "SERVICE_PROVIDER",
- "dot": "2525",
- "serialNumber": "XX123",
- "remainingTreadDepth": "8",
- "treadDepthUOM": "mm",
- "regrooved": false,
- "tighteningTorque": 200,
- "axlePosition": 1,
- "wheelPosition": 2,
- "removedArticles": [
- {
- "articleCode": 100178,
- "destination": "STORAGE",
- "dot": "2525",
- "serialNumber": "XX123",
- "remainingTreadDepth": "8",
- "treadDepthUOM": "mm",
- "regrooved": false
}
]
}
], - "defectToFixCodes": [
- "100234",
- "100678"
], - "defectToCancelCodes": [
- "100890"
], - "lastModifiedDate": "2024-12-27T12:23:23",
- "lastModifiedBy": "api_user",
- "extensions": {
- "dueDateSeverity": "HIGH",
- "dueDateName": "+15JOURS",
- "dueDateDaysNumber": 10,
- "registrationNumber": "XX-123-YY",
- "customerVehicleReference": 1040,
- "customerName": "Logistic AB",
- "vehicleTypeCode": "SEMI_TRAILER",
- "customerSiteCity": "Corbas",
- "serviceProviderSiteName": "ERM Corbas",
- "customerType": "B2B"
}
}
}