Updating Orders

Method Description

Invoked with a POST request. Operation name is set up via Maestra framework.

When the order is stored in the internal database, site (or cash desk) must confirm successful purchase via the order update service or cancel the order via the same service in case of any issues (one operation is used for confirmation, another one for cancellation). Both operations require full order details along with internal Maestra order ID.

POST https://api.maestra.io/v3/operations/{sync/async}?endpointId={API endpoint ID}&operation={operation name}

Accept: application/xml
Content-Type: application/xml
Authorization: SecretKey {Secret Key}

<order>
  <ids>
    <retailOrderId>{Order ID in Maestra}</retailOrderId>
    <webSiteId>{external order ID}</webSiteId>
  </ids>
  <pointOfContact>{site/store/kiosk ID}</pointOfContact>
  <area>{area ID, if promotions and discounts vary by region}</area>
  <updatedDateTimeUtc>{order update date and time}</updatedDateTimeUtc>
  <customer>
    <email>{customer email}</email>
    <mobilePhone>{customer mobile}</mobilePhone>
    <ids>
      <webSiteUserId>{customer ID}</webSiteUserId>
    </ids>
    <isAuthorized>{true/false, relevant for website. Use false for anonymous orders}</isAuthorized>
  </customer>
  <lines>
    <line>
      <sku>
        <productId>{product ID}</productId>
        <basePricePerItem>{base price per item}</basePricePerItem>
      </sku>
      <quantity>{product item quantity}</quantity>
      <status>{receipt line status}</status>
      <customFields>
        <custom line field>{custom field value}</custom line field>
      </customFields>
      <giftCard>
				<id>{ID of gift card to be purchased}</id>
			</giftCard>
    </line>
  </lines>
  <discounts>
    <discount>
      <type>balance</type>
      <amount>{bonus points to be spent by customer}</amount>
    </discount>
    <discount>
      <type>promoCode</type>
      <id>{promo code value}</id>
      <amount>{promo code discount amount}</amount>
    </discount>
    <discount>
      <type>externalPromoAction</type>
      <id>{promotion ID}</id>
      <amount>{external promotion discount amount}</amount>
    </discount>
  </discounts>
  <deliveryCost>{delivery cost}</deliveryCost>
  <payments>
    <payment>
      <type>giftCard</type>
      <id>{gift card ID}</id>
      <amount>{payment amount}</amount>
    </payment>
    <payment>
      <type>{payment method ID}</type>
      <amount>{payment amount}</amount>
    </payment>
  </payments>
  <totalPrice>{total order price in current status, not including canceled or returned items}</totalPrice>
  <customFields>
    <custom order field>{custom field value}</custom order field>
  </customFields>
</order>