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

    Every method returns a Result. A 4xx the caller can act on is err YELLOWCARD_ERROR (or PAYMENT_NOT_FOUND for a payment that does not exist). A fault (401/403, 408, 429, 5xx) throws a plain Error.

    Index
    instance: (...args: []) => YellowcardClient = ...

    The process client over the payouts API, reading the yellowcard namespace at each call.

    • Parameters

      • id: string

      Returns Promise<
          | { error: YellowcardError; ok: false }
          | { error: ServiceError<"PAYMENT_NOT_FOUND", object>; ok: false }
          | {
              ok: true;
              value: {
                  amount: number;
                  channelId?: string;
                  convertedAmount: number;
                  country?: string;
                  createdAt?: string;
                  currency?: string;
                  destination?: {
                      accountName?: string;
                      accountNumber?: string;
                      accountType?: string;
                      networkId?: string;
                      networkName?: string;
                  };
                  expiresAt?: string;
                  id?: string;
                  partnerId?: string;
                  rate: number;
                  reason?: string;
                  sender?: {
                      address?: string;
                      country?: string;
                      dob?: string;
                      email?: string;
                      idNumber?: string;
                      idType?: string;
                      name?: string;
                      phone?: string;
                  };
                  sequenceId?: string;
                  status?: string;
                  updatedAt?: string;
              };
          },
      >

    • Parameters

      • req: { active?: boolean; state?: string; url: string } & {} | undefined
        • { active?: boolean; state?: string; url: string } & {}
          • Optionalactive?: boolean

            Whether this webhook is currently active or not. Defaults to true if omitted.

            true
            
          • Optionalstate?: string

            The transaction status event that this webhook will be activated for. If omitted, the webhook will receive all events.

          • url: string

            The URL to which the event will be posted to.

          • undefined

        Returns Promise<
            | { error: YellowcardError; ok: false }
            | {
                ok: true;
                value: {
                    active: boolean;
                    createdAt?: string;
                    id?: string;
                    partnerId?: string;
                    state?: string;
                    updatedAt?: string;
                    url?: string;
                };
            },
        >

      • Parameters

        • Optionalcountry: string

        Returns Promise<
            | { error: YellowcardError; ok: false }
            | {
                ok: true;
                value: {
                    accountNumberType?: string;
                    channelIds?: string[];
                    code?: string;
                    country?: string;
                    countryAccountNumberType?: string;
                    createdAt?: string;
                    id?: string;
                    name?: string;
                    status?: string;
                    updatedAt?: string;
                }[];
            },
        >

      • Parameters

        • Optionalcurrency: string

        Returns Promise<
            | { error: YellowcardError; ok: false }
            | {
                ok: true;
                value: {
                    rates?: {
                        buy: number;
                        code?: string;
                        locale?: string;
                        rateId?: string;
                        sell: number;
                        updatedAt?: string;
                    }[];
                };
            },
        >

      • Parameters

        • req: {
              amount?: number;
              channelId: string;
              customerType?: "retail" | "institution";
              destination: {
                  accountBank?: string;
                  accountName: string;
                  accountNumber: string;
                  accountType: "bank" | "momo";
                  country?: string;
                  networkId: string;
                  networkName?: string;
                  phoneNumber?: string;
              } & {};
              forceAccept?: boolean;
              localAmount?: number;
              reason: string;
              sender: {
                  additionalIdNumber?: string;
                  additionalIdType?: string;
                  address?: string;
                  businessId?: string;
                  businessName?: string;
                  country?: string;
                  dob?: string;
                  email?: string;
                  idNumber?: string;
                  idType?: string;
                  name?: string;
                  phone?: string;
              } & {};
              sequenceId: string;
          } & {} & { customerUID: string }
          • Optionalamount?: number

            Format: int32

            Amount in USD to transact

          • channelId: string

            The identifier of the specific channel to execute payment through

          • OptionalcustomerType?: "retail" | "institution"

            Determines the type of validation that is performed on the sender. If value is institution, the sender request object will be validated to ensure it includes businessName and businessId parameter. If the value is retail, the sender request object will be validated to ensure it includes name, phone, email, country, address, dob, idNumber and idType.

            retail
            @enum {string}
          • destination: {
                accountBank?: string;
                accountName: string;
                accountNumber: string;
                accountType: "bank" | "momo";
                country?: string;
                networkId: string;
                networkName?: string;
                phoneNumber?: string;
            } & {}

            Destination and Recipient Details

          • OptionalforceAccept?: boolean

            Specify whether or not you want to skip the accept payment step

            false
            
          • OptionallocalAmount?: number

            Format: int32

            The amount in local currency to transact

          • reason: string

            The reason for the withdrawal

          • sender: {
                additionalIdNumber?: string;
                additionalIdType?: string;
                address?: string;
                businessId?: string;
                businessName?: string;
                country?: string;
                dob?: string;
                email?: string;
                idNumber?: string;
                idType?: string;
                name?: string;
                phone?: string;
            } & {}

            Sender KYC details

          • sequenceId: string

            Represents a unique id for the transaction from your end

            • customerUID: string

          Returns Promise<
              | { error: YellowcardError; ok: false }
              | {
                  ok: true;
                  value: {
                      amount: number;
                      channelId?: string;
                      convertedAmount: number;
                      country?: string;
                      createdAt?: string;
                      currency?: string;
                      destination?: {
                          accountName?: string;
                          accountNumber?: string;
                          accountType?: string;
                          networkId?: string;
                      };
                      expiresAt?: string;
                      id?: string;
                      rate: number;
                      reason?: string;
                      sender?: {
                          address?: string;
                          country?: string;
                          dob?: string;
                          email?: string;
                          idNumber?: string;
                          idType?: string;
                          name?: string;
                          phone?: string;
                      };
                      sequenceId?: string;
                      status?: string;
                      updatedAt?: string;
                  };
              },
          >