跳到主要内容
ArcBlock Community

Webhook Notification Help for Restaurant Order System"

Twelve
支持
payment-kitdiscussionresolved

Hey team,

I’m currently working on a digital food menu for a customer’s website — it’s a saloon and restaurant. I’ve already built the cart and checkout flow using Payment Kit, and everything’s working great.

Now I’m trying to figure out the best way to trigger a notification (email or SMS) when an order is completed. I see the checkout.session.completed webhook event in the dashboard, but I’m unsure how to actually connect that to a notification system.

Can you point me toward best practices for using this webhook? Ideally I’d like to either:

  • Send an email with order info
  • Or log the order to a Google Sheet and trigger an email/SMS from there

Appreciate any guidance you can give — just want to make sure I’m approaching this the right way.

Thanks!

5 条回复

Xiao Fang12个月前

In fact, currently, upon completion of a purchase, a notification of successful purchase will be sent to the user, as shown in the figure below. If you need to set up your own event listening to send notifications, we need to integrate the payment kit SDK to listen and implement the corresponding logic ourselves.

Relevant documents:

payment kit sdk: Webhooks

If you need to send other notifications by yourself, you can refer to Notifications: Blocklet SDK (Node.js)

image.png

Twelve12个月前(edited)

Thank you i. we got a working webhook live on our custom storefront using Payment Kit and Pages Kit. It’s now sending seller-side alerts via Google Apps Script on successful orders. Super grateful for how smooth the tools are and how fast y’all respond.

Appreciate everything you’re building!

Twelve12个月前

z1bAK3mpzKC3Au3FjLtChyC47DWGtttHm6c Hi team,

When a customer completes checkout with Payment Kit (using cart + price IDs), the webhook we receive seems to only contain a checkout.session object (cs_...). That object doesn’t include invoice number, totals, or item details.

However, the printable PDF clearly has all of this info (invoice number, line items, subtotal, payment date, etc).

Can you clarify:

  1. Should our webhook also receive an invoice.paid event (with the full invoice data), or is that not currently fired when using cart checkout?
  2. If invoice events aren’t sent, what’s the recommended way to get the same invoice data we see in the PDF into our webhook handler (invoice number, totals, payment method, items)?

Thanks, 12 Inch Apps

Xiao Fang12个月前

If the user has purchased a one-time bill, we can certainly obtain the bill information by listening to invoice.paid.

The supported event types include:

javascriptCopy
checkout.session.completed
checkout.session.nft_minted

payment_intent.succeeded
payment_intent.payment_failed

invoice.paid
refund.succeeded

customer.subscription.created
customer.subscription.started
customer.subscription.renewed
customer.subscription.upgraded
customer.subscription.updated
customer.subscription.deleted
customer.subscription.paused
customer.subscription.resumed
customer.subscription.past_due
customer.subscription.recovered
customer.subscription.renew_failed

customer.subscription.trial_start
customer.subscription.trial_will_end
customer.subscription.trial_end

manual.notification

customer.credit_grant.granted
customer.credit.low_balance
customer.credit_grant.depleted
customer.credit.insufficient
Twelve12个月前

z1bAK3mpzKC3Au3FjLtChyC47DWGtttHm6c Thank you for the response. I was able to extract the information that I needed.

回复