Retrieve order
curl --request GET \
--url https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}', 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://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": null,
"message": "Request successful.",
"data": {
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_number": "LYW-10482",
"source": "storefront",
"store": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_name": "<string>",
"store_email": "jsmith@example.com",
"store_phone": "<string>",
"logo": "<string>",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_name": "<string>",
"customer": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "<string>",
"customer_phone": "<string>",
"customer_email": "jsmith@example.com",
"customer_address": "<string>",
"user": "<string>",
"total_amount": "45000.00",
"subtotal": "45000.00",
"discount_amount": "45000.00",
"tax_amount": "45000.00",
"tax_rate_used": "7.50",
"total_paid": 123,
"outstanding_balance": 123,
"payment_status": "pending",
"payment_status_display": "Pending",
"fulfilment_status": "<string>",
"fulfilment_status_display": "<string>",
"fulfilment_method": "pickup",
"delivery_fee": "45000.00",
"manual_delivery_type": "<string>",
"delivery_address": "<string>",
"delivery_method": "<string>",
"courier": {},
"rate": "<string>",
"tracking_number": "<string>",
"has_shipping": true,
"order_date": "2023-11-07T05:31:56Z",
"shipping_details": {},
"coupon": "<string>",
"items": [
{
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variant": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variant_name": "<string>",
"variant_sku": "<string>",
"product_name": "<string>",
"image": "<string>",
"popup_inventory": "<string>",
"quantity": 123,
"unit_price": "45000.00",
"total_price": "45000.00",
"fulfilment_status": "<string>",
"qty_fulfilled": 123,
"notes": "<string>",
"attributes": [
{
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_name": "Size",
"attribute_value": "Medium"
}
],
"product_images": [
{
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image": "<string>",
"alt_text": "<string>",
"is_primary": true,
"order": 123,
"sort_order": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
],
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Invalid or revoked API key.",
"message": "Authentication failed.",
"data": null
}{
"error": "Product not found.",
"message": "The requested resource does not exist.",
"data": null
}{
"error": "Rate limit exceeded.",
"message": "Too many requests.",
"data": null
}Orders
Retrieve order
Returns the current state of an order, including payment_status and
fulfilment_status. Poll this after the customer returns from Paystack
to confirm payment.
Only orders belonging to the API key’s store are retrievable.
GET
/
api
/
public
/
v1
/
orders
/
{order_number}
Retrieve order
curl --request GET \
--url https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}', 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://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.leyyow.com/api/public/v1/orders/{order_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": null,
"message": "Request successful.",
"data": {
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_number": "LYW-10482",
"source": "storefront",
"store": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_name": "<string>",
"store_email": "jsmith@example.com",
"store_phone": "<string>",
"logo": "<string>",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_name": "<string>",
"customer": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "<string>",
"customer_phone": "<string>",
"customer_email": "jsmith@example.com",
"customer_address": "<string>",
"user": "<string>",
"total_amount": "45000.00",
"subtotal": "45000.00",
"discount_amount": "45000.00",
"tax_amount": "45000.00",
"tax_rate_used": "7.50",
"total_paid": 123,
"outstanding_balance": 123,
"payment_status": "pending",
"payment_status_display": "Pending",
"fulfilment_status": "<string>",
"fulfilment_status_display": "<string>",
"fulfilment_method": "pickup",
"delivery_fee": "45000.00",
"manual_delivery_type": "<string>",
"delivery_address": "<string>",
"delivery_method": "<string>",
"courier": {},
"rate": "<string>",
"tracking_number": "<string>",
"has_shipping": true,
"order_date": "2023-11-07T05:31:56Z",
"shipping_details": {},
"coupon": "<string>",
"items": [
{
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variant": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"variant_name": "<string>",
"variant_sku": "<string>",
"product_name": "<string>",
"image": "<string>",
"popup_inventory": "<string>",
"quantity": 123,
"unit_price": "45000.00",
"total_price": "45000.00",
"fulfilment_status": "<string>",
"qty_fulfilled": 123,
"notes": "<string>",
"attributes": [
{
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_name": "Size",
"attribute_value": "Medium"
}
],
"product_images": [
{
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image": "<string>",
"alt_text": "<string>",
"is_primary": true,
"order": 123,
"sort_order": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
],
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Invalid or revoked API key.",
"message": "Authentication failed.",
"data": null
}{
"error": "Product not found.",
"message": "The requested resource does not exist.",
"data": null
}{
"error": "Rate limit exceeded.",
"message": "Too many requests.",
"data": null
}Authorizations
Store API key created in the Leyyow suite under Settings → Public API.
Sent as Authorization: Bearer <key>.
Path Parameters
Human-readable order number.