Card Section Queries & Mutations

GetCardById

This query retrieves card information by providing the card's ID.

query GetCardById($getCardByIdId: ID) { getCardById(id: $getCardByIdId) { bankName email expiryDate id isDefault maskedPan status type } }
{ "getCardByIdId": "bchdbc26378udn" }
{ "data": { "getCardById": { "bankName": "Example Bank", "email": "cardholder@example.com", "expiryDate": "12/25", "id": "bchdbc26378udn", "isDefault": true, "maskedPan": "**** **** **** 1234", "status": "Active", "type": "Credit" } } }

GetCardReferenceStatus

This query provides information about the card associated with the reference, the bank details, and the current status of the reference.

Input Variables

  • input (CardReferenceStatusInput): The input object containing information required to retrieve the card reference status.

  • loanDuration (String): The duration of the loan for which the reference was generated (e.g., "6 months").

  • reference (String): The reference identifier associated with the card.

Sample Response

  • getCardReferenceStatus (CardReferenceStatus): The object containing the card reference status information.

    • bank (String): The bank associated with the card reference.

    • card (Card): Information about the associated card.

      • bankName (String): The name of the bank that issued the card.

      • maskedPan (String): The masked primary account number (PAN) of the card.

      • expiryDate (String): The expiry date of the card.

      • id (ID): The unique identifier of the card.

      • isDefault (Boolean): Indicates whether the card is set as the default card.

    • reason (String): Additional information or reason related to the status of the card reference.

    • status (String): The current status of the card reference.


disableAccountCard

The disableAccountCard mutation allows you to disable a specific account card identified by its ID.

Input Variable

  • disableAccountCardId: The ID of the account card that you want to disable. This field is required.

Sample Response
Upon a successful mutation, the API will return a response containing the ID of the disabled account card.


setDefaultAccountCard

The setDefaultAccountCard mutation is used to set a default card for a specific account. This allows users to specify a card as their primary or default payment method when making transactions.


saveAccountCard

The saveAccountCard mutation allows you to save a card associated with a specific account. It requires a txnRef (transaction reference) as an input variable to perform the action. Upon successful execution, it will return information about the saved card, including the bank name.

In the sample response, "Sample Bank" represents the bank name associated with the card that was successfully saved for the specified account. The actual response will contain data specific to the transaction and the card saved.


chargeCardOnFile

This mutation allows you to charge a card on file with a specified amount.

Sample Response (Successful) :white_check_mark:
The mutation will return a response with the following fields:

success: A boolean indicating whether the card was successfully charged.
amount: The amount that was charged to the card.

Sample Response (Failed) :warning:
In case of failure, the success field will be false, and the amount field will be null.


getAddCardReference

This mutation allows you to generate a card reference for a client. It takes a GenerateAddCardReferenceInput as input and returns the id and reference fields in the response.