Collect a payment via invoice (orders use the same flow) using the Dollr API with reqwest and serde.
Invoices vs orders: These guides walk through invoices (formal billing, line items, publish). The collect flow is the same for orders — use /v1/orders/* instead of /v1/invoices/* and set source_type: "ORDER" on the checkout session. See Orders and Parties & counterparties.Hosted checkout: To skip party, invoice, session, and execute steps entirely, see Hosted checkout.
End-to-end invoice collection with reqwest and serde_json (add to Cargo.toml).
[dependencies]reqwest = { version = "0.12", features = ["json"] }serde = { version = "1", features = ["derive"] }serde_json = "1"tokio = { version = "1", features = ["macros", "rt-multi-thread"] }uuid = { version = "1", features = ["v4"] }
Load DOLLR_CLIENT_ID and DOLLR_CLIENT_SECRET from the environment (e.g. dotenvy).