UpsertOrders

UpsertOrders

This takes order information from the request body and inserts or updates in orders and orders_detail tables.

Body Params

Order Validation:

  • Every column type and length must be validated according to the database columns.
  • contact_key, order_id, order_date, order_status, item_count, total_amount columns are required and can not be null or empty
  • quantity > 0 (quantity should be positive integer)
  • item_count should be sum of quantities of items. (item_count == sum(items[].quantity)
  • total_amount should be sum of items paid prices (total_amount == sum(items.discounted_price * items.quantity)
  • order_status, order_source, payment_method values should be validated for valid values
    • order_status = success / refund
    • order_source = web / mobile_app / offline
    • payment_method = cash / bank_transfer / credit_card / debit_card / mobile_payment / check / prepaid_card / crypto / cod / online_payment

Order Item Validation

  • quantity, unit_price and discounted_price should be greater than zero
  • product_id, product_variant_id, quantity, unit_price, discounted_price columns are required and can not be null or empty
  • discounted_price <= unit_price (discounted_price should be smaller or equal to unit_price)

All other columns like contact_key, order_id, order_status, payment_method ... for orders_item should be coming from parent order object.

orders
array of objects
orders
Headers
string
Defaults to {$$.env.access_token}
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

401

Not-authenticated. Please re-login.

403
429

Too Many Requests

Language
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
TooManyRequest