Push evaluate order price

request to third party to evaluate order price

POST
/api/push/order-price

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

sessionId*stringDeprecated

A unique token to identify a shopping session. Note, sessionToken and sessionId are same concept in AIFI system. Deprecated, usesession.sessionId

session*|
customer*

Customer information

storeId*integer

AiFi store id

store*
storeExternalId*|

Retailer store id

timeOfOrigin*string

ISO formatted creation time of the event, that caused this webhook to be sent

Formatdate-time
timeOfIssue*string

ISO formatted time, in which this webhook was sent

Formatdate-time
orderId*integer

AiFi internal order id

status*string
Value in"completed"
cart*array<>

Response Body

application/json

curl -X POST "https://oasis-api.public.sandbox.oasis.aifi.com/api/push/order-price" \  -H "Content-Type: application/json" \  -d '{    "sessionId": "d3a00526-1864-4f6e-bb2d-46e3ab7fa780",    "session": {      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "id": 0,      "customerId": 0,      "code": "c69bb289-1190-4156-b9f6-bfb7f61e85db",      "codeFirstSuccesfullyScannedAt": "2019-08-24T14:15:22Z",      "codeLastSuccesfullyScannedAt": "2019-08-24T14:15:22Z",      "customerFirstEnteredAt": "2019-08-24T14:15:22Z",      "customerLastEnteredAt": "2019-08-24T14:15:22Z",      "customerFirstExitedAt": "2019-08-24T14:15:22Z",      "customerLastExitedAt": "2019-08-24T14:15:22Z",      "customerPaymentInstrumentId": 0,      "customerSatisfaction": 95,      "customerSatisfactionSubmitted": false,      "groupSize": 0,      "visitors": 0,      "locationId": "string",      "priority": 0,      "sessionToken": "d3a00526-1864-4f6e-bb2d-46e3ab7fa780",      "sessionId": "d3a00526-1864-4f6e-bb2d-46e3ab7fa780",      "referencedSessionId": null,      "status": "active",      "storeId": 0,      "storeIdScannableAt": 0,      "suspectedFraud": false,      "metadata": {        "events": [          {            "eventId": "6bdbfb2d-65b2-491c-bc97-c0ac73338476",            "metadata": {              "key": "value"            }          }        ],        "exampleKey": "exampleValue"      },      "expiresAt": "2019-08-24T14:15:22Z"    },    "customer": {      "externalId": "string",      "metadata": {        "arbitraryKey": "arbitraryValue"      },      "id": "string",      "role": "customer"    },    "storeId": 0,    "store": {      "oasisApiStoreId": 0,      "aifiUniqueStoreId": "string"    },    "storeExternalId": "string",    "timeOfOrigin": "2019-08-24T14:15:22Z",    "timeOfIssue": "2019-08-24T14:15:22Z",    "orderId": 0,    "status": "completed",    "cart": [      {        "id": "string",        "name": "string",        "barcode": "string",        "category": "string",        "sku": "string",        "thumbnail": "string",        "externalId": "string",        "price": 0,        "quantity": 0,        "productSnapshot": {          "name": "string",          "price": "string",          "barcode": "string",          "category": "string",          "thumbnail": "string",          "weight": 0,          "sku": "string",          "externalId": "string",          "taxCode": "string",          "id": 0,          "productId": 0,          "createdAt": "2019-08-24T14:15:22Z",          "updatedAt": "2019-08-24T14:15:22Z"        }      }    ]  }'
{
  "totalPrice": "1.35",
  "totalTax": "0.35",
  "effectivePrices": [
    {
      "id": 28612838096970,
      "effectivePrice": "1.35",
      "message": "Promo 50% off"
    }
  ]
}

How is this guide?

verify entry-code at external provider POST

AiFi system shall call this webhook during the entry-code validation. In regular mode the webhook is only called if both the entry code and the customer owning it were previously registered in AiFi system. However if the QR code passthrough option is turned on (consult your account manager if you need this option turned on) the webhook is called as the first step during the validation. In this case the retailer can optionally return a customerId that will be used to match the customer entity and dynamically create the entry code. If no customerId is returned but status is still OK AiFi will dynamically create both the customer entity and the associated entry code. Retailer or third party can perform their additional checks (such as: pre-authorization of funds etc) and return to AiFi whether their checks succeeded. Take note that AiFi can deny customer the entry without calling this endpoint (for example when the store is closed). AiFi may also deny entry after this call if a payment provider is specified on AiFi side and the payment methods checks fail. Endpoint returns 200 http code also in all instances when the code was successfully examined but rejected for any reason. Http error codes are used only when there are other errors preventing the check such as: 404 reason: 'Customer id <id> not found' **Note**: as an integrator the URL you specify for this webhook is going to be exactly the URL that will be called. For example if you specify "http://example-retailer-api.com/webhook" then exactly "http://example-retailer-api.com/webhook" will be called.

identity matching POST

AiFi system will trigger this webhook once it detects that a visitor shopper can be matched automatically to some registered session. As an integrator upon receiving you should create a new session (for the same customer to whom the registered session belongs to) and assign the visitor shopper to it. The intended result is to make sure that this shopper is no longer a visitor but a registered shopper and therefore can be charged upon finishing his shopping journey.

AiFI AI Chat

Beta

Powered by AiFi

Ask docs or API questions to get grounded answers.