Challenges/ch-23-prepare-stripe-charge-payload-from-order-data
DataWeaveELEMENTARY

Prepare Stripe Charge Payload from Order Data

Stripe's Charges API requires the payment amount as an integer in the smallest currency unit (cents), but order management systems typically store amounts as decimal dollar values. In this challenge, you will transform a raw order payload into a valid Stripe charge request body, converting the decimal amount to integer cents and mapping order metadata into Stripe's `metadata` object. This is a foundational pattern any integration developer will encounter when connecting an e-commerce platform.

#stripe#rest-api
// READY TO BEGIN

Make it
count.

  • 2 attempts on every challenge
  • XP points & leaderboard scored
  • Public profile & shared trail
  • Newsletter weekly with API replay
// Built by practitioners

The fastest way
to learn integration.

Every challenge ships with a real-world payload, a graded test suite, and a walkthrough by a practitioner. No surface-level theory — just problems, solved.

Challenges
Modules
// You're reading in preview mode

You can read everything.
Coding requires an account.

🔒 IDE locked · sign in to enable
%dw 2.0
output application/json
---
payload
// Sign up to run, submit, and earn XP on this challenge
// Be first to rate this challenge!SCROLL TO READ ↓

The fastest way
to learn integration.

01.
Production payloads
Real CSV/JSON/XML you'll meet on day one — null fields, mixed casing, partial records.
02.
Design problems
What practitioners actually solve — null-safety, idempotency, retries, batch boundaries.
03.
Edge cases that break
Empty arrays, type coercion, deeply nested transforms, locale-specific dates.
CHALLENGES
MODULES
// Free forever · No credit card

Sign up.
Then code.

Free accounts get 3 attempts per challenge, full XP, and your trail progress synced across devices.

▶ Sign up freeHave an account? Sign in →
// WHAT YOU'LL BUILDHOW IT WORKS ↓
01.
Live DataWeave editor
Real DWL 2.0 IDE with helpers, modules, syntax highlighting.
02.
Test cases run on real runner
Same Go runner used in prod. Diffs show exactly which fields fail.
03.
3 graded attempts
Submit when you're ready. Score persists. Solution unlocks after pass or last attempt.
04.
Helpers & multi-module DWL
Bring in reusable %dw modules. Import, export, compose.
05.
XP & leaderboard
Points + XP awarded per challenge. Trail progress synced.
06.
Production-style payloads
Real CSV/JSON/XML — null fields, mixed casing, partial records.