Sale API - Apigee (1.3.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 |
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",
- "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 |
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",
- "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"
}
]
}