# Integration flow

How the Play+ calls fit together. Field-level detail for every call is in the [API reference](/openapi).

## Before you start

- A mutual NDA is signed with ADGT.
- You have your **ClientId** and **EntryCode** for the ADGT Simulator (sandbox).
- ADGT has allowlisted the IP address(es) you call from.


Every flow starts the same way: your **server** calls **GetToken** and sends the returned `securityToken` object in the body of each later request. A token is valid for 15 minutes. Never request a token from the customer's browser.

## Choose how customers enroll

|  | Hosted funding (recommended) | API enrollment |
|  --- | --- | --- |
| Screens | Hosted by ADGT, shown in your app or site | Built by you |
| Identity verification | Included in the hosted screens | You start the hosted ID-and-selfie journey through the API |
| T&C display and acceptance | Handled by ADGT | You display them through the Document Viewer |
| Funding | Included | Separate (hosted funding) |


## Flow 1 – Hosted funding (enrollment and top-up)

1. Your server calls **GetToken**.
2. The customer's browser posts an HTML form with the token and the customer's details to the hosted funding URL, targeting the frame or web view where the pages are shown. See **Hosted funding** in the API reference for the fields.
3. ADGT shows enrollment (new customer) or funding (existing customer), including identity verification.
4. ADGT redirects to your `ReturnURL` with `result` (`success`, `error` or `cancel`), `message` and `transactionId`.


For enrollment at cash out, send `TransactionType=WITHDRAWFROMWAGERING`: ADGT enrolls the customer without asking them to fund, and your platform then sends **Deposit** with the winnings.

## Flow 2 – API enrollment with hosted identity verification

![Identity verification and enrollment flow](/assets/identity-verification-and-enrollment.3838e58ba40b2ba84c7445fa37b4f507ca6f87a9abb46388cb79b26b5f06a057.9c1bb791.png)

1. Show the Play+ terms and conditions from the **Document Viewer** (T&C acceptance URL) and require the customer to accept.
2. Call **GetToken**.
3. Call **CreateIdentityAndDocumentSession** and keep the `identityAndDocumentSessionId`. The session expires after 30 minutes.
4. Call **StartHostedDocumentVerification** and open the returned `journeyUrl` for the customer in a new tab or a web view with camera access (not an iframe). The customer photographs their Emirates ID or passport and takes a selfie.
5. Poll **VerifyDocument** every few seconds. `transactionStatus` is `4` (Pending) until the customer finishes.
6. If verification succeeded, call **Enroll** with the same session ID, program member and the `merchantTransactionId` used for the T&C acceptance.


Before enrolling, ADGT validates the session, checks that the customer is not blocked, and checks that the T&C were accepted:

![Enrollment validation](/assets/enrollment-validation.d5e7ff930cb31015990b18cd54241a25886bad45a75415898e10442b98fe5495.9c1bb791.png)

## Flow 3 – Moving funds

| Customer action | Call | If it fails |
|  --- | --- | --- |
| Play+ → gaming (buy in) | **Withdraw** | If funds then fail to post to the Gaming Wager Account, send **Reverse** with the original IDs |
| Gaming → Play+ (cash out) | **Deposit** | Return the funds to the Gaming Wager Account or an exception queue |
| Show the balance | **BalanceInquiry** | Show a friendly message; `ACCI-0001` means the customer is not enrolled |


- `merchantTransactionId` must be unique for every Withdraw, Deposit and Reverse; ADGT enforces idempotency on it.
- Call BalanceInquiry and AccountHolderProfile only when a transfer needs them, never on page refresh. Fees may apply.
- Block amounts greater than the available balance before sending Withdraw.
- Always check `transactionStatus`; declines and failures return HTTP 200.


## Member IDs

The Member ID (`accountIdentifierValue`, or `MemberNumber` in hosted funding) is your customer identifier: up to 20 alphanumeric characters, no special characters, and unique across all your platforms and brands. If several systems hold customer accounts, prefix the identifier per system (for example `JS12345`, `CX12345`).