# How to integrate with BC API as corporation #### Onboarding Essential steps before calling BC API: 1. This API requires Mutual TLS authentication. You can use the same certificate for all mTLS-secured APIs exposed by Verestro. If you don't have one, follow this instruction: [Connecting to server-to-server APIs](https://bookstack.verestro.dev/books/connecting-to-our-services/page/connecting-to-server-to-server-apis). 2. You should receive your corporationId, balanceId and certificate from Sparados. Optionally you can also receive personalized visuals and their Ids for your cards. 3. Now you can assign cards for your corporation members. Remember to save approvalId on your side because it will be needed in case of editing it. #### Values used in BC API **Date format** We use ISO 8601 standard: year-month-day-T-hour-minute-second-Z. where T is constant separating the date from the time and Z is Zulu time (Greenwich Mean Time (GMT)). Example: 2023-05-22T10:00:01.953Z **Minor values** All numeric values used in our API are in minor. If you want to e.g. assign card with limit 100.50 EUR you have to send us 100500. Currency is not needed - it's always the same as currency of account/balance. **Currency** Card/approval is always created in the currency of account. Account can have only one currency although it is possible to make transactions in other currencies. **ID** We always use UUID format for IDs in our project. #### How to assign a card? You should use **POST /secure/approvals** and provide data below. Required fields are signed with \*.
**rules.budgetMinor \*** | Amount in minor that user can spend using a card provided in the currency of account/balance. |
**rules.validityPeriod \*** | Validity of a card in UTC format. |
**rules.timezone \*** | BC API will adjust startDate and EndDate to exact time in provided timezone. |
limits.amountMinor | Additional periodic limit value in minor provided in the currency of account/balance. |
limits.timeUnit | Available values: daily, weekly, monthly. |
limits.type | Available values: general, ecommerce, atm, foreign\_amount. Types are descibed below the table. |
**purpose.ecommerce \*** | Now it should be always as true. |
**purpose.allowChangeRequest \*** | True - user can send a request to change limits on card. False - user can't send a request to change limits on card. |
**user.email \*** | E-mail on which will be sent information about assigned card. |
**user.prefix \*** | Prefix of a phone number of a user that can be used for authorization purpose. |
**user.phone \*** | Phone number of a user that can be used for authorization purpose. |
**balance.Id \*** | Id of a balance created for you corporation. |
card.description | Description displayed on a card visual in user app. |
card.visual.Id | Id of visual provided by Sparados. Null - default Sparados visual. |
CREATED | Occur only when mobile user request changes on reapproval. |
ACCEPTED | When an Approval is created. **It changes to DELIVERED status after registration is complete and card is redeemed by end-user.** |
CANCELED | When an Approval or Reapproval with status CREATED, ACCEPTED or PREPARED is cancelled by corporation. |
REJECTED | When a Reapproval with status CREATED is rejected by corporation. |
EXPIRED | When a Reapproval with the status CREATED is not accepted/rejected or status of Approval is ACCEPTED but the card has not been redeemed by mobile user within the given Approval time (until the end of the ValidTo date). |
PREPARED | When approval has been ACCEPTED, redeemed by the end-user and is waiting for card generation. Card is generated on startDate of Approval. |
DELIVERED | When mobile user redeemed card. This is the state of approval in which transactions can be made with a card. |
FINISHED | When an Approval with status DELIVERED exceeds the end date of assignment. |
REAPPROVED | When a reapproval is created for a given Approval that is in Accepted/Delivered status. |
LOCKED | This is a status of a **card (not an approval)** but we display it on the diagram below to show that Delivered is the only state of a approval on which we have action to lock and unlock card. |
**Email name** | **Sending reason** |
**BC\_USER\_PENDING\_TERMS\_AND\_CONDITIONS** | Sent while new terms and conditions are applied to the issuer to end users. |
**BC\_USER\_CARD\_EXPIRING** | Sent 1 day before card expiration to end user. |
**BC\_USER\_PENDING\_CARD** | Sent to end user when new card was assigned and is waiting for redemption. |
**BC\_USER\_NEW\_CARD** | Sent to end user when new card was redeemed. |
**BC\_USER\_CARD\_EXPIRED** | Sent to end user when approval is finished. |
**BC\_USER\_CARD\_DELETED** | Sent to end user while card/approval was uassigned or deleted by corporation. |
**BC\_USER\_CARD\_LOCKED** | Sent to end user when card was locked by corporation. |