Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guide iconUser guide
Developer guide iconDeveloper guide
Admin guide iconAdmin guide
English
  • Русский
  • English
Login
    User API documentation
    API interaction
    Matching
      Profilesarrow
    • Import profile
      Update profile
      Import multiple profiles
      Update multiple profiles
      Add multiple profiles
      Add profile to database
      Quick profile import
      Import profile to RabbitMQ
      Get profile data
      Uploading profiles to a file
      Suspend all database profiles
      Unsuspend all profiles in a database
      Delete profile
      Subscription fields functional update
      Database fields functional update
      Merging multiple profiles
      Unsubscribe profile from resource
      Profile splitting
        Subscriptionsarrow
      • Add or edit subscription
        Get all profile subscriptions
        Get all subscriptions from multiple profiles
        Get profile subscription
        Delete profile subscription
        Restore deleted subscription
        Suspend all subscriptions
        Unsuspend all suspended subscriptions
        Action historyarrow
      • Get profile action history
        Get multiple profiles action history
        Profile relationsarrow
      • Attach relation
        Detach relation
        Modify relation properties
        Overwrite relation properties
        Get profile relations info
        Get profile relations info
      Get data for multiple profiles
      Databasesarrow
    • Get database statistics
      Update statistics on database
      Get database list
      Get database information
      Get database fields
      Database wipe
      Resourcesarrow
    • Get resource statistics
      Update statistics on resource
      Get resources list
      Get resource information
      Get resource subscription fields
      Segmentsarrow
    • Get statistics on resource
      Update statistics on segment
      Add or remove profile
      Get profile data in a static segment
      Create segment
      Update segment
      Get segment information
      Get segments list
      Delete segment
      Suppression listsarrow
    • Create suppression list
      Update suppression list
      Get suppression list info
      Get the list of suppression lists
      Delete suppression list
      Upload suppression list data to file
        Suppression list actionsarrow
      • Check if email is suppressed
        Add email to suppression list
        Add multiple emails to suppression list
        Remove email from suppression list
        Remove all emails from suppression list
        Check if domain is suppressed
        Add domain to suppression list
        Add multiple domains to suppression list
        Remove domain from suppression list
        Remove all domains from suppression list
        Check if phone number is suppressed
        Add phone number to suppression list
        Add multiple phones to suppression list
        Remove phone number from suppression list
        Remove all phone numbers from suppression list
      Templates and fragmentsarrow
    • Get templates list
      Get template info
      Delete template
      Add template
      Update template
      Channel object
      Campaignsarrow
    • Get campaign information
      Get campaign list
      Activate campaign
      Complete campaign
      Deactivate campaign
      Get campaign status
      Mailingsarrow
    • Activate mailing
      Deactivate mailing
      Get mailing list
      Get mailing information
      Get mailing log
      Clone mailing
      Delete mailing
      Get mailing status
        Broadcast mailingsarrow
      • Get broadcasts list
        Get broadcast information
        Create broadcast mailing
        Update broadcast mailing
        Launch a broadcast mailing
        Regular mailingsarrow
      • Get regular mailings list
        Get regular mailing information
        Create regular mailing
        Update regular mailing
        Launch a regular mailing
        Trigger mailingsarrow
      • Get trigger mailings list
        Get trigger mailing information
        Create trigger mailing
        Update trigger mailing
        Trigger launch (API call)
        Profile import + trigger mailing launch
        Task for bulk trigger launch
        Task for bulk profiles import + trigger launch
        Bulk trigger launch
        Bulk profiles import + trigger mailing launch
        Clone a trigger mailing
        Data array
      Automation scenariosarrow
    • Engage profile in scenario
      Import and engage profile in scenario
      Batch import and engage profiles in a scenario
      Task for batch import and engaging profiles in the scenario
      Get scenarios list
      Activate scenario
      Deactivate scenario
      Loyalty Programsarrow
    • Get profile tier in a loyalty program
      Export points transactions
      Expiring points for a period
      Get profile account transactions
      Get trigger promotions list
      Accrue points to a member
      Redeem member points
      Commit temporary transaction
      Preliminary Order Calculation
      Order Confirmation
      Roll back temporary transaction
      Cancel points transaction
      Get points account balance
      Register member in a loyalty program
      Remove member from loyalty program
      Promo codesarrow
    • Import promo codes
      Get promo code information
      Activate promo code
      Update promo code
      Attach promo code
      Detach promo code
      Get all promo codes
      Goalsarrow
    • Goals and goal values registration
      Application push notificationsarrow
    • Processing and adding a subscription
      Add app push events
      Marketarrow
      • Market objectsarrow
      • Order data object
        Product data object
        SKU data object
        Categories array
        Custom fields array
        Ordersarrow
      • Import order and item statuses
        Get orders list
        Delete order
        Get order status
        Update order line status
        Products and SKUarrow
      • Import products, SKUs and categories
        Import SKUs and categories
        Get products list
        Get SKUs list
        Delete products
        Delete SKU
      Analytic reportsarrow
    • Get summary report
      Get soft bounces report
      Get undeliveries report
      SendersDevarrow
    • Get senders list
        Virtual senders (Smart accounts only)arrow
      • Get virtual senders list
        Get virtual sender information
        Clone virtual sender
        Create virtual sender
        Update virtual sender
        Delete virtual sender
      External datatables queriesarrow
      • Segmentation queriesarrow
      • Add segmentation query
        Update segmentation query
        Get segmentation query information
        Get segmentation queries list
        Delete segmentation query
        Template queriesarrow
      • Add template query
        Update template query
        Get template query information
        Get template queries list
        Delete template query
      Objectsarrow
    • AKMTA object
      Content object
      Email rule object
      File object
      Profile data object
      SMS rule object
      Sender object
      Sender types
      Start schedule object
      Subscription object
      Trigger types
      Miscellaneousarrow
    • Upload file
      Get message web version
      Push providers
      Deduplication of requests
      How to send API request with RabbitMQ
      List of gender identifications
      Obtain valid values for fields: browsers, devices, tz, oses, languages
    Importing the API collection in Postman
    List of API endpoints
      SDKarrow
      • mSDKarrow
        • Androidarrow
        • Quick Start
          SDK Functionality
          SDK Configuration
          Public SDK API
            Provider configuration androidarrow
          • Firebase Cloud Messaging
            Huawei Mobile Services
            RuStore
          iOSarrow
        • Quick Start
          SDK Functionality
          SDK Configuration
          Public SDK API
            Provider configurationarrow
          • Apple Push Notification Service
            Firebase Cloud Messaging
            Huawei Mobile Services
          React Native (Android/iOS)arrow
        • Quick Start
          SDK Configuration
          SDK Functionality
          Public SDK API
          Provider setup
        Managing JWT and Role Token
  • Loyalty Programs
  • Preliminary Order Calculation

