---
# System prepended metadata

title: Untitled

---


## CARD creation flow - Batch //under construction

### 1) Request batch creation, and link the a card to an enduser

```mermaid
sequenceDiagram
Participant Treezor 
Participant Agent 
Participant Enduser 

Agent ->> Treezor : Request card batch POST /card/bulk
Treezor -->> Agent: webhook for each user, wallet and user creation (At the same time of the card creation, linked wallet and user are created. They are created anonymously)

Treezor ->> Agent : send all cards to the same adress 

Agent ->> Enduser : Mail the card to the end user (the card is inactive)

Enduser ->> Enduser: Enter the card token in his application 

Agent ->> Treezor : Activate the card with the card token PUT /cards/{cardToken}/public-token-activation \
Treezor -->> Agent: webhook card.activate (user id )

Agent->> Treezor : Fetch the user and wallet linked to the card  GET/card if needed (information already in the wekhook activate)

Agent ->> Treezor : Update the user to link it to the card user PUT /user
Treezor -->> Agent: webhook user.updated 

Agent ->>Treezor: Register the card for 3DS POST/cards/Register3DS
``` 
### 2) Activate the card and identify the user 
```mermaid 
sequenceDiagram
Participant Treezor
Participant Agent 


Agent ->>Treezor:  If KYC review is needed, Send the KYC documents (Proof of adress) for review POST/document
Treezor -->> Agent: webhook document.create

Agent ->>Treezor: Ask for KYC review liveness POST/users{id}/kycliveness
Treezor -->> Agent: webhook kycliveness.create (w/ URL)

Agent->>Enduser: KYC liveness URL sent to the enduser 
Enduser->>Enduser:Perform liveness onboarding

Treezor ->> Treezor: KYC approval
Treezor -->> Agent: webhook kycliveness.update (status validated)

Agent ->> Treezor: Update the PIN code of the card PUT /setpin 
Treezor -->> Agent: webhook card.update 

Enduser->>Enduser : go to the ATM to valide the pin change and be activate the use of the card (link to the /setpin)

````