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

    Client for Girasol's B2B card-issuing API.

    Every Girasol payload arrives inside an envelope — { statusCode, error, data } — so the useful body is response.data.data: openapi-fetch's data (the parsed 2xx body), then the envelope's own data. handleError checks both the HTTP status and the envelope's error flag before anything reads through it.

    See README.md for how girasol.d.ts is regenerated and which parts of the vendor spec are not trustworthy.

    Index
    • Parameters

      • __namedParameters: { apiKey: string; baseUrl: string; companyId: string; secretKey: string }

      Returns GirasolClient

    • 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

      • __namedParameters: { id: string }

      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: {
            companyAddress: string;
            companyEmail: string;
            companyName: string;
            companyPhone: string;
            incorporationCountryCode: string;
            legalRepresentativeCountryCode: string;
            legalRepresentativeName: string;
            legalRepresentativePassport?: string;
            taxId: string;
        }
        • companyAddress: string

          Full registered address of the company.

        • companyEmail: string

          Format: email

          The company's official email address.

        • companyName: string

          The registered legal name of the company.

        • companyPhone: string

          The company's official phone number including country code.

        • incorporationCountryCode: string

          ISO 3166-1 alpha-3 country code where the company was incorporated. For more info go to country codes

          CUW
          
        • legalRepresentativeCountryCode: string

          ISO 3166-1 alpha-3 country code of the legal representative's nationality. For more info go to country codes

          CUW
          
        • legalRepresentativeName: string

          Full name of the legal representative of the company.

        • OptionallegalRepresentativePassport?: string

          Passport number of the legal representative.

        • taxId: string

          The company's identification number.

      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: string;
              expirationYear: string;
              firstName: string;
              lastDigits: string;
              lastName: string;
              message: 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

      • __namedParameters: { id: string }

      Returns Promise<GirasolAccountStatusChange>

    • Freezes a card by its card ID.

      This method calls Girasol's PATCH /v1/cards/{cardId}/freeze endpoint and returns the updated card info.

      Parameters

      • __namedParameters: { id: string }

      Returns Promise<GirasolCardStatusChange>

    • Retrieves account information by account ID.

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

      Parameters

      • __namedParameters: { accountNumber: string }

      Returns Promise<GirasolAccount>

    • 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: string }

      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<GirasolClearingLine[]>

    • 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

      • __namedParameters: { id: string }

      Returns Promise<GirasolAccountStatusChange>

    • 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

      • __namedParameters: { id: string }

      Returns Promise<GirasolCardStatusChange>