Orders & Dispatch
Bulk Order
Creates multiple orders in one request. Optional Idempotency-Key applies to the bulk operation.
Responses
- 201 when orders are created synchronously (or idempotent replay), with
orders,summary, and optionalrejectedOrders. - 202 when async processing is enabled (
orderRequestId,status: queued); poll GET/api/v1/business/orders/order-requests/{id}. - 402 when the wallet balance (after holds) is insufficient for the bulk total.
How to call — POST {server}/api/v1/business/orders/bulk with X-API-Key and JSON body { "orders": [ ... ] } (each item matches CreateOrderRequest).
POST
/
api
/
v1
/
business
/
orders
/
bulk
Bulk Order
curl --request POST \
--url https://api-stage.ugift.me/api/v1/business/orders/bulk \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"orders": [
{
"productCode": "<string>",
"merchant": "<string>",
"currency": "GBP",
"valuePurchased": 123,
"recipientEmail": "jsmith@example.com",
"recipientName": "<string>",
"giftMessage": "<string>"
}
]
}
'import requests
url = "https://api-stage.ugift.me/api/v1/business/orders/bulk"
payload = { "orders": [
{
"productCode": "<string>",
"merchant": "<string>",
"currency": "GBP",
"valuePurchased": 123,
"recipientEmail": "jsmith@example.com",
"recipientName": "<string>",
"giftMessage": "<string>"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orders: [
{
productCode: '<string>',
merchant: '<string>',
currency: 'GBP',
valuePurchased: 123,
recipientEmail: 'jsmith@example.com',
recipientName: '<string>',
giftMessage: '<string>'
}
]
})
};
fetch('https://api-stage.ugift.me/api/v1/business/orders/bulk', 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-stage.ugift.me/api/v1/business/orders/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orders' => [
[
'productCode' => '<string>',
'merchant' => '<string>',
'currency' => 'GBP',
'valuePurchased' => 123,
'recipientEmail' => 'jsmith@example.com',
'recipientName' => '<string>',
'giftMessage' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-stage.ugift.me/api/v1/business/orders/bulk"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"productCode\": \"<string>\",\n \"merchant\": \"<string>\",\n \"currency\": \"GBP\",\n \"valuePurchased\": 123,\n \"recipientEmail\": \"jsmith@example.com\",\n \"recipientName\": \"<string>\",\n \"giftMessage\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-stage.ugift.me/api/v1/business/orders/bulk")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"productCode\": \"<string>\",\n \"merchant\": \"<string>\",\n \"currency\": \"GBP\",\n \"valuePurchased\": 123,\n \"recipientEmail\": \"jsmith@example.com\",\n \"recipientName\": \"<string>\",\n \"giftMessage\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-stage.ugift.me/api/v1/business/orders/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"productCode\": \"<string>\",\n \"merchant\": \"<string>\",\n \"currency\": \"GBP\",\n \"valuePurchased\": 123,\n \"recipientEmail\": \"jsmith@example.com\",\n \"recipientName\": \"<string>\",\n \"giftMessage\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"orders": [
{
"_id": "65b0d1e2f3a4b56789012345",
"productCode": "AMAZON_UK_STD",
"merchant": {
"name": "Amazon UK"
},
"currency": "GBP",
"valuePurchased": 25,
"status": "active",
"imageUrl": "https://cdn.ugift.me/products/amazon-uk-card.png"
},
{
"_id": "65b0d1e2f3a4b56789012346",
"productCode": "JL_UK_STD",
"merchant": {
"name": "John Lewis"
},
"currency": "GBP",
"valuePurchased": 50,
"status": "active",
"imageUrl": "https://cdn.ugift.me/products/johnlewis-card.png"
}
],
"summary": {
"totalOrders": 2,
"totalValue": 75,
"currency": "GBP",
"remainingBalance": 1925.5
},
"rejectedOrders": [
{
"productCode": "UNKNOWN_CODE",
"reason": "Product not found"
}
]
}Authorizations
Your UGiftMe API key for authentication.
Format: Secure API key (e.g., <your-api-key>)
Required: All endpoints require this header
Example: X-API-Key: <your-api-key>
Headers
Body
application/json
Show child attributes
Show child attributes
⌘I
Bulk Order
curl --request POST \
--url https://api-stage.ugift.me/api/v1/business/orders/bulk \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"orders": [
{
"productCode": "<string>",
"merchant": "<string>",
"currency": "GBP",
"valuePurchased": 123,
"recipientEmail": "jsmith@example.com",
"recipientName": "<string>",
"giftMessage": "<string>"
}
]
}
'import requests
url = "https://api-stage.ugift.me/api/v1/business/orders/bulk"
payload = { "orders": [
{
"productCode": "<string>",
"merchant": "<string>",
"currency": "GBP",
"valuePurchased": 123,
"recipientEmail": "jsmith@example.com",
"recipientName": "<string>",
"giftMessage": "<string>"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orders: [
{
productCode: '<string>',
merchant: '<string>',
currency: 'GBP',
valuePurchased: 123,
recipientEmail: 'jsmith@example.com',
recipientName: '<string>',
giftMessage: '<string>'
}
]
})
};
fetch('https://api-stage.ugift.me/api/v1/business/orders/bulk', 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-stage.ugift.me/api/v1/business/orders/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orders' => [
[
'productCode' => '<string>',
'merchant' => '<string>',
'currency' => 'GBP',
'valuePurchased' => 123,
'recipientEmail' => 'jsmith@example.com',
'recipientName' => '<string>',
'giftMessage' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-stage.ugift.me/api/v1/business/orders/bulk"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"productCode\": \"<string>\",\n \"merchant\": \"<string>\",\n \"currency\": \"GBP\",\n \"valuePurchased\": 123,\n \"recipientEmail\": \"jsmith@example.com\",\n \"recipientName\": \"<string>\",\n \"giftMessage\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-stage.ugift.me/api/v1/business/orders/bulk")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"productCode\": \"<string>\",\n \"merchant\": \"<string>\",\n \"currency\": \"GBP\",\n \"valuePurchased\": 123,\n \"recipientEmail\": \"jsmith@example.com\",\n \"recipientName\": \"<string>\",\n \"giftMessage\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-stage.ugift.me/api/v1/business/orders/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"productCode\": \"<string>\",\n \"merchant\": \"<string>\",\n \"currency\": \"GBP\",\n \"valuePurchased\": 123,\n \"recipientEmail\": \"jsmith@example.com\",\n \"recipientName\": \"<string>\",\n \"giftMessage\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"orders": [
{
"_id": "65b0d1e2f3a4b56789012345",
"productCode": "AMAZON_UK_STD",
"merchant": {
"name": "Amazon UK"
},
"currency": "GBP",
"valuePurchased": 25,
"status": "active",
"imageUrl": "https://cdn.ugift.me/products/amazon-uk-card.png"
},
{
"_id": "65b0d1e2f3a4b56789012346",
"productCode": "JL_UK_STD",
"merchant": {
"name": "John Lewis"
},
"currency": "GBP",
"valuePurchased": 50,
"status": "active",
"imageUrl": "https://cdn.ugift.me/products/johnlewis-card.png"
}
],
"summary": {
"totalOrders": 2,
"totalValue": 75,
"currency": "GBP",
"remainingBalance": 1925.5
},
"rejectedOrders": [
{
"productCode": "UNKNOWN_CODE",
"reason": "Product not found"
}
]
}