Orders

Create order

Creates an order for the site from the given mode, currency, invoice number, customer email, billing address, and line items, plus optional shipping address, shipping method, payment reference, and inventory sync strategy. Returns the created order.

post/api/sites/multiscreen/{site_name}/ecommerce/orders

Request

  • Base URL
    https://api.duda.co
  • URL
    https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/orders
  • Auth
    HTTP basic

Path parameters

site_namestring required

The site's unique name (its ID), returned when the site is created.

Request body

mode'LIVE' | 'TEST' required
currencystring required

Currency ISO code of the order

external_idstring nullable

External reference to the order

status'IN_PROGRESS' | 'PROCESSED' | 'SHIPPED' | 'DELIVERED' | 'PENDING' | 'CANCELLED' | 'DISPATCHED' required
invoice_numberstring required

Unique bureaucratic reference to the order. The invoice number need to be a unique value for all orders on a site

emailstring required

Email of the customer associated to the order

shipping_instructionsstring nullable

Special instructions left by the customer for the delivery

inventory_sync_strategy'IGNORE' | 'SYNC'
user_agentstring nullable

User agent of the customer when placed the order

ip_addressstring nullable

The Ip address from which the order was placed

createdstring date-time nullable

The date and time when the order was placed

metadatastring nullable

Merchant defined JSON data for the whole order

Example request

{
  "currency": "CAD",
  "external_id": "my-custom-id-123",
  "invoice_number": "ECOMM-1001",
  "email": "john.doe@example.org",
  "items": [
    {
      "product_id": "abc123",
      "name": "Red T-Shirt",
      "image": "https://example.org/my-image.jpg",
      "options": [
        {
          "name": "Color",
          "value": "Red"
        }
      ],
      "quantity": 2,
      "shippable": true,
      "unit_price": 10.25,
      "unit_weight": 14,
      "unit_dimensions": {
        "height": 10,
        "width": 25,
        "length": 12
      },
      "taxes": [
        {
          "name": "Federal tax",
          "amount": 10.45
        }
      ],
      "discounts": [
        {
          "name": "End of season promotion",
          "amount": 10.45
        }
      ],
      "metadata": "{\"foo\":\"bar\"}"
    }
  ],
  "shipping_method": {
    "name": "Express shipping",
    "cost": 10.34
  },
  "shipping_instructions": "Leave the box at the door. Beware of the dog!",
  "payment": {
    "transaction_id": "my-transaction-123"
  },
  "user_agent": "\n                Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0\n                Safari/537.36\n            ",
  "ip_address": "1.1.1.1",
  "created": "2023-02-21T22:34:35.857Z",
  "metadata": "{\"foo\": \"bar\"}"
}

Response

Created

source'CHECKOUT' | 'EXTERNAL' | 'SUBSCRIPTION_BILLING_ENGINE' | 'ECWID'
mode'LIVE' | 'TEST'
tax_mode'TAXES_EXCLUDED_FROM_PRICE' | 'TAX_INCLUDED_WITH_NET_PRICE' | 'TAX_INCLUDED_WITH_GROSS_PRICE'
idstring

Unique identifier of the order.

external_idstring nullable
status'IN_PROGRESS' | 'PROCESSED' | 'SHIPPED' | 'DELIVERED' | 'PENDING' | 'CANCELLED' | 'DISPATCHED'
emailstring

Email associated with the order.

invoice_numberstring

Invoice number of the order.

shipping_instructionsstring nullable
subtotalnumber double

Cost of the order before any additions (i.e.: Taxes, Shipping, etc.)

totalnumber double

The total cost of the order.

createdstring date-time

Date that indicates when the order was completed.

user_agentstring

User agent of the customer who made the order.

customer_accepts_email_marketingboolean nullable
customer_accepts_sms_marketingboolean nullable
customer_accepts_marketingboolean

Indicates if the customer accepts marketing outreach.

ip_addressstring

IP address of the customer who made the order.

cancellation_reasonstring nullable

Reason why the order was cancelled.

cancelledstring date-time nullable

Date when the order was cancelled.

metadatastring

Metadata associated with the order.

Changes

No recorded changes to this operation across all 1 revision of this API.