Stripe Payment to Dataverse Order and Receipt
When a Stripe payment succeeds, the flow records the order/payment in Dataverse, generates a branded PDF receipt, emails it to the customer, and posts a sales notification to Teams. Turns Stripe payments into governed order records with automatic receipting.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow turns successful Stripe payments into governed order records with automatic receipting. On a daily schedule it pulls the previous day's successful charges from the Stripe REST API, writes each one as a governed Stripe Order record in Dataverse, emails a branded HTML receipt to the customer via Outlook, and sends an internal sales notification to the finance team.
Why it matters: Payment data stuck in Stripe isn't in your system of record. Capturing every successful charge as a Dataverse order — with an automatic customer receipt and an internal alert — keeps finance, operations and customers aligned, and gives downstream automations (fulfillment, accounting, reporting) a clean order table to build on.
Status: Built · Ships Off (demo). Going live requires only: authorizing the two connections, setting the Stripe secret key env var, and (optionally) adjusting the company name / finance recipient.
Use Case
A business taking Stripe payments wants each successful payment logged in Dataverse as an order, the customer to receive a receipt automatically, and the finance team to be notified — without anyone copying data out of the Stripe dashboard.
Flow Architecture
Daily Poll For Stripe Payments
Recurrence (Day / 1, 07:00 UTC)Runs daily to find the prior day's successful Stripe charges.
Init varCorrelationId
Initialize Variableguid() stamped on all records/notifications for tracing.
Init varStripeBase
Initialize VariableStripe REST base URL from env var.
Init varCompanyName
Initialize VariableBrand name used in receipt + notification.
Init varFinanceEmail
Initialize VariableInternal sales-notification recipient.
Compose WindowStartUnix
ComposeUnix seconds for start of yesterday (inclusive bound).
Compose WindowEndUnix
ComposeUnix seconds for start of today (exclusive bound).
HTTP Get Stripe Charges
HTTP — GET /v1/chargesGET /v1/charges for the window, Bearer secret key.
Apply to each Charge
Foreach (sequential)Processes each returned charge one at a time.
Condition Payment Succeeded
Condition (If)Acts only when status = succeeded AND paid = true.
Compose Amount Display
ComposeConverts cents → major-unit decimal.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_StripeApiKey | String | sk_live_REPLACE_… | Stripe secret API key (Bearer auth) — replace with a real restricted key. |
| flowlibs_StripeApiBaseUrl | String | https://api.stripe.com/v1 | Stripe REST base URL. |
| flowlibs_CompanyName | String | FlowLibs Demo Co | Brand name shown on the receipt and the sales notification. |
| flowlibs_FinanceNotificationEmail | String | finance@flowlibs.local | Internal recipient of the sales notification. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| HTTP | http | GET /v1/charges |
| Microsoft Dataverse | shared_commondataserviceforapps | CreateRecord |
| Office 365 Outlook | shared_office365 | SendEmailV2 |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Switch to real-time
- Replace the daily Recurrence poll with a Stripe webhook receiver (HTTP Request trigger) once a Stripe connection/webhook is available; verify the webhook signature with a flowlibs_StripeWebhookSecret env var.
- Idempotency
- Before Create Order Record, list the Stripe Order table filtered on flowlibs_chargeid and skip if it already exists, to guard against re-processing.
- PDF receipts
- Add the Word Online connector (CreateFileItem → GetFilePDF) to attach a branded PDF instead of the HTML body.
- Tax/fulfillment
- Branch off the order record to trigger invoicing or shipping.
- Window/schedule
- Change the Recurrence frequency or the charge query window (created[gte]/created[lt]).
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Yesterday window (Unix sec, start)
Inclusive lower bound for the charge query window.
EXPR.02Amount (cents → major unit)
Convert Stripe's smallest currency unit to major units.
EXPR.03Charge date (Unix → ISO)
Convert the Unix charge timestamp to an ISO datetime.
EXPR.04Succeeded test
Gate that the charge actually succeeded and was paid.
EXPR.05Customer email (fallback chain)
Pick the best available customer email.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.