Order Recalculation

Method Description

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

The service is used to precalculate price updates in existing orders. It accepts the entire order with all applicable discounts requested by the customer as input.

The response contains order info with recalculated prices (based on currently applicable point-of-contact promotions, promo codes, and other discounts) and details of all customer-requested discounts.

POST https://project-services.mindbox.cloud/v2.1/orders/v2.1/orders/get-order-recalculation-info?operation={operation name}

Accept: application/xml
Content-Type: application/xml
Authorization: DirectCrm key="{secret key, check with the manager if it's mandatory}"


<order>
  <pointOfContact>{site/store/kiosk ID}</pointOfContact>
  <area>{area ID}</area>
  <ids>
    <mindbox>{Mindbox order ID}</mindbox>
    <webSiteId>{external order ID}</webSiteId>
  </ids>
  <lines>
    <line>
      <sku>
        <productId>{product ID}</productId>
        <basePricePerItem>{base price per item}</basePricePerItem>
      </sku>
      <quantity>{product item quantity}</quantity>
      <customFields>
        <custom line field>{custom field value}</custom line field>
      </customFields>
    </line>
  </lines>
  <discounts>
    <discount>
      <type>balance</type>
      <amount>{bonus points that customer wants to spend}</amount>
    </discount>
    <discount>
      <type>promoCode</type>
      <id>{promo code value}</id>
    </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>
    </payment>
    <payment>
      <type>{payment method ID}</type>
    </payment>
  </payments>
  <customFields>
    <custom order field>{custom field value}</custom order field>
  </customFields>
  <totalPrice>{pre-update order price}</totalPrice>
</order>

Response Description

<order>
  <pointOfContact>{Point of Contact ID, site/store/kiosk/etc.}</pointOfContact>
  <area>{area ID, if promotions and discounts vary by region}</area>
  <lines>
    <line>
      <sku>
        <productId>{product ID}</productId>
        <basePricePerItem>{base price per product item}</basePricePerItem>
      </sku>
      <quantity>{product item quantity}</quantity>
      <discountedPrice>{discounted price per receipt line}</discountedPrice>
      <appliedDiscounts>
        <appliedDiscount>
          <type>promoAction</type>
          <id>{promotion ID}</id>
          <amount>{discount amount, applied to receipt line}</amount>
        </appliedDiscount>
        <appliedDiscount>
          <type>balance</type>
          <amount>{discount amount, applied to receipt line}</amount>
        </appliedDiscount>
        <appliedDiscount>
          <type>promoCode</type>
          <amount>{discount amount, applied to receipt line}</amount>
        </appliedDiscount>
        <appliedDiscount>
          <type>externalPromoAction</type>
          <id>{promotion ID}</id>
          <amount>{discount amount for external promotion}</amount>
        </appliedDiscount>
      </appliedDiscounts>
      <placeholders>
        <placeholder>
          <id>{text output placeholder ID}</id>
          <content>
            <contentItem>
              <type>text</type>
              <promoActionId>{internal promotion name, applicable to receipt line}</promoActionId>
              <value>{promotion description, applicable to receipt line}</value>
            </contentItem>
          </content>
        </placeholder>
      </placeholders>
    </line>
  </lines>
  <appliedDiscounts>
    <appliedDiscount>
      <type>promoAction</type>
      <id>{internal promotion name}</id>
      <amount>{discount amount, applied to order}</amount>
    </appliedDiscount>
    <appliedDiscount>
      <type>balance</type>
      <amount>{discount amount, applied to order}</amount>
    </appliedDiscount>
    <appliedDiscount>
      <type>promoCode</type>
      <amount>{discount amount, applied to order}</amount>
    </appliedDiscount>
    <appliedDiscount>
      <type>externalPromoAction</type>
      <id>{promotion ID}</id>
      <amount>{external promotion discount amount}</amount>
    </appliedDiscount>
  </appliedDiscounts>
  <discountedTotalPrice>{order price with discounts}</discountedTotalPrice>
  <payments>
    <payment>
      <type>giftCard</type>
      <id>{gift card ID}</id>
    </payment>
    <payment>
      <type>{payment method ID}</type>
      <amount>{payment amount}</amount>
    </payment>
  </payments>
  <placeholders>
    <placeholder>
      <id>{text output placeholder ID}</id>
      <content>
        <contentItem>
          <type>text</type>
          <promoActionId>{internal promotion name, applicable to this order}</promoActionId>
          <value>{promotion description, applicable to this order}</value>
        </contentItem>
      </content>
    </placeholder>
  </placeholders>
  <discountsInfo>
    <discountInfo>
      <type>Balance</type>
      <availableAmountForCurrentOrder>{bonus points available for this order}</availableAmountForCurrentOrder>
      <balance>
        <total>{total bonus points}</total>
        <available>{available bonus points}</available>
        <blocked>{blocked bonus points}</blocked>
      </balance>
    </discountInfo>
    <discountInfo>
      <type>promoCode</type>
      <availableAmountForCurrentOrder>{amount available to pay for this order with a promo code}</availableAmountForCurrentOrder>
      <promoCode>
        <id>{promo code value}</id>
        <status>{promo code status, CanBeUsed/Inactive/AlreadyUsed/NotFound/AlreadyCantBeUsed/Blocked/CanNotBeUsedForCurrentOrder}</status>
        <availableFromDateTimeUtc>{promo code start date and time}</availableFromDateTimeUtc>
        <availableTillDateTimeUtc>{promo code expiry date and time}</availableTillDateTimeUtc>
        <usedDateTimeUtc>{promo code used date and time}</usedDateTimeUtc>
      </promoCode>
    </discountInfo>
  </discountsInfo>
  <paymentsInfo>
    <paymentInfo>
      <type>giftCard</type>
      <availableAmountForCurrentOrder>{amount from gift card, available to pay for this order}</availableAmountForCurrentOrder>
      <giftCard>
        <id>{gift card number}</id>
        <status>{card status, NotFound/AlreadyUsed/CanBeUsed/Blocked/CannotBeUsedInCurrentOrder/Inactive}</status>
        <balance>
          <total>{gift card face value}</total>
          <available>{amount available}</available>
          <used>{amount spent}</used>
        </balance>
      </giftCard>
    </paymentInfo>
  </paymentsInfo>
  <customer>
    <status>{customer status, Found/NotFound}</status>
    <email>{customer email}</email>
    <mobilePhone>{mobile phone}</mobilePhone>
    <lastName>{customer last name}</lastName>
    <firstName>{customer first name}</firstName>
    <birthDate>{date of birth as YYYY-MM-DD}</birthDate>
    <discountCards>
      <discountCard>
        <id>{discount card number}</id>
        <status>{card status}</status>
              <type>
                  <id>{card type ID}</id>
                  <percentDenomination>{card discount}</percentDenomination>
              </type>
          </discountCard>
      </discountCards>
  </customer>
  <previousTotalPrice>{pre‑update order price}</previousTotalPrice>
  <discountedTotalPrice>{current order price}</discountedTotalPrice>
  <totalAcquiredBalanceChange>{bonus points to be awarded for this order}</totalAcquiredBalanceChange>
</order>