Preliminary Order Calculation

Description​

The preorder method allows you to perform a preliminary order calculation considering promotions and loyalty program member points.

The request result can be used to display final amounts, discounts, and write-offs before creating the final order.

tip

This method does not create an order in the system; it returns the calculated state of the order with applied market and loyalty rules. To create the calculated order after a successful preorder, use the preorder_commit method.

URL​

Method: POST

https://example.com/api/v1.1/market/orders/preorder

Request Parameters​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
external_idstring"12"YesExternal order ID
matchingstring

"email"
"phone"
"profile_id"
"custom"

Yes

Method for searching the loyalty program member profile

emailstring"example@example.com"If matching = emailMember's email
phonestring"+79000000000"If matching = phoneMember's phone number
profile_idstring"696e304f547840a7286619e0"If matching = profile_idProfile ID
dataJSON object
{
   "endpoint": "site",
   "status": "new",
   "currency": "RUB",
   "total_price": "139999.00",
   "lines": [...]
}
Yes

The data object contains order data

tip

The lines field is required and must contain at least one order item.

data object​

ParameterTypeExampleRequiredDescription
endpointstring"bot", "website"YesOrder source (touchpoint). Must be configured in the Market module
statusstring"new", "confirmed", "paid"YesOrder status. Uses statuses configured in the platform
currencystring"RUB", "USD", "EUR"YesOrder currency (three-letter ISO code)
total_pricestring"2500.00"YesTotal order cost before discounts
final_total_pricestring"2150.00"YesFinal order cost after applying all discounts
delivery_coststring"300.00"NoDelivery cost
create_timestring (ISO 8601)"2026-02-18T13:01:05.141Z"NoOrder creation date and time. If not provided, the current server time is used
regionstring"region_moscow"NoRegion identifier for applying regional prices and promotions
linesarraySee "lines array" section belowYesArray of order items. Must contain at least 1 element
promocodesarraySee "promocodes array" section belowNoArray of promo codes applied to the order
applied_promotionsarraySee "applied_promotions array" section belowNoPromotions applied to this order.
redeem_pointsarraySee "redeem_points array" section belowYes, if type="redeem_points" is specified in applied_promotionsArray of point redemptions by point currency types
custom_fieldsobject
{
"field1": "value1",
"field2": "value2"
}
NoOrder custom fields
tagsarray
[
"summer_sale",
"first_order"
]
NoTags for labeling the order

