Skip to main content
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
}'

Overview

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

productId
string
required
Product ID from /catalog
typeId
string
required
Type ID from /checkProduct
quantity
integer
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
  }'

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

Invalid request parameters
Product out of stock
Not enough balance

Processing

Orders are final once placed. Save orderId immediately.
Most orders process within seconds. Poll /checkOrder/:orderId every 5-10 seconds until status is FULFILLED or REFUNDED.