Skip to main content

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.

Sales

Sales operation with all operation types

Get Sales data

Get sales data filtered by parameters

Authorizations:
(OAuth2ApiKeyAuth)
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

Content type
application/json
{
  • "pagination": {
    },
  • "sales": [
    ]
}

Create sale data

Create sale

Authorizations:
(OAuth2ApiKeyAuth)
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

Content type
application/json

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": [
    ]
}

Response samples

Content type
application/json
{
  • "code": "1000293"
}

Get invoice document for a specific sale

Get invoice document for a specific sale

Authorizations:
(OAuth2ApiKeyAuth)
path Parameters
code
required
integer <int32> (SaleCode)
Example: 1000001

Targeted sale code

Responses

Response samples

Content type
application/json
{
  • "errors": [
    ]
}

Jobs

Create a job

Create a job

Authorizations:
(OAuth2ApiKeyAuth)
Request Body schema: application/json
object (JobQueryDTO)
contractorCode
required
integer <int32> (PartyCode)

Unique identifier of the party

customerCode
required
integer <int32> (PartyCode)

Unique identifier of the party

customerSiteCode
integer <int32> (SiteCode)

Unique identifier of the site

subscriptionCode
integer <int32> (SubscriptionCode)

Unique identifier of the subscription

serviceProviderSiteCode
integer <int32> (SiteCode)

Unique identifier of the site

customerPurchaseOrderNumber
string (CustomerPurchaseOrderNumber) <= 255 characters

Customer purchase order number

contractorPurchaseOrderNumber
string (ContractorPurchaseOrderNumber) <= 255 characters

Purchase order Number when the contractor purchase the job execution to a service provider

vehicleCode
integer <int32> (VehicleCode)

Unique identifier of the vehicle

initialStateCode
integer <int32> (InspectionCode)

Unique identifier of the inspection

finalStateCode
integer <int32> (InspectionCode)

Unique identifier of the inspection

scheduledDate
string <date> (ScheduledDate)

Scheduled date of the job execution

executionDate
string <date> (ExecutionDate)

Execution date of the job

dueDateCode
integer <int32> (DueDateCode)

Due date code

executionSiteCode
integer <int32> (ExecutionSiteCode)

Execution site code

executionLocation
string (ExecutionLocation) <= 255 characters

The location of the execution

mileage
integer <int32> (Mileage)

Mileage of the vehicle

mileageUOM
string (MileageUOM)
Enum: "km" "mi"

Unit of measurement of the mileage

workingHours
integer <int32> (WorkingHours)

Working hours of the vehicle while inspecting

status
required
string (JobStatus)
Enum: "INITIALIZED" "DRAFTED" "TO_BE_EXECUTED" "CLOSED"

Status of the job

required
Array of objects (JobItemQueryDTO) non-empty
defectToFixCodes
Array of integers <int64> [ items <int64 > ]

List of codes referencing defect to fix

defectToCancelCodes
Array of integers <int64> [ items <int64 > ]

List of codes referencing to cancelled defects

object (JobExtensionQueryDTO)

Responses

Request samples

Content type
application/json

Create a job with the given information

{
  • "jobs": {
    }
}

Response samples

Content type
application/json
{
  • "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:
(OAuth2ApiKeyAuth)
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

Content type
application/json
{
  • "pagination": {
    },
  • "jobs": [
    ]
}

Get a job

Get a job if the service provider site belong to the preferred sites list defined for the user.

Authorizations:
(OAuth2ApiKeyAuth)
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

Content type
application/json
{
  • "job": {
    }
}