Guides
Create gift cards
Create gift cards from your balance, hand out their codes and print them as PDFs. A gift card code is bearer value: treat it like cash.
Before you start
- A key with
giftcards:create, andtransactions:readto list your gift cards. An IP allowlist is optional, but we recommend one for agiftcards:createkey: requests from any other address then get403 ip_not_allowed. - Gift cards switched on for the API:
giftcards_enabledin GET/v1/status, andgiftcards.enabledin GET/v1/limits. - Enough of the asset in your available balance. The amount is taken from it when the card is made.
Limits
Gift cards have limits of their own, counted across every channel, the webapp included:
- a largest value per card, in EUR;
- a number per day and per 30 days, and a total value per 30 days in EUR;
- 5 per hour per key, as a rate limit.
The starting values are at most 5 cards a day, 20 in 30 days and 2,000 EUR in 30 days. GET/v1/limits shows the current values and your use under giftcards. Going over one returns 422 limit_exceeded or 422 amount_above_maximum.
Only some assets can be given as gift cards; USDC can't. Others return 422 asset_not_tradable.
Create a gift card
POST/v1/giftcards takes the asset, the amount in that asset, and optionally the recipient's
name (up to 60 characters), which is printed on the card. The Idempotency-Key header is required.
# Signed by sign-headers.sh: see Authentication
body='{"asset":"BTC","amount":"0.0005","recipient_name":"Anna"}'
idempotency_key=$(uuidgen) # reuse it to retry safely
curl https://public-api.myntkaup.is/v1/giftcards \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $idempotency_key" \
$(./sign-headers.sh POST /v1/giftcards "$body" | sed 's/^/-H /') \
--data "$body"import { Myntkaup } from "@myntkaup/api";
const client = new Myntkaup(); // reads the key from the environment
// Sends a random Idempotency-Key unless you pass idempotencyKey.
const card = await client.giftcards.create({ asset: "BTC", amount: "0.0005", recipientName: "Anna" });
console.log(card.id, card.code);from myntkaup import Myntkaup
client = Myntkaup() # reads the key from the environment
# Sends a random Idempotency-Key unless you pass idempotency_key.
card = client.giftcards.create(asset="BTC", amount="0.0005", recipient_name="Anna")
print(card["id"], card["code"]){
"id": "gc_01JB8X2Q4M7Z3V9K5T1N6R0P2W",
"asset": "BTC",
"amount": "0.0005",
"recipient_name": "Anna",
"status": "unredeemed",
"code": "m-k3x9q2ab",
"source": "public_api",
"created_at": "2026-11-03T10:15:10Z",
"redeemed_at": null
}The account owner gets an email for every gift card made through the API.
The code
- A code is
m-followed by 8 lowercase letters and digits. - It's returned when the card is made, and by
GET /v1/giftcardsandGET /v1/giftcards/{id}, but only to keys withgiftcards:create. Keys with onlytransactions:readsee the card without itscode. - The recipient redeems it in the Myntkaup app or webapp. The card's
statusthen changes fromunredeemedtoredeemed.
Print it
GET/v1/giftcards/{id}/pdf returns a printable PDF of the card, with its code. It needs
giftcards:create too.
# Signed by sign-headers.sh: see Authentication
curl https://public-api.myntkaup.is/v1/giftcards/gc_01JB8X2Q4M7Z3V9K5T1N6R0P2W/pdf \
$(./sign-headers.sh GET /v1/giftcards/gc_01JB8X2Q4M7Z3V9K5T1N6R0P2W/pdf | sed 's/^/-H /') \
-o giftcard.pdfimport { writeFile } from "node:fs/promises";
import { Myntkaup } from "@myntkaup/api";
const client = new Myntkaup(); // reads the key from the environment
const pdf = await client.giftcards.pdf("gc_01JB8X2Q4M7Z3V9K5T1N6R0P2W"); // Uint8Array
await writeFile("giftcard.pdf", pdf);from myntkaup import Myntkaup
client = Myntkaup() # reads the key from the environment
pdf = client.giftcards.pdf("gc_01JB8X2Q4M7Z3V9K5T1N6R0P2W") # bytes
with open("giftcard.pdf", "wb") as file:
file.write(pdf)Follow up
GET/v1/giftcards filters by status, so you can see which cards are still unredeemed:
# Signed by sign-headers.sh: see Authentication
curl "https://public-api.myntkaup.is/v1/giftcards?status=unredeemed" \
$(./sign-headers.sh GET "/v1/giftcards?status=unredeemed" | sed 's/^/-H /')import { Myntkaup } from "@myntkaup/api";
const client = new Myntkaup(); // reads the key from the environment
const page = await client.giftcards.list({ status: "unredeemed" });
console.log(page.data.map((card) => card.id));from myntkaup import Myntkaup
client = Myntkaup() # reads the key from the environment
page = client.giftcards.list(status="unredeemed")
print([card["id"] for card in page["data"]])Security checklist
- A key used only for gift cards, with
giftcards:createand, as we recommend, a tight IP allowlist. - One
Idempotency-Keyper card, stored before sending and reused on retries. - Codes are stored encrypted, or not stored at all and fetched when needed.
- Codes go only to their recipient, over a channel you trust.
- The
request_idof every card is logged.