> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fluz.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Request Gift Card Purchase Approval

`requestGiftCardPurchase`

Submit a manager approval request to purchase a gift card. When approved, Fluz completes the purchase using the submitted parameters.

## Scopes

| Action             | Scope               |
| ------------------ | ------------------- |
| Create request     | `REQUEST_GIFT_CARD` |
| List requests      | `LIST_APPROVALS`    |
| Approve or decline | `MANAGE_APPROVALS`  |

## Webhook Identifiers

| Field          | Value       |
| -------------- | ----------- |
| `approvalType` | `GIFT_CARD` |
| `approvalCode` | `400007`    |

Webhook events: `APPROVAL_CREATE`, `APPROVAL_APPROVE`, `APPROVAL_DECLINE`, and `APPROVAL_HANDLER_ERROR` on execution failure.

## Create a Request

Input fields mirror the direct `purchaseGiftCard` mutation. See [Purchase Gift Card](/purchase-gift-card) for offer and funding source details.

### RequestGiftCardPurchaseInput

| Field                       | Type                  | Required | Description                                 |
| --------------------------- | --------------------- | -------- | ------------------------------------------- |
| `offerId`                   | UUID                  | Yes      | Gift card offer ID                          |
| `purchaseAmount`            | Float                 | Yes      | Purchase amount                             |
| `channel`                   | SourcePlatformChannel | Yes      | Request origin channel (for example, `API`) |
| `fluzpayAmount`             | Float                 | No       | Amount to fund from Fluz balance            |
| `bankCardId`                | UUID                  | No       | Bank card funding source                    |
| `bankAccountId`             | UUID                  | No       | Bank account funding source                 |
| `paypalVaultId`             | UUID                  | No       | PayPal funding source                       |
| `userCashBalanceId`         | UUID                  | No       | Spend account to fund the purchase          |
| `seatId`                    | UUID                  | No       | Seat associated with the purchase           |
| `exclusiveRateId`           | UUID                  | No       | Exclusive rate ID                           |
| `merchantSlug`              | String                | No       | Merchant slug                               |
| `gcWarehouseMerchantId`     | UUID                  | No       | Gift card warehouse merchant ID             |
| `gcWarehouseUserRewardRate` | Float                 | No       | Warehouse user reward rate                  |
| `gcWarehouseDiscountRate`   | Float                 | No       | Warehouse discount rate                     |
| `memo`                      | String                | No       | Transaction memo                            |
| `categoryId`                | UUID                  | No       | Transaction category ID                     |

### Sample Mutation

```graphql theme={null}
mutation {
  requestGiftCardPurchase(
    input: {
      offerId: "ed669305-5e43-40a0-9a25-7a15ed174628"
      purchaseAmount: 25.00
      channel: API
      fluzpayAmount: 25.00
      userCashBalanceId: "b1155504-ad30-4b2f-873d-b8795277b128"
    }
  ) {
    success
    messageId
    error {
      code
      message
    }
  }
}
```

### Sample Response

```json theme={null}
{
  "data": {
    "requestGiftCardPurchase": {
      "success": true,
      "messageId": "1234567890"
    }
  }
}
```

## Approve a Request

Call `approveApprovalRequest` with the `approvalId`. Requires `MANAGE_APPROVALS`.

```graphql theme={null}
mutation {
  approveApprovalRequest(approvalId: "07df5653-43a8-4532-9881-3ab5857bbe12") {
    success
    approvalId
    action
  }
}
```

On approval, Fluz purchases the gift card.

## Decline a Request

Call `declineApprovalRequest` with the `approvalId`. Requires `MANAGE_APPROVALS`.

```graphql theme={null}
mutation {
  declineApprovalRequest(approvalId: "07df5653-43a8-4532-9881-3ab5857bbe12") {
    success
    approvalId
    action
  }
}
```

No gift card is purchased when a request is declined.
