Create Virtual Card Bulk Order

The createVirtualCardBulkOrder mutation allows you to create multiple virtual cards in a single request. This mutation requires a CreateVirtualCardBulkOrderInput input object and the CREATE_VIRTUALCARD scope.

Sandbox Valid Virtual Card Test Offers:

Offer IDProgram NameReward Value
ed669305-5e43-40a0-9a25-7a15ed174628Virtual Card1.5%
b23630f6-8d91-43df-84aa-a541e7691197Virtual Card - Mastercard Prepaid1.5%
592c394e-26cc-44ac-a145-a5f81301fe77Brand Locked Virtual Card - Mastercard Prepaid1.5%

Important Considerations for Virtual Card Creation

  • Offer ID: The offerId is applied to all cards created within the bulk order.
  • Funding Source: You can fund your virtual cards using either your Fluz balance or a linked bank account.
    • If you select a bank account as the primaryFundingSource, you must provide the bankAccountId.
  • Spend Limits: The spendLimit you set must adhere to the program's defined spend limits for the chosen spendLimitDuration. An error will occur if the limit is exceeded.
  • Quantity: Each item in the orderItems array includes a quantity, allowing you to create multiple cards with the same configuration efficiently.

Arguments

  • input (CreateVirtualCardBulkOrderInput!): The input object containing details for the new virtual card bulk order.

CreateVirtualCardBulkOrderInput Fields

FieldTypeDescriptionRequired
offerIdUUID!The Offer ID to be used for all cards in this bulk order. Use getVirtualCardOffers to fetch a list of active offers.Yes
orderItems[CreateVirtualCardBulkOrderItemInput!]!An array of objects, each defining a set of virtual cards to be created.Yes

CreateVirtualCardBulkOrderItemInput Fields

FieldTypeDescriptionRequired
quantityInt!The number of virtual cards to create with this specific configuration.Yes
spendLimitFloat!The maximum amount you can charge to each card. You are only charged for the amount actually used.Yes
spendLimitDurationVirtualCardSpendLimitDurationCard limit duration type. Default is LIFETIME.No
lockDateStringThe date when the card will be locked. The default is 47 months from creation. Format: yyyy-mm-ddNo
lockCardNextUseBooleanSetting to lock the card after its next use. The default is false.No
cardNicknameStringThe card's nickname.No
primaryFundingSourceVirtualCardFundingSourcePrimary Funding Source for Virtual Card. Default is FLUZ_BALANCE.No
bankAccountIdUUIDThe unique identifier for the bank account. Required if primaryFundingSource is BANK_ACCOUNT.No

cURL Example

curl -X POST \
  https://transactional-graph.staging.fluzapp.com/api/v1/graphql \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_USER_ACCESS_TOKEN' \
  -d '{
    "query": "mutation CreateVirtualCardBulkOrder { createVirtualCardBulkOrder( input: { offerId: \"592c394e-26cc-44ac-a145-a5f81301fe77\", orderItems: [ { quantity: 3, spendLimit: 100, spendLimitDuration: DAILY, lockCardNextUse: true, cardNickname: \"Test nickname\", primaryFundingSource: FLUZ_BALANCE }, { quantity: 1, spendLimit: 200, spendLimitDuration: WEEKLY, lockCardNextUse: false, lockDate: \"2030-10-10\", cardNickname: \"Test nickname 2\", primaryFundingSource: BANK_ACCOUNT, bankAccountId: \"7f60cb5d-683f-4181-9194-408ea92d6248\" } ] } ) { orderId orderStatus } }"
  }'

Sample Mutation

mutation CreateVirtualCardBulkOrder {
    createVirtualCardBulkOrder(
        input: {
            offerId: "592c394e-26cc-44ac-a145-a5f81301fe77"
            orderItems: [
                {
                    quantity: 3
                    spendLimit: 100
                    spendLimitDuration: DAILY
                    lockCardNextUse: true
                    cardNickname: "Test nickname"
                    primaryFundingSource: FLUZ_BALANCE
                }
                {
                    quantity: 1
                    spendLimit: 200
                    spendLimitDuration: WEEKLY
                    lockCardNextUse: false
                    lockDate: "2030-10-10"
                    cardNickname: "Test nickname 2"
                    primaryFundingSource: BANK_ACCOUNT
                    bankAccountId: "7f60cb5d-683f-4181-9194-408ea92d6248"
                }
            ]
        }
    ) {
        orderId
        orderStatus
    }
}

Sample Response

{
  "data": {
    "createVirtualCardBulkOrder": {
      "orderId": "MTFkYjIxNTYtNTEwOS00ODNmLTkwMTYtYjA5N2E2NTEyMjU5fDIzMjIxODRhLTEzMjgtNDkwYy05Mzc1LTZlOWM4MWIwMjkzZA==",
      "orderStatus": "PENDING",
    }
  }
}

Response Field Explanations

  • orderId (UUID): The unique identifier for the bulk creation order.
  • orderStatus (VirtualCardBulkOrderStatus!): The status of the bulk order (e.g., COMPLETED, PENDING, FAILED).

Code Example:


Want to learn more? Contact us at [email protected]

Speak with our experts for more info or to request a demo.