The Validation REST API is
designed to expose the capability to check invoice data against corporate
client billing guidelines so that errors and warnings can be identified and
addressed prior to submission of the invoice to the corporate client.
The operation creates a new validation request.
|
Method |
Request URI |
HTTP Version |
|
POST |
{eBHDomain}/validations/api/v1/ValidationRequest |
HTTP/1.1 |
The following table describes required and
optional request headers.
|
Request header |
Description |
|
ProducerId |
Required. Specifies the client on behalf of which the
request is sent. |
|
ProviderKey |
Required. Specifies the access token. |
|
Content-Type |
Required. Specifies the body format. A list of valid
values: application/xml. |
|
Username |
Optional. Specifies the user on behalf of which the
request is sent. The value is used for reporting purposes only and defined by
the caller. |
|
Accept |
Optional. Specifies the expected response format. A list
of valid values: application/json (default), */*. |
|
InvoiceType |
Optional. Specifies the type of submitting invoice. A list
of valid values: ESF, MultipleInvoiceUBF (default),
TimeEntryInvoice, TimeEntryESF. |
XML payload in one of the following
formats: ESF, MultipleInvoiceUBF, TimeEntryInvoice,
TimeEntryESF .
The response includes an HTTP status code, a set
of response headers and a response body,
which contains the identifier of the created validation request.
A successful operation returns status code 201
(Created).
|
Status code |
Description |
|
201 CREATED |
The request was created successfully. See the response
body for details. |
|
400 BAD REQUEST |
The request was incorrectly formatted, missing a required
header or parameters were invalid. |
|
401 UNAUTHORIZED |
The Provider Key is not authorized. |
|
406 NOT ACCEPTABLE |
Provided Accept HTTP Header is not supported. |
|
413 PAYLOAD TOO LARGE |
Too large payload size. |
|
415 UNSUPPORTED MEDIA TYPE |
Provided Content-Type HTTP Header is not supported. |
|
500 INTERNAL SERVER ERROR |
Something went wrong. |
|
Response header |
Description |
|
Location |
The location header indicates the URL to the created
resource. |
|
OperationId |
The unique identifier associated with the request. |
A request was successfully processed:
The identifier
of the created validation request returned.
{
"Id": "05b5eddf-c9d4-435a-b179-6c57ed26d2c5",
"Status": 1
}
An error occurred while processing a request:
{
"Message": "An unexpected error occurred. Please, contact the support team."
}
An error occurred during XSD validation while
processing a request:
{
"Message": "ErrorMessage",
"ModelState": {
"InvoicePayload": [
"The payload does not match expected format"
]
}
}
The operation retrieves a validation request
result.
|
Method |
Request URI |
HTTP Version |
|
GET |
{eBHDomain}/validations/api/v1/ValidationRequest/{id} |
HTTP/1.1 |
The following table describes required and
optional URI parameters.
|
Parameter |
Description
|
|
Id |
Required. A created validation
request identifier returned in the response from Validation API POST request. |
The following table describes required and
optional request headers.
|
Request header |
Description |
|
ProducerId |
Required. Specifies the client on behalf of which the
request is sent. |
|
ProviderKey |
Required. Specifies the access token. |
|
Username |
Optional. Specifies the user on behalf of which the
request is sent. The value is used for reporting purposes only and defined by
the caller. |
|
Accept |
Optional. Specifies the expected response format. A list
of valid values: application/json (default), */*. |
The response includes an HTTP status code, a set
of response headers and a response body,
which contains the results of the processed validation request.
A successful operation returns status code 202
(Accepted) in case validation is in progress, else status code 200 (OK) in case
validation was completed.
|
Status code |
Description |
|
200 OK |
The request was successful. See the response body for
details. |
|
202 ACCEPTED |
The results are not yet
ready. Try again later. |
|
400 BAD REQUEST |
The request was incorrectly formatted, missing a required
header or parameters were invalid. |
|
401 UNAUTHORIZED |
The Provider Key is not authorized. |
|
406 NOT ACCEPTABLE |
Provided Accept HTTP Header is not supported. |
|
500 INTERNAL SERVER ERROR |
Something went wrong. |
|
Response header |
Description |
|
Location |
The location header indicates the URL to the created
resource. |
|
OperationId |
The unique identifier associated with the request. |
A request was successfully processed:
The validation request is in progress (status code 202 Accepted), no validation results returned:
{
"Id": "56ec4bb5-d0f1-4bd5-8bc1-4d28d6269459",
"Status": 1,
"InvoiceType": 3,
"ValidationMessage": null,
"PostTime": "2019-06-04T11:17:09.97Z",
"StartTime": null,
"EndTime": null,
"ValidationResults": []
}
The validation
request was completed (status code 200 OK), validation results returned.
{
"Id": "03a43f3c-a809-4132-9ad3-73087486cd09",
"Status": 4,
"InvoiceType": 3,
"PostTime": "2016-07-07T23:32:55Z",
"StartTime": "2016-07-07T23:32:57Z",
"EndTime": "2016-07-07T23:32:58Z",
"ValidationMessage": "Validation Complete",
"ValidatedInvoiceUrl": "https:///{eBHdomain}/api/v1/ValidationRequest/03a43f3c-a809-4132-9ad3-73087486cd09",
"ValidationResults": [
{
"Severity": "UBF_MESSAGE",
"Identifier": "UBFDocument/consumers/item[@consumerId='1710']/invoices/item[@invoiceId='12744407']/currency",
"Message": "The currency must follow ISO Codes",
"RulePath": "UbfValidation_Ledes_standard.Invoice.invoice_UBF.Validate_currency.Validate_currency"
}
]
}
An error occurred while processing a request:
{
"Message": "An unexpected error occurred. Please, contact the support team."
}