Stripe receipts

After Checkout finishes, your server posts the receipt to Pigeon. The Stripe App Marketplace review is submitted from the Stripe Dashboard.

What sends today

Verify the domain you will put in From, and create a sending key. Keep that key on the server that already receives Stripe webhooks. The Stripe secret and the webhook signing secret stay on that same server. Mail uses the Pigeon key.

Listen for checkout.session.completed. Read the customer email from customer_details.email. Check the Stripe-Signature header on the raw body before you trust the event. Stripe delivers the same event again when the first response is slow, so skip a Checkout session id you have already posted.

JavaScript
const event = stripe.webhooks.constructEvent(rawBody, signature, webhookSecret);

if (event.type === "checkout.session.completed") {
  const session = event.data.object;
  const email = session.customer_details && session.customer_details.email;
  if (!email) return;

  await fetch("https://pigeonfs.com/api/emails", {
    method: "POST",
    headers: {
      Authorization: "Bearer " + process.env.PIGEON_API_KEY,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      from: "Billing <billing@yourdomain.com>",
      to: [email],
      subject: "Your receipt",
      html: "<p>Thanks for the order.</p>"
    })
  });
}

A 401 means the Pigeon key is wrong. A 403 with domain_not_verified means From is not a verified domain. The message shows in Emails once Pigeon accepts it. A paid subscription can use the same POST when the invoice is paid.

The marketplace review

A Stripe App is a separate install inside the Stripe Dashboard. Publishing it is a review you submit from that Dashboard: one app on the account, an English listing, an icon, screenshots, a privacy policy, a support contact, and a test login. Stripe reads the submission, and a person publishes it after the review. A Connect platform account cannot publish that listing. Pigeon billing uses Checkout on the Pigeon account, which is separate from an app a merchant installs.

Stripe Workflows can call an HTTPS action that sends mail. That action type is in a private preview. A published action would call this same POST /api/emails. Until that preview is open and the Dashboard review is published, the receipt path above is the one a merchant can run.

The send call Verify the From domain