Skip to main content

Registration flow

This page provides information on the registration flow for new customers in AiFi's system, including steps for customer registration, entry code generation, and important considerations for unique identifiers and session management.

New customer registration

  1. App Registration:

    • The customer registers and logs into the app.

    Credit Card Registration:

    • The customer taps their card on the terminal.
  2. The retailer's back end verifies the customer details based on the app account or credit card tap.

  3. If the customer isn't recognized, the retailer's back end creates a customer in AiFi's system by calling the Admin API.

    TOKEN=<ask_us_for_a_dev_token>

    curl \
    -X POST \
    -H "Content-type: application/json" \
    -H "Authorization: Bearer $TOKEN" \
    'https://oasis-api.public.sandbox.oasis.aifi.com/api/admin/v2/customers'
  4. AiFi's system sends back the unique ID of the customer.

  5. The retailer stores the information for future use.

Personally Identifiable Information: You don't need to provide

AiFi with the customer's PII. You can create a customer with an empty email and password. In that case, AiFi internally generates random strings for both fields.

Reuse of the customer entity: You should reuse the AiFi customer

entity across different entries. The retailer must ensure they provide the same customer entity each time the customer uses the same authentication method. If you don't wish to share information with AiFi that allows AiFi to aggregate information about the same customer, please contact your account manager.

New entry codes generation

After registering the user in both the retailer's and AiFi's systems, the user can request a new entry code to enter the store. The entry code can be generated either by the retailer's system or by AiFi's system.

Note about the Credit Card flow: Proceed through this step even if

the authentication method is a credit card. Typically, entry code generation happens at the credit card tap. This step ensures the authentication signal provides AiFi with an entry code associated with a shopping session. This abstraction makes AiFi flexible and ensures consistent check-in API results for both customer app and credit card flows.

  1. App: The customer generates a QR code in the app. Credit Card: The customer taps their card on the terminal.
  2. The retailer's back end finds the AiFi ID of the customer.
  3. The retailer's back end asks AiFi for a new entry code by calling the Admin API, optionally providing:
  4. AiFi responds with a payload including the code and the sessionId. If omitted in the previous step, these values are automatically generated, and the retailer can retrieve them from the response.
CODE=${1:-code123456789}
CUS_ID=${2:-1}
SESSION_ID=${3:-$CODE}
TOKEN=<ask_us_for_a_dev_token>
BODY=`cat <<EOM
{
"code": "$CODE",
"sessionId": "$SESSION_ID"
}
EOM
`
curl \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d "$BODY" \
"https://oasis-api.public.sandbox.oasis.aifi.com/api/admin/v2/customers/$CUS_ID/entry-codes"

Difference between entry code and sessionId

For more information on the difference between an entry code and a sessionId, see the API concepts page.

Important considerations

  1. Entry codes and session IDs must be globally unique.
  2. Entry codes are tokens used only for check-in. To identify a shopping session, use the sessionId.
  3. AiFi rejects any entry code that isn't unique. You can set any string as an entry code (code) and the session ID (sessionId).
  4. To attach a sessionId used for checkout upon entry code registration, specify it in the optional sessionId field. You can also specify the sessionId after the entry code scan if you support the webhook for entry code scanning.
  5. In the AiFi system, the entry code and sessionId can be different strings. You can set both to the same value, especially if the entry code is never displayed to the customer, such as in the credit card flow. This isn't recommended if the end customer has access to the entry code.