Get POS Order Notifications
Endpoint Overview
This API endpoint retrieves the external RSD notifications/sync status recorded for a specific POS order, within the RSD module of the Juleb ERP.
This endpoint forwards the request to an external RSD service and returns its response as-is —
an empty array [] if there are no notifications yet for that order, otherwise one or more
result groups (see Response Body below).
Endpoint Details
- Method: GET
- URL:
/api/v1/rsd/notifications/pos-order/{orderId}
Parameters
- Path Parameters:
orderId(string, required): The ID of the POS order (see POS Order) to check.
- Query Parameters: None
Response
- 200 OK: Successfully retrieved the notifications (or an empty array if none exist yet).
- 401 Unauthorized: Unauthorized.
Response Body
An array of result groups returned as-is by the external RSD system. A single order's lines
are often split into several groups (one per resultCode), so you may see multiple entries
sharing the same notificationId.
[
{
"notificationId": string,
"gln": string | null,
"resultCode": string,
"successCount": integer,
"failedCount": integer,
"warningCount": integer,
"batches": [
{
"batch": string,
"gtin": string,
"quantity": integer,
"expiry": string
}
],
"englishResult": string,
"arabicResult": string
}
]
resultCode: "00000" means successA resultCode of "00000" means that group of batches was processed successfully by RSD. Any
other code (e.g. "10201", "11043") indicates an error or warning for that group — see
englishResult/arabicResult for the reason, and the related batches may need to be
corrected and resubmitted.
Field Reference
| Field | Type | Description |
|---|---|---|
notificationId | string | The RSD notification/submission ID this result group belongs to. |
gln | string | null | Global Location Number of the facility, if applicable. |
resultCode | string | RSD result code for this group. "00000" = success; any other value is an error/warning. |
successCount | integer | Number of batch entries that succeeded for this result code. |
failedCount | integer | Number of batch entries that failed for this result code. |
warningCount | integer | Number of batch entries that completed with warnings for this result code. |
batches | array | The batch/lot entries this result applies to. |
batches[].batch | string | Batch/lot number. |
batches[].gtin | string | GS1 GTIN of the product. |
batches[].quantity | integer | Quantity submitted for this batch. |
batches[].expiry | string | Expiry date (YYYY-MM-DD). |
englishResult | string | Human-readable result/error message in English. |
arabicResult | string | Human-readable result/error message in Arabic. |
Example
Request
- NodeJS
- curl
- python
- java
curl -X GET \
-H "accept: */*" \
-H "Authorization: ******" \
"https://$ACCOUNT_NAME.juleb.com/api/v1/rsd/notifications/pos-order/7155"
const axios = require('axios');
const accountName = process.env.ACCOUNT_NAME;
const apiKey = process.env.API_KEY;
axios.get(`https://${accountName}.juleb.com/api/v1/rsd/notifications/pos-order/7155`, {
headers: {
'accept': '*/*',
'Authorization': `TOKEN`
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
public class Main {
public static void main(String[] args) throws Exception {
String accountName = System.getenv("ACCOUNT_NAME");
String apiKey = System.getenv("API_KEY");
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("https://" + accountName + ".juleb.com/api/v1/rsd/notifications/pos-order/7155"))
.header("accept", "*/*")
.header("Authorization", "Bearer " + apiKey)
.GET()
.build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
if (response.statusCode() == 200) {
System.out.println(response.body());
} else {
System.out.println("Error: " + response.statusCode() + ", " + response.body());
}
}
}
import os
import requests
account_name = os.getenv('ACCOUNT_NAME')
api_key = os.getenv('API_KEY')
url = f'https://{account_name}.juleb.com/api/v1/rsd/notifications/pos-order/7155'
headers = {
'accept': '*/*',
'Authorization': f'******'
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
print(response.json())
else:
print(f'Error: {response.status_code}', response.text)
Response
If there are no notifications yet for this order, RSD returns an empty array:
[]
Once the order has been processed by RSD, you'll get one or more result groups (see the Field Reference above):
[
{
"notificationId": string,
"gln": string | null,
"resultCode": "00000",
"successCount": integer,
"failedCount": 0,
"warningCount": integer,
"batches": [
{
"batch": string,
"gtin": string,
"quantity": integer,
"expiry": string
}
],
"englishResult": "The operation performed on the product is successful.",
"arabicResult": ".العملية التي تم تنفيذها على المنتج ناجحة"
}
]