v1

latestOpenAPI 3.0.22026-07-2645239950.4 KB

post/transactions/award

Request body

member_idstring required

Unique Identifier (Member ID) for the member object in the client’s system which was used while creating a member in Zinrelo.

activity_idstring required

Unique ID that identifies an activity in Zinrelo. This is the activity against which the transaction has to be recorded.

transaction_datestring
<p>Add the transaction date of the activity. The transaction date would be considered for all activities except for the submit a receipt activity. Format : MM/DD/YYYY HH:MM:SS</p> <p><strong>Note:</strong> Our API records all date and time fields in UTC time.</p>
points_passedinteger

Set custom points for an activity. You can set custom points for all activities except made_a_purchase activity.

approval_datestring
<p>Date and time on which the transaction will be auto approved. Format : MM/DD/YYYY HH:MM:SS. <p><strong>Note:</strong> Our API records all date and time fields in UTC time.</p>
points_expiration_datestring
<p>Date and time on which points will expire. Format : MM/DD/YYYY HH:MM:SS. <p><strong>Note:</strong> Our API records all date and time fields in UTC time.</p>
transaction_attributesstring json
<p>Every activity has a two predefined transaction attributes - reason and tags. While awarding points for an activity, data can be passed in these attributes.</p> <p>Custom attributes: In addition to the predefined attributes, you can define custom attributes for each activity and pass data in those attributes.&nbsp;</p> <p>The custom attribute should be created in advance. To create custom attributes for your store, reach out to your account manager at support.zinrelo.com.</p> <p><strong>Note: "transaction_attributes" is mandatory only for 3 of the predefined activities.</strong></p> <div class="heading-text"><strong>made_a_purchase activity</strong></div> <p>Mandatory attributes are&nbsp;<strong>order_id, order_total, order_subtotal.</strong></p> <p><strong>The order_subtotal should be greater than 0.01</strong></p> <p>A sample structure of the transaction_attributes for the made_a_purchase activity is given below:</p> <p><code class="c-mrkdwn__code" data-stringify-type="code">{</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"tags" : ["tag1","tag2"],</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"reason" : "purchase",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"order_id" : "75",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"coupons" : "$5OFFVYZ,$10FFEDT,$05RTNVLW",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"order_total" : "1000",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"order_subtotal" : "1000",</code></p> <p><code class="c-mrkdwn__code" data-stringify-type="code"></code><code class="c-mrkdwn__code" data-stringify-type="code">"products" : [{</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_id": "112",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_quantity": "1",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_category": "tshirt, blue range, on sale",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_price": "15",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_title": "Sweatshirt",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_image_url": ""</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">},</code></p> <p><code class="c-mrkdwn__code" data-stringify-type="code"></code><code class="c-mrkdwn__code" data-stringify-type="code">{</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_id": "980",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_quantity": "2",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_category": "sales, straight range of pants, formals, on 10% discount",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_price": "10.017",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_title": "Pant",</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">"product_image_url": ""</code><br /><code class="c-mrkdwn__code" data-stringify-type="code">}]</code><code class="c-mrkdwn__code" data-stringify-type="code"></code></p> <p><code class="c-mrkdwn__code" data-stringify-type="code">}</code></p> <p><strong>Note: </strong></p> <p><strong>- The attributes like &ldquo;product_id&rdquo;, &ldquo;product_price&rdquo;, &ldquo;product_quantity&rdquo; and &ldquo;product_title&rdquo; are mandatory only when you pass product attributes.</strong></p> <p><strong>- The order subtotal should be calculated as the sum of the subtotals of all products in the order, without taking into account any discounts. The discounted price needs to be adjusted in products and passed accordingly.</strong></p> <p><strong>- We are also accepting product quantity in decimal values.</strong></p> <p><strong>- When individual product prices are provided, the subtotal is ignored.</strong></p> <p><strong>- In instances where product information is absent, the purchase amount is derived from the 'order_subtotal' field.</strong></p> <div class="heading-text"><strong>submit_a_receipt activity</strong></div> <p>Mandatory attribute is 'receipt_files'. 'receipt_uid' is the optional field. Expected data is a list of images/pdfs encoded in base64 format. To convert an image to base64 format,&nbsp;<a href="https://www.base64-image.de/" target="_blank" rel="noopener">click here.</a></p> <p>A sample structure of the transaction_attributes for the submit_a_receipt activity is given below:</p> <p><code class="c-mrkdwn__code" data-stringify-type="code">{</code><code class="c-mrkdwn__code" data-stringify-type="code">"receipt_files":[""]</code><code class="c-mrkdwn__code" data-stringify-type="code">}</code></p> <div class="heading-text"><strong>upload_photo activity</strong></div> <p>Mandatory attribute is image_file. Expected data is a list of images/pdfs encoded in base64 format. To convert an image to base64 format,&nbsp;<a href="https://www.base64-image.de/" target="_blank" rel="noopener">click here.</a></p> <p>A sample structure of the transaction_attributes for the upload_photo activity is given below:</p> <p><code class="c-mrkdwn__code" data-stringify-type="code">{</code><code class="c-mrkdwn__code" data-stringify-type="code">"image_file": [""]</code><code class="c-mrkdwn__code" data-stringify-type="code">}</code></p> <p>To know more about the transaction attributes for Award API, <a href="https://help.zinrelo.com/docs/award-api-parameters">click here.</a></p>

Example request

{
  "member_id": "john.doe@gmail.com",
  "activity_id": "made_a_purchase",
  "transaction_date": "10/05/2019 23:10:55",
  "approval_date": "10/15/2019 16:10:50",
  "points_expiration_date": "01/15/2020 16:10:50"
}

Response

200

successboolean

Example response

{
  "data": {
    "status": "approved",
    "points_expiration_date": "21-Aug-2023 05:12:41",
    "auto_approval_date": "",
    "last_modified_date": "21-Mar-2023 05:12:41",
    "award_info": {
      "activity_id": "made_a_purchase",
      "points": 1000,
      "points_status": "approved",
      "activity_name": "Purchase on website"
    },
    "id": "64193cc9df192b000a6d1374",
    "approver_details": {
      "approver_name": "System"
    },
    "approved_date": "21-Mar-2023 05:12:41",
    "member_id": "greatMRT090399656",
    "created_date": "21-Mar-2023 05:12:41",
    "transaction_type": "award",
    "transaction_attributes": {
      "order_total": 110,
      "order_subtotal": 100,
      "order_id": "887y12",
      "tags": [
        "purchasemade",
        "madeapurchaseactivity"
      ],
      "currency": "$",
      "coupon_code": "abtrojkl",
      "reason": "THird",
      "products": [
        {
          "product_id": "12",
          "is_excluded": false,
          "product_category": "[u'Essentials', u'Sale', u'test', u'gdgd']",
          "product_url": "https://www.product.com",
          "product_price": "50",
          "product_points_per_quantity": 500,
          "bonus_multiplier": 0,
          "product_quantity": "1",
          "product_image_url": "https://cdn.shopify.com/s/files/1/1617/6377/products/220px-Far_Cry_5_boxshot_1024x1024@2x.jpg?v=1528970252",
          "product_title": "RelaxedFitSweatshirt-Mintgreen"
        },
        {
          "product_id": "98012",
          "is_excluded": false,
          "product_category": "[u'Sale', u'test', u'gdgd']",
          "product_url": "https://www.product.com",
          "product_price": "25",
          "product_points_per_quantity": 250,
          "bonus_multiplier": 0,
          "product_quantity": "2",
          "product_image_url": "https://cdn.shopify.com/s/files/1/1617/6377/products/220px-Far_Cry_5_boxshot_1024x1024@2x.jpg?v=1528970252",
          "product_title": "Sweatshirt"
        }
      ],
      "coupons": "abtrojkl"
    },
    "additional_data": {
      "activity_multiplier": 10
    }
  },
  "success": true
}