Webhooks
Let Meishi tell your server when an experience is reserved, ready or has failed.
Instead of polling, give a key a webhook address. Meishi then POSTs a JSON event to it whenever something happens to an experience made with that key.
Set one up
- Meishi API: Partner › API and webhooks › your key › Webhook and retention.
- Website integration: Partner › Shops and integrations › your key › Server connection.
Enter an https:// address on your server and create a signing secret (whsec_…). The secret is shown once: store it with your other secrets. Then send a test event from the same place to check your address.
Events
| Type | When | Sent for |
|---|---|---|
experience.ready | The experience is ready and its QR code works. | Both APIs |
experience.failed | It could not be prepared. data.processingError says why. | Both APIs |
experience.reserved | A visitor sent a design and it waits for your confirm. | Website keys whose server confirms designs |
ping | You sent a test from the portal. No data. | Both APIs |
More types may be added: answer 2xx to any type you do not handle.
The payload
POST /your-meishi-webhook HTTP/1.1
Content-Type: application/json
User-Agent: Meishi-Webhooks/1
Meishi-Signature: t=1762773241,v1=5d2f8c…
{
"id": "evt_9b1e44c0a7d2f3e8b6c15a90",
"type": "experience.ready",
"createdAt": 1762773241,
"data": {
"experienceId": "3f1c9a52-7d4e-4b8a-9e21-5c6d0f8b2a17",
"status": "ready",
"scanUrl": "https://ar.meishi.cards/bgbikHGrcA",
"printPdfUrl": "https://api.public.meishi.cards/embed/print/bgbikHGrcA.pdf",
"orderReference": "1001"
}
}Prop
Type
data is the full experience object.
Delivery
- Answer with any
2xxstatus within 5 seconds. Do slow work (downloading the print, emailing the customer) after you answer, for example in a job queue. - Meishi tries up to 3 times, about 1 and 3 seconds apart. It tries again only after a timeout, a network error, a
5xxor a429. Any other answer, including4xxand redirects (which are not followed), ends the delivery. - An event sent again keeps its
id, and the same outcome can arrive twice. Handle eachidonce. - Events can arrive out of order. When the order matters, go by the experience's
statusor fetch it fresh. - Webhooks are best effort. If your server was down, the API still answers the same: list experiences by
statusto catch up.
Security
Always check the signature before you trust an event. Your webhook address is public, and anyone could post to it.