Get One Order Line
Endpoint Overview
This API endpoint is designed to fetch detailed information about a specific single order line from the Juleb ERP system. By providing the ID of the desired order line.
Endpoint Details
- Method: GET
- URL:
/api/v1/pos/order/{orderId}/line/{id}
Parameters
- Path Parameters:
orderId(string, required): The ID of the order record.id(string, required): The ID of the line record to retrieve.
- Query Parameters:
fields(string, not required): Fields to include in the response separated by comma. If not provided, all fields are returned.
Response
- 200 OK: The requested resource has been returned.
- 400 Bad Request: Bad request.
- 401 Unauthorized: Unauthorized.
Response Body
{
"data": {
...record fields
}
}
Example
Request
- NodeJS
- curl
- python
- java
curl -X GET \
-H "accept: */*" \
-H "Authorization: Bearer $API_KEY" \
"https://$ACCOUNT_NAME.juleb.com/api/v1/pos/order/7162/line/8157?fields=name%2C%20product_id%2C%20qty"
const axios = require('axios');
const accountName = process.env.ACCOUNT_NAME;
const apiKey = process.env.API_KEY;
axios.get(`https://${accountName}.juleb.com/api/v1/pos/order/7162/line/8157`, {
headers: {
'accept': '*/*',
'Authorization': `Bearer ${apiKey}`
},
params: {
fields: 'name,product_id,qty'
}
})
.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/pos/order/7162/line/8157?fields=name,product_id,qty"))
.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/pos/order/7162/line/8157'
headers = {
'accept': '*/*',
'Authorization': f'Bearer {api_key}'
}
params = {
'fields': 'name,product_id,qty'
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
print(response.json())
else:
print(f'Error: {response.status_code}', response.text)
Response
{
"data": {
"name": "mjtest/0240",
"product_id": 152,
"qty": 1
}
}