Place Order
curl --request POST \
--url https://api.oneclickdz.com/v3/gift-cards/placeOrder \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: <api-key>' \
--data '
{
"productId": "<string>",
"typeId": "<string>",
"quantity": 123
}
'import requests
url = "https://api.oneclickdz.com/v3/gift-cards/placeOrder"
payload = {
"productId": "<string>",
"typeId": "<string>",
"quantity": 123
}
headers = {
"X-Access-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Access-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({productId: '<string>', typeId: '<string>', quantity: 123})
};
fetch('https://api.oneclickdz.com/v3/gift-cards/placeOrder', 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.oneclickdz.com/v3/gift-cards/placeOrder",
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([
'productId' => '<string>',
'typeId' => '<string>',
'quantity' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Token: <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.oneclickdz.com/v3/gift-cards/placeOrder"
payload := strings.NewReader("{\n \"productId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"quantity\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Token", "<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.oneclickdz.com/v3/gift-cards/placeOrder")
.header("X-Access-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"quantity\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/gift-cards/placeOrder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"quantity\": 123\n}"
response = http.request(request)
puts response.read_bodyGift Cards
Place Order
Purchase gift cards or digital products
POST
/
v3
/
gift-cards
/
placeOrder
Place Order
curl --request POST \
--url https://api.oneclickdz.com/v3/gift-cards/placeOrder \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: <api-key>' \
--data '
{
"productId": "<string>",
"typeId": "<string>",
"quantity": 123
}
'import requests
url = "https://api.oneclickdz.com/v3/gift-cards/placeOrder"
payload = {
"productId": "<string>",
"typeId": "<string>",
"quantity": 123
}
headers = {
"X-Access-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Access-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({productId: '<string>', typeId: '<string>', quantity: 123})
};
fetch('https://api.oneclickdz.com/v3/gift-cards/placeOrder', 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.oneclickdz.com/v3/gift-cards/placeOrder",
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([
'productId' => '<string>',
'typeId' => '<string>',
'quantity' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Token: <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.oneclickdz.com/v3/gift-cards/placeOrder"
payload := strings.NewReader("{\n \"productId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"quantity\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Token", "<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.oneclickdz.com/v3/gift-cards/placeOrder")
.header("X-Access-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"quantity\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/gift-cards/placeOrder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"quantity\": 123\n}"
response = http.request(request)
puts response.read_bodyOverview
Create orders for gift cards and digital products. Cards are delivered digitally via the/checkOrder endpoint.
Before ordering: Verify stock via
/checkProduct and check account
balance.Request Body
string
required
Product ID from
/catalogstring
required
Type ID from
/checkProductinteger
required
Number of cards to order (minimum: 1)
Examples
curl https://api.oneclickdz.com/v3/gift-cards/placeOrder \
-X POST \
-H "Content-Type: application/json" \
-H "X-Access-Token: YOUR_API_KEY" \
-d '{
"productId": "507f1f77bcf86cd799439011",
"typeId": "type_001",
"quantity": 2
}'
const response = await fetch(
"https://api.oneclickdz.com/v3/gift-cards/placeOrder",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY",
},
body: JSON.stringify({
productId: "507f1f77bcf86cd799439011",
typeId: "type_001",
quantity: 2,
}),
}
);
const { data } = await response.json();
console.log("Order ID:", data.orderId);
response = requests.post(
'https://api.oneclickdz.com/v3/gift-cards/placeOrder',
headers={
'Content-Type': 'application/json',
'X-Access-Token': 'YOUR_API_KEY'
},
json={
'productId': '507f1f77bcf86cd799439011',
'typeId': 'type_001',
'quantity': 2
}
)
order_id = response.json()['data']['orderId']
<?php
$data = [
'productId' => '507f1f77bcf86cd799439011',
'typeId' => 'type_001',
'quantity' => 2
];
$ch = curl_init('https://api.oneclickdz.com/v3/gift-cards/placeOrder');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'X-Access-Token: YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = json_decode(curl_exec($ch), true);
$orderId = $response['data']['orderId'];
?>
Success Response
{
"success": true,
"data": {
"orderId": "6901616fe9e88196b4eb64b3"
},
"meta": {
"timestamp": "2025-10-29T01:00:00.000Z"
},
"requestId": "req_1730163600_abc123"
}
Pre-Order Checklist
1
Verify Stock
const product = await checkProduct(productId);
const type = product.types.find(t => t.id === typeId);
if (!type || type.quantity < quantity) {
throw new Error('Insufficient stock');
}
2
Check Balance
const balance = await getBalance();
const totalCost = type.price * quantity;
if (balance < totalCost) {
throw new Error('Insufficient balance');
}
3
Place Order
const order = await placeOrder({ productId, typeId, quantity });
4
Poll for Cards
const result = await pollOrder(order.orderId);
Error Responses
ERR_VALIDATION
ERR_VALIDATION
Invalid request parameters
ERR_STOCK
ERR_STOCK
Product out of stock
INSUFFICIENT_BALANCE
INSUFFICIENT_BALANCE
Not enough balance
Processing
Orders are final once placed. Save
orderId immediately./checkOrder/:orderId every 5-10 seconds until status is FULFILLED or REFUNDED.
Related
Check Order
Get cards when fulfilled
Check Product
Verify stock first
⌘I

