Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for PayPal Agentic Commerce Studio: Policy-Gated Order Ledger
Inspiration
Agentic commerce requires strict financial invariants: floating-point rounding bugs, duplicate order captures on network retries, or unapproved autonomous captures above policy limits can cause real monetary loss.
What it does
PayPal Agentic Commerce Studio (paypal_agent_studio) combines the official APIMatic-generated paypal-server-sdk==2.4.0 with a deterministic financial policy engine:
- APIMatic SDK Integration (
OrdersController): UsesClientCredentialsAuthCredentials,Environment.SANDBOX, andTelemetryResponseCatcher(HttpCallBack) to capture full HTTP telemetry. - Exact Integer Minor-Unit Policy Gate: Rejects float currency amounts, enforces merchant category allowlists (
software_saas,cloud_compute,office_supplies), auto-captures orders<= $50.00, and holds$50.01-$200.00inPENDING_HUMAN_APPROVALuntil a single-use human approval token is verified. - Deterministic UUIDv5
PayPal-Request-Id& SHA-256 Audit Ledger: Guarantees idempotent retries and cryptographic tamper evidence across the full order lifecycle.
Verification & Testing
- Unit Tests:
9 passed(pytest -q, including APIMaticOrdersController+ policy gate tests) - Demo Video:
submission_assets/demo_video.mp4(1920x1080, 150s, H.264/AAC)
Project Overview
PayPal Agentic Commerce Studio combines the official APIMatic-generated PayPal Python Server SDK (paypalserversdk) with an idempotent integer-cents order ledger, Channel3 catalog discovery, SSRF-hardened KERNEL price verification, Human-in-the-Loop (HITL) cryptographic approval tokens, and AG Grid telemetry export.
- Public GitHub Repository: https://github.com/cal29292929/paypal-agent-studio
- Author: Kazutoshi Hayashi
- License: MIT
Multi-Model Pipeline Provenance
- Stage 1 — Architecture Design (claude-opus-5-5): DESIGN_OPUS55.md
- Stage 2 — Adversarial Architecture Review (gpt-6-luna): REVIEW_LUNA56.md
- Stage 3 — Core Implementation (Kimi-K2.7-Code @ Sakura AI Engine): paypal_agent_studio/
- Stage 4 — Post-Implementation Code Review (gpt-6-luna): CODE_REVIEW_LUNA56.md
Quickstart
PYTHONPATH=. pytest -v
PYTHONPATH=. python3 -m paypal_agent_studio.cli
Log in or sign up for Devpost to join the conversation.