Merchant docs only

DGEN Payments API Reference

Store-scoped API docs for checkout orders, products, payment links, wallets, GCash Android automation, public checkout helpers, and signed outbound webhooks.

Auth Store-scoped API keys
Scope Merchant endpoints only
Webhooks Signed delivery payloads
GCash Android app forwarder

Endpoint groups

Jump to the part you need.

These docs intentionally exclude internal platform, cron, global, and provider-webhook endpoints. This page only lists endpoints a merchant integration or customer checkout can use.

Authentication API KEY

All /api/v1/* endpoints require Authorization: Bearer pdgen_live_.... Use Idempotency-Key on create endpoints when retrying from your backend.

curl -H 'Authorization: Bearer pdgen_live_xxx' https://payments.decentralizedgen.com/api/v1/store

Store API v1 - store API KEY

Endpoint Used for Example
GET /api/v1/store Confirm auth and read store status, provider toggles, payout currency, and owner profile.
{ "id":"store_...", "status":"approved",
  "providers": { "stripe_enabled":true, "gcash_enabled":true },
  "owner": { "id":"usr_...", "email":"owner@example.com" } }

Store API v1 - orders API KEY

Endpoint Used for Example
POST /api/v1/orders Create a one-shot checkout order. Pass a product id or a custom amount. Supports Idempotency-Key, metadata, return/cancel URLs, and custom expiry.
{ "currency":"USD", "amount_minor":1999,
  "customer": { "email":"a@b.com", "name":"Alice", "phone":"+639..." },
  "metadata": { "reference":"invoice_123" } }
GET /api/v1/orders List orders. Filters: status, customer_email, product_id, payment_link_id, provider, from, to, limit.
{ "data":[{ "id":"ord_...", "status":"paid", "provider":"gcash" }], "limit":50 }
GET /api/v1/orders/:id Read one order including customer, product, link, fees, metadata, GCash, UPI, Stripe, and refunds.
{ "id":"ord_...", "provider":"gcash", "gcash": { "paid_minor":11248 } }
POST /api/v1/orders/:id/cancel Cancel a pending order.
{ "ok": true }
POST /api/v1/orders/:id/refund Refund all or part of a paid Stripe order. GCash is not refunded through this API because money goes to your own GCash account.
{ "amount_minor":500, "reason":"duplicate" }

Store API v1 - products API KEY

Endpoint Used for Example
GET /api/v1/products List products. Use ?archived=1 to include archived products.
{ "data":[{ "id":"prd_...", "name":"VIP", "prices":[...] }] }
POST /api/v1/products Create a product and auto-generate its permanent payment link.
{ "name":"VIP", "base_currency":"USD", "base_amount_minor":1999 }
GET /api/v1/products/:id Read one product. If its default link is missing, DGEN self-heals it.
{ "id":"prd_...", "payment_link": { "checkout_url":"https://..." } }
PATCH /api/v1/products/:id Update name, description, and price table.
{ "name":"VIP v2" }
POST /api/v1/products/:id/payment-link Get or create the product's default permanent payment link.
{ "id":"plk_...", "created":false, "checkout_url":"https://..." }

Store API v1 - user wallets API KEY

Endpoint Used for Example
POST /api/v1/wallets Create a per-customer wallet. Requires at least one of email, phone, or Discord id.
{ "name":"Juan", "email":"juan@example.com", "phone":"+639..." }
GET /api/v1/wallets List wallets for the store.
{ "data":[{ "id":"uwl_...", "gcash_balance_minor":0 }] }
GET /api/v1/wallets/:id Read one wallet.
{ "id":"uwl_...", "topup_link_id":"plk_..." }
GET /api/v1/wallets/:id/balance Read Stripe and GCash wallet balances plus top-up checkout URL.
{ "stripe": { "balance_minor":5000 }, "gcash": { "balance_minor":0 } }
GET /api/v1/wallets/:id/ledger Newest-first wallet ledger entries.
{ "data":[{ "kind":"topup_gcash", "delta_minor":1999 }] }

GCash Android app + notifications API KEY

The DGEN GCash Android app uses these endpoints after the merchant enters a Store API key and grants notification/background permissions.

Endpoint Used for Example
POST /api/v1/gcash/heartbeat Device heartbeat. Upserts the device row by store and hardware id.
{ "hwid":"abc123", "phone_number":"+639...",
  "device_model":"Pixel", "os_version":"Android",
  "app_version":"1.0.0" }
POST /api/v1/gcash/notifications Forward a receive notification. DGEN dedupes by dedupe_id, then matches exact amount or partial amount by phone.
{ "full_notification":"You received PHP 499.00...",
  "sender":"GCash", "from_number":"0917...", "amount":499,
  "reference_no":"0041073634750", "dedupe_id":"gcash-ref-0041073634750",
  "hwid":"abc123", "device_phone":"+639..." }
GET /api/v1/gcash/store-info Compatibility smoke test for the Android app. Redirects to /api/v1/store.
301 redirect
GET /api/v1/gcash/notifications Read recent inbound GCash notifications. Filter by match_type=exact|partial|unmatched.
{ "data":[{ "id":"gcn_...", "match_type":"exact" }] }
GET /api/v1/gcash/notifications/:id Read one notification row.
{ "id":"gcn_...", "reference_no":"004107..." }

Public checkout PUBLIC

Endpoint Used for Example
GET /api/checkout/:token Hydrate hosted checkout page state.
{ "kind":"order", "status":"pending", "available_providers":{...} }
GET /api/checkout/:token/quote?currency=EUR Currency quote for checkout currency selection.
{ "currency":"EUR", "amount_minor":1830, "fx_rate":0.929 }
POST /api/checkout/:token/customer Submit customer details for a one-shot order or permanent link visit.
{ "email":"a@b.com", "name":"Alice", "phone":"+639..." }
POST /api/checkout/:token/select-provider Choose stripe, crypto, gcash, or upi where available.
{ "provider":"gcash" }
POST /api/checkout/:token/intent Create/reuse Stripe PaymentIntent.
{ "client_secret":"pi_..._secret_..." }
GET /api/checkout/:token/status Poll paid/partial/failed status.
{ "status":"partial", "remaining_minor":5000 }
POST /api/checkout/:token/gcash-phone Save customer GCash phone for SMS matching.
{ "phone":"+639..." }
POST /api/checkout/:token/gcash-reconcile Checkout-side reconcile helper for GCash pending/partial orders.
{ "ok": true }
POST /api/checkout/:token/upi-utr Submit UPI UTR/reference for checkout-side tracking.
{ "utr":"123456789012" }
POST /api/checkout/:token/wallet-pay Pay from a customer wallet balance where available.
{ "wallet_id":"uwl_...", "balance":"gcash" }
POST /api/checkout/:token/reset-customer Clear customer details and provider.
{ "ok": true }
POST /api/checkout/:token/reset-provider Clear selected provider only.
{ "ok": true }
POST /api/checkout/:token/fail Mark expired checkout as failed after countdown.
{ "ok": true, "status":"failed" }

Outbound webhook payloads SIG

Configured merchant webhook URLs receive X-DGEN-Signature: t=<unix>,v1=<hmac>.

Endpoint Used for Example
order.paid Stripe, GCash, UPI, or wallet order captured. Includes metadata and top-level reference.
{ "event":"order.paid", "data":{ "order_id":"ord_...", "reference":"invoice_123" } }
order.refunded Refund total increased on a Stripe order.
{ "event":"order.refunded", "data":{ "order_id":"ord_...", "refunded_delta_minor":500 } }
order.failed Checkout expired or failed.
{ "event":"order.failed", "data":{ "order_id":"ord_...", "reason":"expired" } }
payout.sent A merchant payout request was marked sent.
{ "event":"payout.sent", "data":{ "payout_id":"pay_...", "amount_minor":50000 } }