techrar docs
Home
Solutions
Solutions
  • eCommerce SaaS
  • Meals SaaS
  • Meals Marketplaces
API
API
  • Merchant APIs
  • Customer App APIs
  • Meals APIs
Techrar Connect
Home
Solutions
Solutions
  • eCommerce SaaS
  • Meals SaaS
  • Meals Marketplaces
API
API
  • Merchant APIs
  • Customer App APIs
  • Meals APIs
Techrar Connect
  1. Placing Orders
  • GETTING STARTED
    • Account Setup
    • Authentication
    • Webhooks
    • Meals SaaS Overview
  • Offerings & Listings
    • Plans & Versions
    • Plan Categories
    • Display Menus
  • Customer Profiles
    • Customer Profile
    • Authenticating Customers
    • Customer Location
  • Placing Orders
    • Place Subscription Order
    • Order Payment
    • Generate Invoices
  • Subscriptions
    • Subscription Lifecycle
    • Subscription Management
  • Complaints
    • Complaint Lifecycle
    • Complaint Management
  • Delivery
    • Delivery Window
  1. Placing Orders

Place Subscription Order

Complete the checkout flow to create subscription orders for your customers.

Overview#

After customers select a plan and version, use the checkout endpoints to apply discounts, calculate totals, and place the order. The order will be created in pending status, waiting for payment confirmation.
Endpoints: Place Order

Checkout Flow#

1
Apply Discounts (Optional)
Use these endpoints to calculate order totals with discounts:
Apply Voucher: Check voucher code validity and discount
Redeem Wallet: Apply wallet balance (requires wallet enabled)
Get Discount: Combines voucher + wallet in one call
All return the final price breakdown before placing order.
2
Prepare Order Payload
Build the order request with:
Plan version ID
Selected meal options and dates
Delivery/pickup details
Customer location
Discount codes (if applied)
3
Place Order
Submit the order to create a pending order awaiting payment confirmation.
4
Handle Payment
After order is placed:
Option A (Techrar Pay): Receive webhook when payment completes
See Order Payment for details.

Important Headers#

All checkout endpoints require these headers:
Critical
city-id must match the city used when fetching plans

Order Payload Structure#

Delivery Order Example
Pickup Prder Example
{
  "voucher": "WELCOME10",
  "notes": "Ring doorbell",
  "delivery_window_id": 12,
  "location": {
    "id": 9989,
    "is_corporate_location": false
  },
  "cart_items": [
    {
      "subscription": {
        "plan_id": 2455, // Plan Version ID
        "dates": [
          {
            "date": "2025-11-25",
            "options": [101, 102, 103]
          },
          {
            "date": "2025-11-26",
            "options": [104, 105, 106]
          }
        ],
        "is_paused": false,
        "primary_location_id": 9989,
        "secondary_location_id": 9989,
        "notes": "No spicy food"
      },
      "quantity": 1,
      "is_subscription": true
    }
  ],
  "is_subscription": true,
  "is_redeeming": false,
  "channel_app_id": 44
}

Key Payload Fields#

Required for All Orders#

FieldTypeDescription
cart_itemsarrayOrder items (always 1 subscription)
is_subscriptionbooleanAlways true for subscriptions

Subscription Details#

FieldTypeDescription
plan_idintegerPlan version ID (from selected version)
datesarrayMeal selections per date
quantityintegerAlways 1 for subscriptions
is_pausedbooleanStart subscription paused? (usually false)

Dates & Meal Options#

"dates": [
  {
    "date": "2025-11-25",
    "options": [101, 102, 103]
  }
]
date: Delivery date in "YYYY-MM-DD" format (from Plans & Versionsdates array)
options: Meal option IDs for that date (from Plans & Versions masters)
Auto-Select Coming Soon
We're adding auto_select feature where Techrar automatically selects meal options, eliminating the need to send dates array.

Delivery-Specific#

FieldTypeDescription
delivery_window_idintegerTime slot ID (from provider's delivery_windows)
location.idintegerCustomer location ID
primary_location_idintegerSame as location.id
secondary_location_idintegerSame as location.id (optional alternative location)
is_corporate_locationbooleanAlways false

Pickup-Specific#

FieldTypeDescription
is_pickupbooleanSet to true
pickup_branch_idintegerBranch ID (from provider's pickup_branches)

Optional Fields#

FieldTypeDescription
voucherstringVoucher code to apply
is_redeemingbooleanRedeem wallet balance?
notesstringOrder notes
secondary_mobile_numberstringAlternative contact number

Building Dates Array#

The dates array must match the subscription duration:

Step 1: Get Available Dates#

From Plan Details response, use the dates array:
"dates": ["2025-11-25", "2025-11-26", "2025-11-27"]

Step 2: Get Meal Options#

From Plan Details response, use masters to find options for each date:
"masters": [
  {
    "day": "2025-11-25",
    "plan_categories": [
      {
        "name_en": "Breakfast",
        "options": [
          {"id": 101, "product": {...}},
          {"id": 102, "product": {...}}
        ]
      }
    ]
  }
]

Step 3: Build Dates Payload#

For each date, customer selects options:
"dates": [
  {
    "date": "2025-11-25",
    "options": [101, 205, 308]  // Breakfast, Lunch, Dinner
  },
  {
    "date": "2025-11-26",
    "options": [102, 206, 309]
  }
]

Discounts & Wallet#

Voucher Codes#

Add voucher field with code:
{
  "voucher": "WELCOME10",
  ...
}

Wallet Redemption#

Enable wallet redemption:
{
  "is_redeeming": true,
  ...
}
Wallet must be enabled in your App Config. See Customer Profile

Check Discount Before Placing Order#

Call Get Discount endpoint with same payload to see final price:
Returns price breakdown with discounts applied.

Response#

After placing order, you'll receive a full order object.
Go to the next step to handle Order Payment

Common Issues#

Wrong app-id Header#

Problem: Sending sales channel app ID instead of provider app ID
Solution: Use provider's ID from plan's restaurant.id field

Invalid Dates#

Problem: Dates don't match plan's available dates
Solution: Use dates from plan details dates array only

Missing Meal Options#

Problem: Not enough options selected for some dates
Solution: Validate option count matches daily_num_of_items

Location Not Found#

Problem: Invalid location ID
Solution: Verify location was created using Customer Location steps
Modified at 2026-01-14 06:40:07
Previous
Customer Location
Next
Order Payment
Built with