Gift Card API
The Gift Card API enables programmatic management of gift cards in the OrbVPN system. You can create, redeem, and manage gift cards for different subscription groups.
Overview
Gift cards provide a way to:
- Create single or bulk gift cards for specific subscription groups
- Redeem gift cards for subscriptions
- Track gift card usage and expiration
- Manage gift card cancellations
GraphQL Schema
Types
type GiftCard {
id: ID!
code: String! # Unique gift card code (format: ORB-XXXX-XXXX-XXXX)
groupId: Int! # Associated subscription group ID
groupName: String! # Name of the subscription group
amount: Float! # Value of the gift card
used: Boolean! # Whether the gift card has been redeemed
cancelled: Boolean! # Whether the gift card has been cancelled
expirationDate: DateTime! # When the gift card expires
redeemedAt: DateTime # When the gift card was redeemed
redeemedByEmail: String # Email of user who redeemed the card
cancelledAt: DateTime # When the gift card was cancelled
cancelledByEmail: String # Email of admin who cancelled the card
createdAt: DateTime! # Creation timestamp
updatedAt: DateTime! # Last update timestamp
}
input GiftCardCreateInput {
groupId: Int! # Subscription group ID for the gift card
validityDays: Int! # Number of days the gift card remains valid
}