Get a product
curl --request GET \
--url https://api.mymorabaa.com/external/v1/products/{id} \
--header 'X-Api-Key: <x-api-key>'import requests
url = "https://api.mymorabaa.com/external/v1/products/{id}"
headers = {"X-Api-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<x-api-key>'}};
fetch('https://api.mymorabaa.com/external/v1/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mymorabaa.com/external/v1/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mymorabaa.com/external/v1/products/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mymorabaa.com/external/v1/products/{id}")
.header("X-Api-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mymorabaa.com/external/v1/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"sku": {},
"quantity": {},
"price": 123,
"sellPrice": 123,
"isAvailable": true,
"productImageUrl": {},
"variants": [
{}
],
"combinations": [
{}
]
}API reference
Get a product
Retrieve a product by its ID.
GET
https://api.mymorabaa.com
/
external
/
v1
/
products
/
{id}
Get a product
curl --request GET \
--url https://api.mymorabaa.com/external/v1/products/{id} \
--header 'X-Api-Key: <x-api-key>'import requests
url = "https://api.mymorabaa.com/external/v1/products/{id}"
headers = {"X-Api-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<x-api-key>'}};
fetch('https://api.mymorabaa.com/external/v1/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mymorabaa.com/external/v1/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mymorabaa.com/external/v1/products/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mymorabaa.com/external/v1/products/{id}")
.header("X-Api-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mymorabaa.com/external/v1/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"sku": {},
"quantity": {},
"price": 123,
"sellPrice": 123,
"isAvailable": true,
"productImageUrl": {},
"variants": [
{}
],
"combinations": [
{}
]
}Returns one product. Your API key needs the
products:find scope.
Headers
string
required
Your API key. You can use
Authorization: Api-Key your_key instead.Path parameters
string
required
Product GUID.
Request example
curl "$MORABAA_API_URL/external/v1/products/11111111-1111-1111-1111-111111111111" \
--header "X-Api-Key: $MORABAA_API_KEY"
Response
UUID
required
Product ID.
string
required
Product name.
string | null
Product SKU.
number | null
Available quantity.
number
required
List price.
number
required
Effective selling price after an active discount, when one applies.
boolean
required
Whether the product is available.
string | null
Product image URL.
object[]
required
Product variants and their options.
object[]
required
Available option combinations.
{
"id": "11111111-1111-1111-1111-111111111111",
"name": "Arabic coffee",
"sku": "COFFEE-250",
"quantity": 18,
"price": 12000,
"sellPrice": 10000,
"isAvailable": true,
"productImageUrl": "https://cdn.example.com/products/coffee.jpg",
"variants": [],
"combinations": []
}
Errors
| Status | Cause |
|---|---|
400 | id is not a valid GUID. |
401 | The API key is missing or invalid. |
403 | The key lacks the products:find scope. |
404 | No product matches id. |
429 | The rate limit was exceeded. |
500 | An unexpected error occurred. |
{
"error": "product_not_found",
"message": "No product matches the given id."
}
⌘I