# Procurement Service Bus API

# Response codes

The PSB API provides HTTP response codes for each request that correspond with the body and action the user has attempted. Here are the response codes used by the PSB API:

Code Label Description Retryable
200 OK The request was successfull No
400 BAD REQUEST The server cannot or will not process the request due to a client error. This could be a validation, syntax, or other error. No
401 UNAUTHORIZED Used when authentication is required and has failed or has not yet been provided. No
403 FORBIDDEN The request was valid, but the server is refusing action. No permission to use resource. No
404 NOT FOUND The requested resource could not be found. No
409 CONFLICT The request is already processed and thus duplicated. No
413 CONTENT TOO LARGE The request entity is larger than limits defined by server. No
500 INTERNAL SERVER ERROR A generic error message, given when an unexpected condition was encountered and no more specific message is suitable. Yes
503 SERVICE UNAVAILABLE The server is currently unavailable because it is overloaded or down for maintenance. Yes

# Retry strategy

All response codes in the 5xx range are retryable. We encourage users to implement a retry strategy using exponential backoff with a max number of retry attempts. If the error keeps persisting for a longer time, please contact techsupport@econnect.eu.

# Retry logic for transient errors on uploads

Sometimes operations may fail due to transient errors like network exceptions. In these scenarios the caller did not retrieve the response, and thus did not receive a documentId. The caller will retry sending the document, while it is already processed, causing a duplicate transaction. All our upload APIs are idempotent, which means it can detect duplicate uploads.

# Custom documentId

We allow the caller to define the documentId using the header: X-EConnect-DocumentId. When the caller retries an already processed document it returns the http status code 409 Conflict, which means that the document is already processed, and thus the caller can mark the document as processed. Using this feature makes the API connection more robust and fault-tolerant.

A documentId must be at least six characters long, and MUST not contain special characters like the @ or _. The best practice is to use a UUID or GUID. Please DO NOT use an invoiceId as the documentId since that will cause issues resending an invoice with the same invoiceId.

# IP Whitelisting

These are the public IP addresses from which we publish messages. You can whitelist them if needed.

Environment IP Addresses
Acceptance 51.144.92.226 and 13.81.124.198
Production 104.40.188.59 and 104.47.148.207
© 2024 eConnect International B.V.