Application Transfer

Transfer funds between a user's cash balance and the application operator's cash balance. This mutation enables bidirectional fund movement—either the user sends funds to the operator (DEPOSIT), or the operator sends funds to the user (WITHDRAW).

Overview

The createTransfer mutation orchestrates balance transfers within the Fluz platform. It automatically infers the source and destination account IDs based on the OAuth token and application settings, simplifying the integration for API consumers.


PropertyValue
EndpointGraphQL API
AuthenticationOAuth Bearer Token
Required ScopesMAKE_PAYOUT_TRANSFER_SEND and/or MAKE_PAYOUT_TRANSFER_RECEIVE

Required Scopes

The mutation requires specific OAuth scopes based on the transfer direction:


DirectionRequired ScopeDescription
SENDMAKE_PAYOUT_TRANSFER_SENDUser sends funds or DEPOSITS funds to the operator
RECEIVEMAKE_PAYOUT_TRANSFER_RECEIVEUser receives funds of WITHDRAWS funds from the operator

Note: The access token must include the appropriate scope for the direction of the transfer. A token with both scopes can perform transfers in either direction.


Input

CreateTransferInput


FieldTypeRequiredDescription
idemptokencyKeyString!YesA unique client-generated string to ensure idempotent request processing. If the same key is submitted multiple times, only the first request will be processed.
directionTransferDirection!YesThe direction of the transfer from the user's perspective.
amountFloat!YesThe amount to transfer. Must be a positive number.
bankCardIdUUIDNoBank card ID to fund the transfer (SEND direction only).
bankAccountIdUUIDNoBank account ID for ACH funding (SEND direction only).
paypalVaultIdUUIDNoPayPal vault ID for PayPal funding (SEND direction only).

TransferDirection Enum


ValueDescription
RECEIVEUser is receiving money (operator -> user). The operator's balance is debited and the user's balance is credited. The user is making a WITHDRAWAL.
SENDUser is spending money (user -> operator). The user's balance is debited and the operator's balance is credited. The user is making a DEPOSIT.

Funding Source Rules

  • Funding source are only valid for SEND direction transfers
  • Only one funding source can be specified per request
  • When no funding source is provided, the transfer uses the user's existing Fluz Cash balance

Output

CreateTransferResponse


FieldTypeDescription
successBoolean!Indicates whether the transfer was successful.
messageString!A human-readable message describing the result.
transferIdUUIDThe unique identifier for the created transfer. Only present when success is true.

Examples

Example 1: User Sends Funds to Operator (from Fluz Balance)

Request:

mutation {
  createTransfer(input: {
    idempotencyKey: "550e8400-e29b-41d4-a716-446655440000"
    direction: SEND
    amount: 100.00
  }) {
    success
    message
    transferId
  }
}

Response

{
  "data": {
    "createTransfer": {
      "success": true,
      "message": "Transfer created successfully.",
      "transferId": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
    }
  }
}

Example 2: User Sends Funds to Operator (from Bank Card)

Request:

mutation {
  createTransfer(input: {
    idempotencyKey: "550e8400-e29b-41d4-a716-446655440001"
    direction: SEND
    amount: 250.00
    bankCardId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }) {
    success
    message
    transferId
  }
}

Response

{
  "data": {
    "createTransfer": {
      "success": true,
      "message": "Transfer created successfully.",
      "transferId": "8d0f7780-8536-51ef-055c-f18fd2g01bf8"
    }
  }
}

Example 3: Operator Sends Funds to User (RECEIVE)

Request:

mutation {
  createTransfer(input: {
    idempotencyKey: "550e8400-e29b-41d4-a716-446655440002"
    direction: RECEIVE
    amount: 50.00
  }) {
    success
    message
    transferId
  }
}

Response

{
  "data": {
    "createTransfer": {
      "success": true,
      "message": "Transfer created successfully.",
      "transferId": "9e1g8891-9647-62fg-166d-g29ge3h12cg9"
    }
  }
}

Error Handling

Error Response Format

All errors follow a standard GraphQL error format with extended error details:

{
  "errors": [
    {
      "message": "Error message here",
      "extensions": {
        "code": "ERROR_CODE",
        "name": "ErrorName",
        "status_code": 400
      }
    }
  ]
}

Common Error Codes


CodeNameHTTP StatusDescription
ARG-0001InvalidArguments422Invalid arguments received (e.g., negative amounts, invalid direction)
ARG-0002MissingArguments422Required arguments are missing
AUTH-0031InvalidScope403The OAuth token doesn't have the required scope for the transfer direction
CASH-0002UnableToRetrieveCashBalanceDeposit400User doesn't have a compatible cash balance configured for the operator's sponsor bank
APPLICATIONS-0001ConfigurationError422Application settings are misconfigured (missing cash balance)