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
-
App Registration:
- The customer registers and logs into the app.
Credit Card Registration:
- The customer taps their card on the terminal.
-
The retailer's back end verifies the customer details based on the app account or credit card tap.
-
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' -
AiFi's system sends back the unique ID of the customer.
-
The retailer stores the information for future use.
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.
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.
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.
- App: The customer generates a QR code in the app. Credit Card: The customer taps their card on the terminal.
- The retailer's back end finds the AiFi ID of the customer.
- The retailer's back end asks AiFi for a new entry code by calling the Admin
API, optionally providing:
- code: See the definition of entry code in the "Basic concepts" section.
sessionId: See the definition of session in the "Basic concepts" section.
- 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
- Entry codes and session IDs must be globally unique.
- Entry codes are tokens used only for check-in. To identify a shopping
session, use the
sessionId. - AiFi rejects any entry code that isn't unique. You can set any string as an
entry code (
code) and the session ID (sessionId). - To attach a
sessionIdused for checkout upon entry code registration, specify it in the optionalsessionIdfield. You can also specify thesessionIdafter the entry code scan if you support the webhook for entry code scanning. - In the AiFi system, the entry code and
sessionIdcan 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.