Gift Cards
Category: Store
Base URL: /store/carts
Authentication: Mixed
Routes: 2 routes documented
Overview#
This section documents 2 API routes for gift cards.
Look up a gift card to show its balance, then apply it to a cart. Applying and removing are cart operations, so they live under /store/carts/:id/gift-cards. Cards are issued from the admin endpoints. For a customer-owned balance, see store credit.
Applying a balance to a cart does not spend it. The deduction happens when the order completes, and is undone if payment fails. See Gift Cards & Store Credit for the full lifecycle, the differences between the two, refunds, and troubleshooting.
Quick Reference#
| Method | Endpoint | Description |
|---|---|---|
| DELETE | /store/carts/:id/gift-cards |
Remove a gift card from a cart, releasing it for use elsewhe... |
| POST | /store/carts/:id/gift-cards |
Apply a gift card to a cart by code. The balance is drawn ... |
| GET | /store/gift-cards/:idOrCode |
Look up a gift card by either its id or its code, so a store... |
DELETE Store Carts :id Gift-cards#
Endpoint: DELETE /store/carts/:id/gift-cards
Authentication: Customer (Optional)
Description#
Remove a gift card from a cart, releasing it for use elsewhere.
URL Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Id identifier |
Response#
Success:
{
cart,
}Example Request#
curl -X DELETE 'https://your-store.omnicart.cc/store/carts/:id/gift-cards' \
-H 'Content-Type: application/json'POST Store Carts :id Gift-cards#
Endpoint: POST /store/carts/:id/gift-cards
Authentication: Customer (Optional)
Description#
Apply a gift card to a cart by code. The balance is drawn down when the order completes, not at the moment it is applied.
URL Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Id identifier |
Request Body#
| Field | Type | Required |
|---|---|---|
code |
string | Yes |
Response#
Success:
{
cart,
}Example Request#
curl -X POST 'https://your-store.omnicart.cc/store/carts/:id/gift-cards' \
-H 'Content-Type: application/json'GET Store Gift-cards :idOrCode#
Endpoint: GET /store/gift-cards/:idOrCode
Authentication: Customer (Optional)
Description#
Look up a gift card by either its id or its code, so a storefront can show a balance before the customer commits to applying it.
URL Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
idOrCode |
string | Yes | IdOrCode identifier |
Response#
Success:
{
gift_card,
}Example Request#
curl -X GET 'https://your-store.omnicart.cc/store/gift-cards/:idOrCode' \
-H 'Content-Type: application/json'