Integrating account onboarding
Account onboarding uses the regular Walley Checkout integration. The
differences are a profile set up by Walley, a session without a cart, and a
new end status, AgreementRegistered.
Overviewβ
1. Get a profile from Walleyβ
Walley configures account onboarding in a settings profile for your store. Send the following to your Walley representative:
| Information | Description |
|---|---|
| Store id(s) and markets | Sweden, Finland or both. One profile per market. |
| Variant | With Loyal Pay or without. See Variants. |
| Purchase limit | Fixed, or selectable with a default and a maximum. Values from the limit scale. |
| Account name and description | The name shown to the customer, for example ABC Account, per language. |
| Icon | A square logo for the account. |
| Credit terms URL | Only without Loyal Pay. A public URL to your credit terms, per language. |
| Loyalty program | With Loyal Pay: a working Loyalty Booster setup. |
| Raise of existing limits | Whether existing account holders may raise their limit in the flow. |
You get a profile name back, for example AccountOnboarding.
2. Initialize a sessionβ
Call Initialize Checkout with the profile name and without a cart.
POST /checkouts HTTP/1.1
Host: api.uat.walleydev.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
{
"storeId": 123,
"countryCode": "SE",
"profileName": "AccountOnboarding",
"merchantTermsUri": "https://example.com/terms",
"notificationUri": "https://example.com/notifications"
}
The response is the same as for a purchase and contains a privateId and a publicToken. Use the publicToken to render the checkout on your sign-up page. Keep the privateId on your backend to read the result.
Omit cart, fees and upsell items. The session registers an account and creates no order.
Validation errors:
| Reason | Cause |
|---|---|
Cart_Articles_Not_Allowed | The request contains cart items. |
Fees_Not_Allowed | The request contains fees. |
Upsell_Items_Not_Allowed | The request contains upsell items. |
Invalid_Configuration (HTTP 500) | The profile is not valid for the market or customer type. Contact Walley. |
3. Render the checkoutβ
Render the checkout exactly as for a purchase. The checkout shows identification, membership and the account. There is no cart, delivery or total amount, and the button reads Sign. See the customer journey.
4. Handle the resultβ
In the browserβ
When the customer has signed, the checkout fires the client event walleyCheckoutPurchaseCompleted. The customer is not redirected. The checkout shows a confirmation with the granted purchase limit.
Show your own next step next to the checkout, for example a link to your store or app.
On your backendβ
Walley calls your notificationUri when the account is registered. Then call Get Checkout Information and check data.status.
{
"data": {
"customerType": "PrivateCustomer",
"countryCode": "SE",
"status": "AgreementRegistered",
"customer": {
"email": "test@example.com",
"mobilePhoneNumber": "+46701234567",
"nationalIdentificationNumber": "19510731-2323",
"loyaltyMembership": {
"provider": "voyado",
"success": true,
"isMember": "new",
"memberNumber": "123456"
}
},
"cart": null,
"purchase": null,
"order": null
}
}
| Field | Description |
|---|---|
data.status | AgreementRegistered when the account is registered, raised, or already existed. |
data.customer | The identified customer, including loyaltyMembership if the customer joined your loyalty program in the flow. |
data.cart, data.purchase, data.order | Always null. No order is created. |
The response does not include the granted purchase limit. The customer sees it in the confirmation in the checkout.
If the application is deniedβ
The session stays open. The customer sees a message and can try a lower limit, or leave. The checkout fires walleyCheckoutPaymentAborted, and data.status does not become AgreementRegistered. A limit the customer already had is kept.
Testingβ
Use the test data for Swedish and Finnish private customers in UAT. Test at least:
- a new customer who gets the account
- a customer who already has the account
- with Loyal Pay: a customer who is not a member and joins in the flow
- a denied application