lines array​

The array contains information about the order items. Must contain at least 1 item.

Each item is a separate object within the array with the following parameters:

ParameterTypeExampleRequiredDescription
external_idstring"line_1"YesExternal line ID in the client's system
productstring"iphone17pmb256"Yes*Product identifier
skustring"IPHONE17-256-BLACK"Yes*SKU identifier
line_numberinteger1NoSequential line number in the order
countinteger1YesQuantity of the product
base_price_per_itemstring"139999.00"YesBase price per unit
min_price_per_itemstring"130000.00"NoMinimum allowable price per unit
final_price_per_itemstring"139500.00"YesFinal price per unit after applying all discounts
statusstring"new"NoOrder line status
custom_fieldsobject{"color": "black", "size": "XL"}NoLine custom fields
applied_promotionsarraySee "applied_promotions array" section belowNoPromotions applied to this line.

* — one of the parameters is required: product or sku

promocodes array​

The array contains objects with information about promo codes.

A full description of the promo code structure can be found in this article.

ParameterTypeExampleRequiredDescription
codestring"SUMMER20"YesPromo code
pool_idinteger42YesPromo code pool identifier

redeem_points array​

An array with information about loyalty point redemption. Each object describes a separate redemption.

A full description of the point redemption structure can be found in this article.

ParameterTypeExampleRequiredDescription
points_currency_iidinteger1Yes*Internal identifier of the point type
points_currency_eidstring"bonus1"Yes*External identifier of the point type
namestring"Bonus points"NoName of the point type
amountinteger499YesNumber of points to redeem

* — one of the parameters is required: points_currency_iid or points_currency_eid

applied_promotions array​

tip

The applied_promotions array can be contained both in the data object and in the lines array within that object. In the first case, the array will contain promotions applied to the order, in the second — promotions applied to the products/lines.

An array of promotions applied to the order. Each object in the array describes a separate promotion.

ParameterTypeExampleRequiredDescription
typestring"discount", "accrue_points", "redeem_points", "code_issue", "message"YesPromotion type
promotionobject
"promotion": {
"external_id": "promo_1",
"name": "Summer Sale"
}
YesObject with the promotion's identifier and name
amountstring"150.00"Yes, if type is discount, accrue_points, or redeem_pointsDiscount amount or number of points
points_infoobject
"points_info": {
"points_currency_iid": 1,
"points_currency_eid": "bonus1",
"name": "Bonus points",
"amount": "50"
}
Yes, if type is accrue_points or redeem_pointsObject with point information

The structure of the points_info object is as follows:

ParameterTypeExampleRequiredDescription
points_currency_iidinteger1Yes*Internal identifier of the point type
points_currency_eidstring"bonus1"Yes*External identifier of the point type
namestring"Bonus points"NoName of the point type
amountstring"6999"YesNumber of points
expiration_datestring (ISO 8601)"2027-02-18T00:00:00.000Z"NoExpiration date for accrued points

* — one of the parameters is required: points_currency_iid or points_currency_eid

Request Example​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"external_id": "12",
"matching": "email",
"email": "example@example.com",
"data": {
"endpoint": "site",
"status": "new",
"delivery_cost": "0.00",
"total_price": "139999.00",
"currency": "RUB",
"redeem_points": [
{
"points_currency_iid": 1,
"amount": 499
}
],
"lines": [
{
"external_id": "line___ASTGRf",
"product": "iphone17pmb256",
"base_price_per_item": "139999.00",
"min_price_per_item": "0.00",
"final_price_per_item": "139999.00",
"count": 1,
"custom_fields": {},
"currency": "RUB"
}
]
}
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<external_id>12</external_id>
<matching>email</matching>
<email>example@example.com</email>
<data>
<endpoint>site</endpoint>
<status>new</status>
<delivery_cost>0.00</delivery_cost>
<total_price>139999.00</total_price>
<currency>RUB</currency>
<redeem_points>
<points_currency_iid>1</points_currency_iid>
<amount>499</amount>
</redeem_points>
<lines>
<external_id>line___ASTGRf</external_id>
<product>iphone17pmb256</product>
<base_price_per_item>139999.00</base_price_per_item>
<min_price_per_item>0.00</min_price_per_item>
<final_price_per_item>139999.00</final_price_per_item>
<count>1</count>
<currency>RUB</currency>
</lines>
</data>
</xml>

