younifyd
Menu

Create Orders

Create an order.

POST/organizations/{organizationId}/orders

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Create Orders action (under Orders (Data API)).
  3. Fill in the fields below, then reference the result from later steps as {{createOrders.response.data}}.

Request

Path parameters

organizationIdstringrequired

An identifier for the organization the request is being made by

Query parameters

siteIdstringrequired

The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

Request body

Enter the body as JSON in the step's Body field.

billingAddressanyrequired

The billing address. The name from the billing address is required and is used as the customer's name (for guest customer).

businessTypestring

The business type.

One ofb2cb2b

channelTypestring

The sales channel.

One ofstorefrontcallcentermarketplacedssstorepinteresttwitterfacebookadssubscriptionsonlinereservationcustomerservicecenterinstagramcommercetiktoksnapchatgooglewhatsappyoutube

currencystringrequired

A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.

customerLocalestring

The locale of the customer who created the order.

orderNoany

The order number. This must be unique in the site and is generated if no orderNo is passed in payload.

orderPriceAdjustmentsarray<object>

The order-level price adjustments.

amountnumber (double)

Amount to deduct from the applied line item's price. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax.

basePricenumber (double)

The adjustment amount. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax.

grossPricenumber (double)required

The adjustment amount, including tax.

itemTextstring

The text describing the price adjustment.

netPricenumber (double)required

The adjustment amount, not including tax.

reasonCodestring

The reason code why this price adjustment was made.

taxnumber (double)required

The tax on the adjustment amount.

taxBasisnumber (double)

The amount used to calculate the tax for this adjustment.

orderTotalnumber (double)required

The total price, including products, shipping, and tax. If this value does not match the calculated value (sum of all grossPrices minus PriceAdjustments), an InvalidOrderTotalException is thrown.

paymentInstrumentsarray<object>required

The payment instruments list.

paymentMethodIdstringrequired

The payment method ID.

paymentTransactionany

The payment transaction.

paymentStatusstring

The payment status from the order.

One ofpaidnot_paid

productItemsarray<object>required

The product items.

basePricenumber (double)required

The base price of the line item, which is the unit price not including adjustments. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax.

brandstring

The brand of the line item.

grossPricenumber (double)required

The gross price of the line item before applying any adjustments.

itemTextstring

The text describing the item.

netPricenumber (double)required

The net price of the line item before applying any adjustments.

optionItemsarray<object>10 fields

The array of option items. This array can be empty.

priceAdjustmentsarray<object>8 fields

The price adjustments on product line item.

productIdstringrequired

The id (SKU) of the product.

productNamestring

The name of the product.

quantitynumber (double)required

The ordered quantity of the products represented by this item.

shipmentIdstringrequired

The ID of the shipment to which this item belongs. Shipment 'me' is reserved for the system and is not valid to pass.

taxnumber (double)required

The tax on the line item before applying any adjustments.

taxBasisnumber (double)

The amount used to calculate the tax for this item.

taxRatenumber (double)

The tax rate applicable to this product line item. For a 10% tax rate, the value is 0.1. Just for display. No calculation or sanity checks are applied.

shipmentsarray<object>required

The shipments.

shipmentIdstringrequired

The order-specific ID of the shipment. The field shipmentId from line items refers to this value. The first shipment always become the standard shipment and is named 'me'. The ID 'me' is reserved for the standard shipment and it is not allowed to be used by the API caller.

shippingMethodstringrequired

The shipping method. This has no reference to any shipments configured in the platform.

shippingAddressanyrequired

The shipping address.

shippingTotalnumber (double)required

The total price of all shipping charges in the shipment. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax.

taxTotalnumber (double)required

The total tax on the shipment.

taxTotalnumber (double)required

The total tax amount.

json
{
  "billingAddress": null,
  "currency": "USD",
  "orderTotal": 39.27,
  "paymentInstruments": [
    {
      "paymentMethodId": "PAYPAL",
      "paymentTransaction": null
    }
  ],
  "productItems": [
    {
      "basePrice": 34.32,
      "grossPrice": 34.32,
      "netPrice": 30.32,
      "productId": "apple-ipod-classic",
      "quantity": 3,
      "shipmentId": "shipment00001",
      "tax": 4,
      "brand": "brand0001",
      "itemText": "Green Umbrella",
      "optionItems": [
        {
          "basePrice": 49.99,
          "grossPrice": 99.99,
          "netPrice": 49.99,
          "tax": 0.19,
          "optionId": "consoleWarranty",
          "optionValueId": "000",
          "productId": "apple-ipod-classic",
          "itemText": "Extended Warranty - None",
          "taxBasis": 50,
          "priceAdjustments": [
            {
              "grossPrice": null,
              "netPrice": null,
              "tax": null,
              "amount": null,
              "basePrice": null,
              "itemText": null,
              "reasonCode": null,
              "taxBasis": null
            }
          ]
        }
      ],
      "priceAdjustments": [
        {
          "grossPrice": -6,
          "netPrice": -5,
          "tax": 1,
          "amount": 6,
          "basePrice": -6,
          "itemText": "6 Dollar off.",
          "reasonCode": "Special Offer.",
          "taxBasis": -5
        }
      ],
      "productName": "green umbrella"
    }
  ],
  "shipments": [
    {
      "shipmentId": "shipment00001",
      "shippingMethod": "EXPRESS",
      "shippingAddress": null,
      "shippingTotal": 4.95,
      "taxTotal": 0.75
    }
  ],
  "taxTotal": 0,
  "businessType": "b2c",
  "channelType": "instagramcommerce",
  "customerLocale": "en_US",
  "orderNo": "ORDER_000000001",
  "orderPriceAdjustments": [
    {
      "grossPrice": -6,
      "netPrice": -5,
      "tax": 1,
      "amount": 6,
      "basePrice": -6,
      "itemText": "6 Dollar off.",
      "reasonCode": "Special Offer.",
      "taxBasis": -5
    }
  ]
}

Response

Returns 201 with a any. Read it in later steps with {{createOrders.response.data.<field>}}.

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.