The /api/giftCards/orders API endpoint allows partners to retrieve a list of all gift cards that have been purchased by customers and returned from the backend system. This endpoint provides essential data to help partners display gift card information in a clear and structured way, ensuring that both archived and non-archived cards can be efficiently managed.
Request Parameters:
archive:
- If set to false, the response will include only non-archived cards that are currently active or recently purchased by the customer.
- If set to true, the response will return archived cards that have been used, expired, or otherwise marked as no longer active.
skip:
- Used to skip a specified number of records from the beginning of the list. This is useful for pagination, especially when a large number of gift cards need to be displayed in smaller batches.
limit
- Defines the maximum number of records to return in a single API response. This helps control the size of each response, allowing partners to manage large datasets without overloading their application.
Example Usage:
Suppose a customer has purchased 45 gift cards, and you want to display them in batches of 10, starting with the most recent ones. You can start by calling the API with skip: 0 and limit: 10 to retrieve the first 10 cards. For subsequent batches, you would adjust the skip parameter (e.g., skip: 10, skip: 20, etc.) while keeping the limit: 10 to fetch the next set of cards.
This approach helps ensure efficient data loading, reducing the strain on the system while providing a smooth experience for the customer.
Benefits:
- Efficient Data Management: Partners can retrieve gift card information in small, manageable batches, ensuring better control over loading times and application performance.
- Archiving Flexibility: The archive parameter allows partners to easily distinguish between active and archived gift cards, helping to maintain a clean and organized gift card overview for customers.
- Scalable Pagination: The skip and limit parameters provide flexible pagination options, making it easy to retrieve a large number of cards in a scalable manner.