VTEX

GiftCard API

>ℹ️ Onboarding guide > > Check the new [Payments onboarding guide](https://developers.vtex.com/docs/guides/payments-overview). We created this guide to…

Other#openapi

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

>ℹ️ Onboarding guide
>
> Check the new Payments onboarding guide. We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Payments and is organized by focusing on the developer's journey.

The Gift Card is a payment method configured as a cash value associated with a client. It is used to grant a discount on the value of the order at the store.

> ⚠ A Gift Card works as a payment method, not a promotion.

Endpoints 11

Gift Card

  • POSTCreate GiftCard/giftcardsCreates a GiftCard for a specific user
  • POSTGet GiftCard using JSON/giftcards/_searchReturns the giftcards based on the cart data.
  • GETGet GiftCard by ID/giftcards/:giftCardIDReturns associated data for a specified giftcardId.

Transaction

  • GETGet GiftCard Transactions/giftcards/:giftCardID/transactionsReturns all transaction of a giftcard.
  • POSTCreate GiftCard Transaction/giftcards/:giftCardID/transactionsRegister a new giftcard transaction and authorize the item reservation.
  • GETGet GiftCard Transaction by ID/giftcards/:giftCardID/transactions/:transactionID
  • GETGet Transaction Authorizations/giftcards/:giftCardID/transactions/:transactionID/authorizationReturns the giftcard transaction authorizations.
  • GETGet Transaction Cancellations/giftcards/:giftCardID/transactions/:transactionID/cancellationsReturns the giftcard transaction cancellations.
  • POSTCancel GiftCard Transaction/giftcards/:giftCardID/transactions/:transactionID/cancellationsCreates a cancellation in the transaction. Cancel a item reservation or create a refund.
  • GETGet Transaction Settlements/giftcards/:giftCardID/transactions/:transactionID/settlementsReturns the giftcard transaction settlements.
  • POSTSettle GiftCard Transaction/giftcards/:giftCardID/transactions/:transactionID/settlementsCreates a giftcard transaction settlement.

API details

Base URL
https://vtex.local
https://{accountName}.{environment}.com.br/api
Authentication
An API key in the X-VTEX-API-AppKey header
An API key in the X-VTEX-API-AppToken header
Operations
11 operations on 8 pathsGET 6POST 5
Main resources
Transaction 8Gift Card 3
Response formats
application/json
Description format
OpenAPI 3.0.0, API version 1.0
Listed from
APIs.guru OpenAPI Directory (CC0-1.0)
Source updated

How to test the GiftCard API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the GiftCard API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses an API key in the X-VTEX-API-AppKey header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Create GiftCard” (POST /giftcards), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the GiftCard API?

>ℹ️ Onboarding guide > > Check the new [Payments onboarding guide](https://developers.vtex.com/docs/guides/payments-overview). We created this guide to… It is listed under Other and has 11 endpoints.

Who publishes the GiftCard API?

It is listed from VTEX's public API description (an OpenAPI document), not published by VTEX on Swastik Codes. Anyone who controls vtex.com can claim the profile by adding a DNS TXT record.

What is the base URL of the GiftCard API?

Its description lists 2 base URLs: https://vtex.local, https://{accountName}.{environment}.com.br/api. The first is the usual one; the others are typically sandbox or regional servers.

How do I authenticate with the GiftCard API?

It accepts 2 methods: an API key in the X-VTEX-API-AppKey header; an API key in the X-VTEX-API-AppToken header.

How many endpoints does the GiftCard API have?

11 operations on 8 paths (6 GET, 5 POST). The largest groups are Transaction, Gift Card.

Is forking the GiftCard API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.