---
title: "Kreiranje porudžbine | Tajo"
description: "Sinhronizujte porudžbine iz onlajn prodavnice sa Brevom radi obračuna lojalti poena i angažovanja kupaca"
url: https://tajo.io/sr/docs/ecommerce-loyalty/orders/create-order/
markdown: https://tajo.io/sr/docs/ecommerce-loyalty/orders/create-order.md
lang: sr-Latn-RS
author: "Set Noa"
author_url: https://tajo.io/sr/set-noa/
robots: noindex
---

Zatražite rani pristup

Unesite ime i poslovnu adresu e-pošte. Poslaćemo vam vezu za potvrdu zahteva za pristup Taju.

# Kreiranje porudžbine

[Set Noa](https://tajo.io/sr/set-noa/)

Sinhronizujte porudžbine iz onlajn prodavnice sa Brevom da biste automatski obračunali lojalti poene, ažurirali nivoe kupaca i pokrenuli personalizovane marketinške kampanje.

## Brzi početak

### Osnovno kreiranje porudžbine

```http
POST https://api.brevo.com/v3/ecommerce/orders
Content-Type: application/json
api-key: YOUR_API_KEY

{
  "id": "ORD-2024-001",
  "email": "customer@example.com",
  "billing": {
    "address": "123 Main St",
    "city": "New York",
    "country": "US",
    "phone": "+1234567890"
  },
  "products": [
    {
      "id": "PROD-123",
      "name": "Premium Widget",
      "quantity": 2,
      "price": 149.99,
      "category": ["Electronics", "Gadgets"]
    }
  ],
  "revenue": 309.97,
  "date": "2024-01-25T14:30:00Z"
}
```

### Odgovor

```json
{
  "id": "ORD-2024-001",
  "created": true,
  "loyaltyPointsAwarded": 310
}
```

## Integracija sa Tajo lojalti programom

### Porudžbina sa obračunom lojalti poena

```json
{
  "id": "ORD-2024-001",
  "email": "customer@example.com",
  "customerId": "CUST-12345",
  "loyaltyId": "LYL-2024-001",

  "billing": {
    "name": "John Doe",
    "address": "123 Main St",
    "city": "New York",
    "state": "NY",
    "country": "US",
    "zipCode": "10001",
    "phone": "+1234567890"
  },

  "shipping": {
    "name": "John Doe",
    "address": "456 Oak Ave",
    "city": "Brooklyn",
    "state": "NY",
    "country": "US",
    "zipCode": "11201",
    "method": "Standard Shipping",
    "cost": 9.99
  },

  "products": [
    {
      "id": "PROD-123",
      "name": "Smart Watch Pro",
      "variant": "Black/42mm",
      "sku": "SW-PRO-BLK-42",
      "quantity": 1,
      "price": 299.99,
      "category": ["Electronics", "Wearables"],
      "brand": "TechBrand",
      "loyaltyPointsEarned": 300,
      "loyaltyMultiplier": 1.0
    },
    {
      "id": "PROD-456",
      "name": "Wireless Charger",
      "sku": "WC-FAST-01",
      "quantity": 1,
      "price": 49.99,
      "category": ["Electronics", "Accessories"],
      "loyaltyPointsEarned": 50,
      "loyaltyMultiplier": 1.0
    }
  ],

  "financial": {
    "subtotal": 349.98,
    "shipping": 9.99,
    "tax": 28.00,
    "discount": 35.00,
    "total": 352.97,
    "currency": "USD",
    "paymentMethod": "Credit Card",
    "paymentStatus": "Completed"
  },

  "loyalty": {
    "pointsEarned": 353,
    "bonusPoints": 50,
    "pointsMultiplier": 1.2,
    "tierBefore": "Silver",
    "tierAfter": "Gold",
    "tierUpgraded": true,
    "totalPointsBalance": 2853,
    "couponUsed": "SAVE10",
    "couponDiscount": 35.00
  },

  "metadata": {
    "source": "Website",
    "campaign": "Summer Sale",
    "referrer": "Google Ads",
    "userAgent": "Mobile App",
    "firstPurchase": false,
    "returningCustomer": true
  },

  "date": "2024-01-25T14:30:00Z",
  "status": "Completed"
}
```

## Napredne lojalti funkcije

### Porudžbina sa rođendanskim bonusom

```json
{
  "loyalty": {
    "pointsEarned": 200,
    "birthdayBonus": 500,
    "bonusReason": "Birthday Month",
    "totalBonusPoints": 500,
    "pointsMultiplier": 2.0,
    "specialOffer": "Double Points Week"
  }
}
```

### Porudžbina po preporuci

```json
{
  "loyalty": {
    "pointsEarned": 150,
    "referralBonus": 250,
    "referredBy": "CUST-67890",
    "referralCode": "REF-FRIEND50",
    "firstPurchaseBonus": 100
  },
  "metadata": {
    "isReferralOrder": true,
    "referralSource": "Friend Referral"
  }
}
```

### Pretplatnička porudžbina

```json
{
  "subscription": {
    "id": "SUB-2024-001",
    "type": "Monthly",
    "frequency": 30,
    "nextBilling": "2024-02-25",
    "isRecurring": true
  },
  "loyalty": {
    "pointsEarned": 100,
    "subscriptionBonus": 50,
    "loyaltyMultiplier": 1.1
  }
}
```

## Kategorije proizvoda za lojalti program

### Množioci poena po kategoriji

```json
{
  "products": [
    {
      "id": "PROD-LUXURY-001",
      "category": ["Luxury", "Fashion"],
      "loyaltyMultiplier": 2.0,
      "loyaltyPointsEarned": 400
    },
    {
      "id": "PROD-ECO-001",
      "category": ["Eco-Friendly", "Sustainable"],
      "loyaltyMultiplier": 1.5,
      "loyaltyBonus": "Eco Warrior"
    }
  ]
}
```

## Ažuriranje statusa porudžbine

### Realizacija porudžbine

```json
{
  "id": "ORD-2024-001",
  "status": "Shipped",
  "tracking": {
    "number": "TRK123456789",
    "carrier": "UPS",
    "url": "https://tracking.ups.com/TRK123456789"
  },
  "fulfillment": {
    "date": "2024-01-26T10:00:00Z",
    "warehouse": "NYC-01",
    "method": "Ground Shipping"
  }
}
```

### Završetak porudžbine

```json
{
  "id": "ORD-2024-001",
  "status": "Delivered",
  "delivery": {
    "date": "2024-01-28T16:30:00Z",
    "signature": "Customer",
    "location": "Front Door"
  },
  "loyalty": {
    "reviewIncentive": 25,
    "reviewIncentiveExpiry": "2024-02-28"
  }
}
```

## Grupna obrada porudžbina

Kreirajte više porudžbina za grupnu sinhronizaciju:

```json
{
  "orders": [
    {
      "id": "ORD-2024-001",
      "email": "customer1@example.com",
      "products": [...],
      "revenue": 199.99
    },
    {
      "id": "ORD-2024-002",
      "email": "customer2@example.com",
      "products": [...],
      "revenue": 299.99
    }
  ]
}
```

## Obrada grešaka

```json
{
  "code": "duplicate_order",
  "message": "Order ID already exists",
  "details": {
    "orderId": "ORD-2024-001",
    "existingDate": "2024-01-25T14:30:00Z"
  }
}
```

```json
{
  "code": "invalid_customer",
  "message": "Customer email not found",
  "details": {
    "email": "unknown@example.com",
    "suggestion": "Create contact first"
  }
}
```

## Integracija sa webhook-ovima

Podesite webhook-ove da biste sinhronizovali promene statusa porudžbine:

```json
{
  "webhookUrl": "https://your-tajo-app.com/webhooks/brevo",
  "events": [
    "order.created",
    "order.updated",
    "order.shipped",
    "order.delivered",
    "loyalty.points.awarded"
  ]
}
```

## Najbolje prakse za Tajo

1. **Sinhronizacija u realnom vremenu**: kreirajte porudžbine odmah nakon naplate
2. **Potpuni podaci**: uključite sve informacije relevantne za lojalti program
3. **Ažuriranje statusa**: održavajte status porudžbine aktuelnim radi tačnog praćenja
4. **Oporavak od grešaka**: pažljivo obradite duple porudžbine i kupce koji nedostaju
5. **Obračun poena**: proverite da li se obračun lojalti poena poklapa sa vašim sistemom
6. **Segmentacija kupaca**: koristite podatke o porudžbinama za ciljane kampanje

## Analitika i izveštavanje

Pratite ključne pokazatelje:

- Trendove vrednosti porudžbina
- Stope iskorišćenja lojalti poena
- Životnu vrednost kupca
- Obrasce napredovanja kroz nivoe
- Efikasnost kampanja

## Sledeći koraci

- Ažurirajte status porudžbine
- Podesite lojalti programe
- Konfigurišite pravila za poene
- Kreirajte kategorije proizvoda
