Quickstart
Send your first On Me gift through the API in about five minutes, open it as your recipient would, then look it up.
For AI agents: this page is available as Markdown, and every guide plus the API reference is in llms-full.txt.
In this guide you send a $10 gift to yourself as a link, open it the way a recipient would, and then look it up through the API. You need a terminal, and optionally Node 18+ or Python 3 with requests. The Node samples use top-level await, so run them as ES modules, for example by saving them as .mjs files.
Get your API key
If you don't have a key yet, an org admin can create one under Account โ Developers (see Get an API key). Then export it in your terminal so the examples below can use it:
export ONME_API_KEY=omk-...Check your balance
Your order is paid for from your organization's balance, so make sure it has at least $10. You can see it, and add funds, under Billing in the business portal.
Pick a category
A category decides where the gift can be spent. List them all:
curl https://api.onme.com/v1/categories \ -H "Authorization: Bearer $ONME_API_KEY"You get back a list. We've trimmed each category to the fields you need here:
200OK{ "object": "list", "data": [ { "id": "coffee", "name": "Coffee", "description": "For caffeine-addicts" }, { "id": "choice", "name": "Choice", "description": "For those who want to choose" } ], "has_more": false }Copy the
idof the one you like. The examples below usecoffee.Send the gift
Create an order with one $10 gift.
amountis in cents, so $10 is1000, the smallest gift you can send. Thelinkdelivery method means we don't email or text anyone; we give you a link instead.Every
POST /v1/ordersneeds anIdempotency-Keyheader with a value that's unique to this order. If a request times out, retrying with the same key returns the original order instead of charging you twice.curl https://api.onme.com/v1/orders \ -H "Authorization: Bearer $ONME_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "gifts": [ { "amount": 1000, "category": "coffee", "delivery": { "method": "link" }, "personalization": { "recipient_name": "You" } } ] }'A
201means the order exists and your balance has been debited. Withstatus: "processed", as here, the gift exists too.sender_nameshows your organization's name because you didn't set one:201Created{ "order_id": "o-jfAQKlOHalPHMJkwMYZffJF_6j2OMWSu9svqSIvkLSw", "status": "processed", "gifts": [ { "gift_id": "g-gpsh60pP2JhgzroxWk4AyXfL237_DiKIJQK8ilq2u5g", "amount": 1000, "category": "coffee", "delivery": { "method": "link", "status": "sent", "link": "https://gift.onme.com/b6YSLdAA98fcSxpU" }, "personalization": { "recipient_name": "You", "sender_name": "Acme" } } ] }In the rare case that
statusisprocessing,giftscan be empty; the gift is finished shortly after, and the lookup in the last step returns it. See when the status is processing.Hang on to the
order_id; you need it in the last step. If you got an error instead, itscodesays what to fix, and nothing was charged. Look it up in the error reference.Open your gift
Copy
gifts[0].delivery.linkfrom the response and open it in your browser. You land on the gift's claim page, the same one a recipient sees when you share a link with them. Claim it if you like: it's a real gift.Look it up
Fetch the order by its ID, replacing the example ID with your own:
curl https://api.onme.com/v1/orders/o-jfAQKlOHalPHMJkwMYZffJF_6j2OMWSu9svqSIvkLSw \ -H "Authorization: Bearer $ONME_API_KEY"Because you opened the link, the gift's
delivery.statushas moved fromsenttoopened. If you claimed it, it readsclaimed.
What just happened
- Your balance paid for the order.
POST /v1/ordersdebited $10 from your organization's balance and, almost always, created the gift in the same request. There was no checkout and no card to charge. - You delivered the gift yourself. With the
linkmethod, we created the gift and handed you its claim link, and you chose where it went. Theemailandphonemethods have us send it for you. - The gift moved through its lifecycle. It started as
sent, becameopenedwhen you visited the link, and becomesclaimedonce someone claims it and gets a card for its category. How a gift moves shows the whole journey.
Next steps
- Creating orders: send several gifts at once, set the names recipients see, and handle every response.
- Idempotency and retries: build a retry loop that can never charge you twice.
- Delivery methods: send gifts by email or SMS, and fix a delivery that failed.