@cfxlabsinc/b2b-services
    Preparing search index...
    Index

    Constructors

    Methods

    • Permanently blocks a card by its card ID. This method calls Girasol's PATCH /v1/cards/{cardId}/block endpoint and returns the updated card info.

      Parameters

      • input: BlockGirasolCardRequest

      Returns Promise<{ cardId: string; cardStatus: string; message: string }>

    • Performs a cash-in operation to transfer funds from the CFX Master Account to a customer card account. This method calls Girasol's POST /v1/accounts/cash-in endpoint and returns the transaction details.

      Parameters

      • input: CashInGirasolAccountRequest

      Returns Promise<
          {
              createdAt: string;
              currency: string;
              description: string;
              MasterAccountBalance: number;
              transactionId: number;
              userBalance: number;
          },
      >

    • Performs a cash-out operation to transfer funds from a customer card account to the CFX Master Account. This method calls Girasol's POST /v1/accounts/cash-out endpoint and returns the transaction details.

      Parameters

      • input: CashOutGirasolAccountRequest

      Returns Promise<
          {
              createdAt: string;
              currency: string;
              description: string;
              MasterAccountBalance: number;
              transactionId: number;
              userBalance: number;
          },
      >

    • Creates a new company user account.

      This method calls Girasol's POST /v1/accounts/create-company-user endpoint and returns the created company account details.

      Parameters

      • input: CreateGirasolCompanyAccountRequest

      Returns Promise<{ accountNumber: number; email: string }>

    • Creates a new physical card associated with an account.

      This method calls Girasol's POST /v1/cards/create-card endpoint and returns the created card details.

      Parameters

      • input: CreateGirasolPhysicalCardRequest

      Returns Promise<
          {
              cardId: string;
              cardStatus: string;
              firstName: string;
              lastName: string;
              message: string;
              type: number;
          },
      >

    • Creates a new virtual card associated with an account.

      This method calls Girasol's POST /v1/cards/create-virtual-card endpoint and returns the created card details.

      Parameters

      • input: CreateGirasolVirtualCardRequest

      Returns Promise<
          {
              cardId: string;
              cardStatus: string;
              expirationMonth: number;
              expirationYear: number;
              firstName: string;
              lastDigits: string;
              lastName: string;
              type: number;
          },
      >

    • Freezes an account by changing its status to inactive (status: 2).

      This method calls Girasol's PATCH /v1/accounts/change-account-status endpoint and returns the updated account status information. Calling this 'freeze' purely to align with the terminology used for cards.

      Parameters

      • input: FreezeGirasolAccountRequest

      Returns Promise<FreezeGirasolAccountResponse>

    • Retrieves account information by account ID.

      This method calls Girasol's GET /v1/accounts/customer-info/{accountNumber} endpoint and returns the account details.

      Parameters

      • __namedParameters: { accountNumber: number }

      Returns Promise<
          {
              accountNumber: number;
              addressLine1: string;
              addressLine2: string;
              balance: number;
              city: string;
              createdAt: string;
              currency: string;
              email: string;
              firstName: string;
              lastName: string;
              phone: string;
              status: number;
          },
      >

    • Retrieves card information by card ID.

      This method calls Girasol's GET /v1/cards/info-by-card-id/{cardId} endpoint and returns the card details.

      Parameters

      • __namedParameters: { cardId: string }

      Returns Promise<
          {
              contactNumber: string;
              createdAt: string;
              id: string;
              lastDigits: string;
              nameForPrint: string;
              status: number;
          },
      >

    • Retrieves cards by account ID.

      This method calls Girasol's GET /v1/cards/info-by-account/{accountNumber} endpoint and returns the card details.

      Parameters

      • __namedParameters: { accountNumber: number }

      Returns Promise<
          {
              contactNumber: string;
              createdAt: string;
              id: string;
              lastDigits: string;
              nameForPrint: string;
              status: number;
          }[],
      >

    • Get card token by card ID to retrieve card sensitive data. This method calls the GET /v1/cards/card-token/{cardId} endpoint, and returns the card token.

      Parameters

      • __namedParameters: { cardId: string }

      Returns Promise<{ token: string }>

    • Retrieves clearing information for a specific date. This method calls Girasol's GET /v1/clearing?date={date} endpoint and returns the clearing details.

      Parameters

      • __namedParameters: { date: string }

      Returns Promise<
          {
              amount_cleared: string;
              authorization_code: string;
              card_id: string;
              ref_number: string;
              transaction_id: string;
          }[],
      >

    • Unfreezes an account by changing its status to active (status: 1).

      This method calls Girasol's PATCH /v1/accounts/change-account-status endpoint and returns the updated account status information. Calling this 'unfreeze' purely to align with the terminology used for cards.

      Parameters

      • input: UnfreezeGirasolAccountRequest

      Returns Promise<UnfreezeGirasolAccountResponse>

    • Unfreezes a card by its card ID.

      This method calls Girasol's PATCH /v1/cards/{cardId}/unfreeze endpoint and returns the updated card info. The status will change from "FREEZED" to "ACTIVE".

      Parameters

      • input: UnfreezeGirasolCardRequest

      Returns Promise<UnfreezeGirasolCardResponse>