Server connection
Confirm, cancel and look up the designs visitors send, with a website key's server key.
Partner › Shops and integrations › Server connection sets up, for each website key:
- Who sends a design to Meishi. The visitor (default): a design is prepared, and uses an experience, as soon as the visitor sends it. Your server: a sent design is
reservedand uses nothing until your server confirms it, for example when the order is placed. Designs nobody confirms expire after 14 days. A shop wants Your server. - A secret server key (
sk_live_…), shown once. Keep it on your server. - A webhook address with its signing secret (
whsec_…), also shown once. See Webhooks. - Delete experiences after 6, 12 or 24 months, or keep them (the default), to match your privacy policy.
A shop's flow
The visitor sends a design
Your page gets experienceId from the editor's complete event and adds it to the cart. If the server confirms designs, the experience is reserved, and experience.reserved reaches your webhook.
The order is placed: confirm it
curl -X POST https://api.public.meishi.cards/embed/server/experiences/<experienceId>/confirm \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"orderReference": "1001", "metadata": {"customerId": "42"}}'The design uses one experience and goes to processing. Confirming again changes nothing.
The order is cancelled: cancel it
curl -X POST https://api.public.meishi.cards/embed/server/experiences/<experienceId>/cancel \
-H "Authorization: Bearer sk_live_xxx"An unconfirmed experience is removed and uses nothing. A confirmed one stops working and stays counted.
It is ready: print it
experience.ready reaches your webhook with the experience in data. Print printPdfUrl or printImageUrl, or put qrSvgUrl on your own artwork. See Printing.
Out of experiences
When the company has no experiences left, confirm answers 402 with the code no_experience_credits, as before. The order is not lost: the experience stays reserved without an end (no reservedUntil), the owners and admins get one email a day, and Meishi confirms it by itself as soon as experiences are added (a pack, an automatic top-up, Partner renewing, or the monthly refill), oldest first. Your webhook then gets experience.ready as usual.
So on a 402 you can mark the order "waiting for Meishi" and do nothing else: calling confirm again later is safe, too.
When Partner ends
The server key keeps working for reading: list, look up and print your experiences to finish open orders. New sessions in the editor answer 402 plan_required.
Look them up
KEY="sk_live_your_server_key"
# Ready experiences, newest first. Pass nextCursor back as cursor for the next page.
curl "https://api.public.meishi.cards/embed/server/experiences?status=ready&limit=50" \
-H "Authorization: Bearer $KEY"
# By order
curl "https://api.public.meishi.cards/embed/server/experiences?orderReference=1001" \
-H "Authorization: Bearer $KEY"
# One experience: status, scan link, QR codes, print and your metadata
curl https://api.public.meishi.cards/embed/server/experiences/<experienceId> \
-H "Authorization: Bearer $KEY"The server key only sees experiences made through its own website key's organization. Replacing it, or deleting its website key, stops the old key at once.
See the API reference for every field and answer.