Response Example​

  • JSON
  • XML
{
"data": {
"profile": {
"profile_id": "696e304f547840a7286619e0"
},
"order": {
"processing_target": "calculated",
"total_price": "139999.00",
"final_total_price": "139500.00",
"delivery_cost": "0.00",
"currency": "RUB",
"lines": [
{
"external_id": "line___ASTGRf",
"line_number": 0,
"count": 1,
"product": "iphone17pmb256",
"base_price_per_item": "139999.00",
"min_price_per_item": "0.00",
"final_price_per_item": "139500.00",
"custom_fields": {},
"applied_promotions": [
{
"type": "accrue_points",
"promotion": {
"external_id": "bonus",
"name": "Point Accrual"
},
"points_info": {
"points_currency_iid": 1,
"points_currency_eid": "bonus1",
"name": "Main Point",
"amount": "6999"
}
},
{
"type": "redeem_points",
"promotion": {
"external_id": "bonus",
"name": "Point Redemption"
},
"points_info": {
"points_currency_iid": 1,
"points_currency_eid": "bonus1",
"name": "Main Point",
"amount": "499"
}
}
]
}
],
"custom_fields": {},
"applied_promotions": [],
"points_info": [
{
"points_currency_iid": 1,
"points_currency_eid": "bonus1",
"name": "Main Point",
"status": "success",
"active_amount_for_current_order": "20999",
"accrue_points_amount_for_current_order": "6999",
"redeemed_points_amount_for_current_order": "499"
}
],
"promocodes_info": []
}
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<profile>
<profile_id>696e304f547840a7286619e0</profile_id>
</profile>
<order>
<processing_target>calculated</processing_target>
<total_price>139999.00</total_price>
<final_total_price>139500.00</final_total_price>
<delivery_cost>0.00</delivery_cost>
<currency>RUB</currency>
<lines>
<external_id>line___ASTGRf</external_id>
<line_number>0</line_number>
<count>1</count>
<product>iphone17pmb256</product>
<base_price_per_item>139999.00</base_price_per_item>
<min_price_per_item>0.00</min_price_per_item>
<final_price_per_item>139500.00</final_price_per_item>
<custom_fields/>
<applied_promotions>
<type>accrue_points</type>
<promotion>
<external_id>bonus</external_id>
<name>Point Accrual</name>
</promotion>
<points_info>
<points_currency_iid>1</points_currency_iid>
<points_currency_eid>bonus1</points_currency_eid>
<name>Main Point</name>
<amount>6999</amount>
</points_info>
</applied_promotions>
<applied_promotions>
<type>redeem_points</type>
<promotion>
<external_id>bonus</external_id>
<name>Point Redemption</name>
</promotion>
<points_info>
<points_currency_iid>1</points_currency_iid>
<points_currency_eid>bonus1</points_currency_eid>
<name>Main Point</name>
<amount>499</amount>
</points_info>
</applied_promotions>
</lines>
<custom_fields/>
<applied_promotions/>
<points_info>
<points_currency_iid>1</points_currency_iid>
<points_currency_eid>bonus1</points_currency_eid>
<name>Main Point</name>
<status>success</status>
<active_amount_for_current_order>20999</active_amount_for_current_order>
<accrue_points_amount_for_current_order>6999</accrue_points_amount_for_current_order>
<redeemed_points_amount_for_current_order>499</redeemed_points_amount_for_current_order>
</points_info>
<promocodes_info/>
</order>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>

Response Parameters​

ParameterTypeDescription
dataobjectCalculation result data
errorintError code
error_textstringError description

The data object has the following structure.

ParameterTypeDescription
profileobjectMember profile. Contains the profile identifier
orderobjectCalculated order. More details
Last updated on Mar 12, 2026
Previous
Commit temporary transaction
Next
Order Confirmation
  • Description
  • URL
  • Request Parameters
    • data object
      • lines array
      • promocodes array
      • redeem_points array
      • applied_promotions array
  • Request Example
  • Response Example
  • Response Parameters
© 2015 - 2026 Altcraft, LLC. All rights reserved.