# Quick start

Welcome to quick guide on Card issuing. This is a 4 step instruction on how to issue a card using Antaca service within our sandbox environment. If you don't have certificate, follow instructions [here](https://developer.verestro.com/books/connecting-to-our-services/page/connecting-to-server-to-server-apis). Once you receive your certificate, follow the steps below:

<p class="callout info">Our sandbox environment has a basic configuration allowing maintaining balances on the Verestro side, without protection for the bin-sponsor (masterbalance)</p>

#### Add user

Send **POST** request to `/lifecycle/v1/wallet` with user data. You’ll receive `id` in return - it is customer id, that will be needed in further steps.

<p class="callout danger"><span style="color: rgb(0, 0, 0);">Make sure you set **kyc = SUCCESS**. Users without finished Know Your Customer procedure cannot have cards &amp; balances.</span></p>

```bash
curl -X POST 'https://lifecycle.upaidtest.pl/lifecycle/v1/wallet' \
--cert /path/to/cert.pem \
--key /path/to/key.pem:password \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Issuer-Code: sandbox' \
--data-raw '{
    "firstName": "John",
    "lastName": "Doe",
    "phone": "481234567899",
    "email": "john.doe@verestro.com",
    "birthDate": "2000-01-01",
    "state": "VERIFIED",
    "kyc": "SUCCESS"
}'
```

#### Create user verification form

Send **POST** request to `/secure/customers/{customerId}/verification` using customer id you’ve received in previous step. It will create KYC verification form.

```bash
curl --location --request POST  'https://sandbox-antaca.secure-verestro.dev/secure/customers/{customerId}/verification' \
                                 --cert yourCertificate.crt:password \
                                 --key yourPrivate.key \
                                 --header 'Content-Type: multipart/form-data' \
                                 --header 'Accept: application/json' \
                                 --form 'firstName=Leon' \
                                 --form 'lastName=Bakiewicz' \
                                 --form 'imageFace=@/your/path/someFile.jpg' \
                                 --form 'street=Pieklo' \
                                 --form 'pesel=70010155587' \
                                 --form 'number=17a' \
                                 --form 'city=Lublin' \
                                 --form 'birthDate=1970-01-01' \
                                 --form 'postCode=20-128' \
                                 --form 'imageFront=@/your/path/someFile.jpg' \
                                 --form 'imageBack=@/your/path/someFile.jpg' \
                                 --form 'identityCardNo=ASD123456' \
                                 --form 'apartment=2' \
                                 --form 'documentType=passport' \
                                 --form 'country=PL' \
                                 --form 'documentExpirationDate=2025-01-30' \
                                 --form 'nationality=polish' \
                                 --form 'riskLvl=LOW'
```

#### Create user balance

<div class="wiki-content" id="bkmrk-send-post-request-to-2">Send **POST** request to `/secure/customers/{customerId}/balances`. In response you will receive the balanceId with which you will be able to generate a card in the next step  
  
</div>```bash
curl --location --request POST  'https://sandbox-antaca.secure-verestro.dev/secure/customers/{customerId}/balances' \
                                 --cert yourCertificate.crt:password \
                                 --key yourPrivate.key \
                                 --header 'Content-Type: application/json' \
                                 --header 'Accept: application/json' \
                                 --data-raw '{
                                    "currency": "EUR"
                                 }'
```

<p class="callout info">if you are using IMS service, after the balance was created, the IBAN number will be generated automatically.  
</p>

#### Create new virtual card

<div class="wiki-content" id="bkmrk-using-customerid%2C-ba">Using customerId, balanceId and configId, send **POST** request to `/secure/cards/virtual`.</div><div class="wiki-content" id="bkmrk-"></div><p class="callout info">Single ConfigID contains information about the card type (virtual/physical), currency and bin range. You will receive it at the stage of configuring your project in Verestro. In the case of sandbox, please use 0019167984</p>

```bash
curl --location --request POST  'https://sandbox-antaca.secure-verestro.dev/secure/customers/{customerId}/cards/virtual' \
                                 --cert yourCertificate.crt:password \
                                 --key yourPrivate.key \
                                 --header 'Content-Type: application/json' \
                                 --header 'Accept: application/json' \
                                 --header 'Encrypt-Response: true' \
                                 --header 'Public-Key: {enduserPublicKey}' \
                                 --data-raw '{
                                    "balanceId": "0351eb09-3ac0-4234-a4ad-0a6ad52f248b",
                                    "configId": "0019167984",
                                    "dcUserId": 1337
                                 }'
```

<div class="wiki-content" id="bkmrk-create-single-user-e"></div><div id="bkmrk--1"><div class="no-print" id="bkmrk--3"></div></div>