Exporting Orders

Method Description

Invoked with a POST request. Operation name is set up via Maestra framework. Details of method invocation can be found here.

POST https://api.maestra.io/v3/operations/sync?endpointId={unique ID of site/mobile app/etc.}&operation={operation name}

Accept: application/xml
Content-Type: application/xml
Authorization: SecretKey {Secret Key, check with the manager it it’s mandatory}

<operation>
  <sinceDateTimeUtc>{Timestamp of the earliest action (UTC, YYYY-MM-DD hh:mm)}</sinceDateTimeUtc>
  <tillDateTimeUtc>{Timestamp of the latest action (UTC, YYYY-MM-DD hh:mm)}</tillDateTimeUtc>
  <segment>
    <ids>
      <externalId>{Segment external ID}</externalId>
    </ids>
  </segment>
</operation>
</operation>

Response

<result>
  <status>Success</status>
  <customerActions>
    <customerAction>
      <ids>
        <customerActionId>{Maestra id}</customerActionId>
        <transactionId>{external action ID}</transactionId>
      </ids>
      <actionTemplate>
        <systemName>{Maestra internal action template name}</systemName>
        <name>{Maestra action template name}</name>
      </actionTemplate>
      <dateTimeUtc>{date of client’s action}</dateTimeUtc>
      <pointOfContact>
        <ids>
          <externalId>{Point of contact external ID}</externalId>
        </ids>
      </pointOfContact>
      <customer>
        <ids>
          <customerId>{Maestra id}</customerId>
          <webSiteId>{Client ID}</webSiteId>
        </ids>
      </customer>
      <order>
        <ids>
          <retailOrderId>{Maestra id}</retailOrderId>
          <myWebSiteId>{site order ID}</myWebSiteId>
        </ids>
        <isCurrentState>{is order state current or historical}</isCurrentState>
        <lines>
          <line>
            <product>
              <ids>
                <myWebSiteId>{site product ID}</myWebSiteId>
              </ids>
            </product>
            <basePricePerItem>{base price per product item}</basePricePerItem>
            <priceOfLine>{end price of receipt line}</priceOfLine>
            <quantity>{quantity}</quantity>
            <status>
              <ids>
                <externalId>{purchase status}</externalId>
              </ids>
            </status>
            <appliedDiscounts>
              <appliedDiscount>
                <type>promoAction</type>
                <id>{internal promotion name}</id>
                <amount>{line discount amount}</amount>
              </appliedDiscount>
              <appliedDiscount>
                <type>balance</type>
                <amount>{line discount amount}</amount>
              </appliedDiscount>
              <appliedDiscount>
                <type>promoCode</type>
                <amount>{line discount amount}</amount>
              </appliedDiscount>
            </appliedDiscounts>
          </line>
        </lines>
        <appliedDiscounts>
          <appliedDiscount>
            <type>promoAction</type>
            <id>{internal promotion name}</id>
            <amount>{order discount amount}</amount>
          </appliedDiscount>
          <appliedDiscount>
            <type>balance</type>
            <amount>{order discount amount}</amount>
          </appliedDiscount>
          <appliedDiscount>
            <type>promoCode</type>
            <amount>{order discount amount}</amount>
          </appliedDiscount>
        </appliedDiscounts>
        <payments>
          <payment>
            <type>{payment method ID}</type>
            <amount>{payment amount}</amount>
          </payment>
        </payments>
        <totalPrice>{order price including discounts (without returned and canceled items)}</totalPrice>
      </order>
    </customerAction>
  </customerActions>
</result>