Tutorial: Creating a Digital First Debit Card

In this tutorial, we will guide you through the process of creating a digital first debit card using the MBanq Cloud API. We will explain the concepts of physical cards, digital first cards, and virtual cards before diving into the tutorial. We will use cURL statements to demonstrate the API requests and responses. Let's get started!

📘

API References for Endpoints in this tutorial:

Introduction

To understand the context of this tutorial, let's define the different types of cards:

  • Digital First Card: A digital first card is a card that is designed to be primarily used through digital channels. It allows customers to immediately start making transactions using digital wallets, such as mobile payment apps or online platforms, even before receiving the physical card. Once the physical card is delivered, the customer can activate it for online and point-of-sale purchases. The digital first option provides convenience and flexibility for customers, enabling them to transact digitally while waiting for the physical card.

  • Virtual Card: A virtual card is a card with no physical form. It exists only in the digital space and is typically used for online transactions, subscriptions, or other digital services. Virtual cards provide a secure and convenient way to make online purchases without exposing the customer's primary card details.

In this tutorial, we will focus on creating a digital first debit card. This means that we will create a card product that is specifically configured to be used primarily through digital channels. With the digital first option enabled, the instance of the issued card will be immediately activated for push provisioning to digital wallets, allowing customers to start making transactions using digital wallets before receiving the physical card. Once the physical card is delivered, the customer can activate it for online and point-of-sale purchases.

### Step 1: Create a Debit Card

To issue a new card, utilize the provided API by submitting the SavingsAccountID, the User's Account ID where the card will be registered, and the Product ID. You can locate the Product ID in the Backoffice or by contacting your Mbanq representative.

curl --request POST \
     --url https://api.cloud.mbanq.com/v1/cards \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "productId": 1,
  "savingsAccountId": 249
}
'
ParameterValue TypeExample ValueExplanation
"productId"Integer1The identifier for the product type of the card to be issued.
"savingsAccountId"Integer123The ID of the savings account to which the card must be linked

If the request was successful, you will receive the following response:

{
  "cardToken": "2a6df382-0281-4984-a6c5-a8eb5bc81948",
  "clientId": 424,
  "resourceId": 145,
  "resourceIdentifier": "2a6df382-0281-4984-a6c5-a8eb5bc81948"
}

### Step 2: Set PIN

After creating the Card, Set a PIN to the card to enable POS and ATM transactions on the Card.

curl --location 'https://api.cloud.mbanq.com/graphql' \
--header 'authorization: Bearer {{access_token}}' \
--header 'content-type: application/json' \
--header 'tenantid: default' \
--data '{"query":"{\n  getChangeCardPinUrl(id: 145)\n}","variables":{}}'
ParameterValue TypeExample ValueExplanation
idInteger189The identifier of user's card. This will be "resourceId" from Create Debit Card Response.

Conclusion

You have successfully learned how to create a debit card in the MBanq Cloud API using cURL. By following the steps in this tutorial, you can create a card product and use it as a template to create debit cards with specific configurations.