---
updatedAt: 2025-10-11T06:34:41.000Z
agentTools:
  projectIndex: https://documentation.prestmit.io/llms.txt
---

# Buy Gift Card

This page explains how to buy gift cards through the Prestmit API.

By buying gift cards through the Prestmit API, you offer your users a smooth, automated way to purchase digital gift cards.

## Prerequisites

Before you can use the gift card buying endpoints, ensure you have:

* **API Authentication**: Valid API key as specified in <Anchor label="API Keys & Authentication" target="_blank" href="https://documentation.prestmit.io/docs/getting-started-api-keys-authentication#/">API Keys & Authentication</Anchor>
* **Funded Wallet**: Sufficient balance in your Prestmit wallet
* **Webhook Setup**: Configured webhook URL to receive gift card delivery notifications

***

## 🔄 The Buy Gift Card Process

Here's how the process works from start to finish:

1. **Browse Gift Cards:** Fetch available cards and their prices
2. **Calculate Payment:** Get the exact cost for selected cards and quantity
3. **Create Order:** Send a request to buy the card
4. **Payment:** The system deducts the amount from your Prestmit wallet
5. **Delivery:** Retrieve the gift card codes once payment is complete

***

## 📊 Available Endpoints

You'll use these endpoints for gift card purchase:

| **Endpoint**                                                                                                                                                                                                                                         | **Method** | **Purpose**                                             |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------------------------------------------------------- |
| <Anchor label="`/giftcard-trade/buy/config`" target="_blank" href="https://documentation.prestmit.io/reference/get_api-partners-v1-giftcard-trade-buy-config">`/giftcard-trade/buy/config`</Anchor>                                                  | GET        | Get configuration, available cards, and payment methods |
| <Anchor label="`/giftcard-trade/buy/calculate-payment`" target="_blank" href="https://documentation.prestmit.io/reference/post_api-partners-v1-giftcard-trade-buy-calculate-payment">`/giftcard-trade/buy/calculate-payment`</Anchor>                | POST       | Calculate exact payment amount for selected cards       |
| <Anchor label="`/giftcard-trade/buy/create`" target="_blank" href="https://documentation.prestmit.io/reference/post_api-partners-v1-giftcard-trade-buy-create">`/giftcard-trade/buy/create`</Anchor>                                                 | POST       | Create a new buy gift card transaction                  |
| <Anchor label="`/giftcard-trade/buy/fetch-codes/{reference}`" target="_blank" href="https://documentation.prestmit.io/reference/get_api-partners-v1-giftcard-trade-buy-fetch-codes-reference">`/giftcard-trade/buy/fetch-codes/{reference}`</Anchor> | GET        | Retrieve gift card codes after successful payment       |
| <Anchor label="`/giftcard-trade/buy/history`" target="_blank" href="https://documentation.prestmit.io/reference/get_api-partners-v1-giftcard-trade-buy-history">`/giftcard-trade/buy/history`</Anchor>                                               | GET        | View your buy gift card transaction history             |

<br />

> **Tip:** Always use the `/calculate-payment` endpoint before creating orders to show users the exact amount they'll pay in their preferred currency.