Skip to content
API Reference|128 routes · 147 operations

Payment orchestration,one API.

One REST API for payments, subscriptions, installments, wallets, and reconciliation — over Payzone and Stripe. Licensed-only groups are marked Roadmap. Generated OpenAPI contract, JWT auth, HMAC-verified webhooks, and a typed TypeScript SDK.

create_payment_intent.ts
import { createCorpoPay, PaymentIntents } from '@corpopay/sdk';

const corpoPay = createCorpoPay({
  baseUrl: 'https://api.corpopay.site',
  apiKey: 'cp_live_…',
});

// Create a payment intent — one typed call
const { data } = await PaymentIntents.createPaymentIntent({
  client: corpoPay.client,
  body: {
    provider: 'STRIPE',
    amount: 250000, // 2,500.00 MAD
    currency: 'MAD',
    reference: 'INV-99281',
    description: 'Prepaid wallet top-up',
    returnUrl: 'https://app.corpopay.site/checkout/success'
  }
});

The complete surface, straight from the generated OpenAPI contract. All responses are typed and validated; money is integer centimes.

Authentication

Register a tenant, exchange credentials for a JWT, and mint scoped API keys.

POST/auth/registerCreate a tenant account
POST/auth/loginExchange email + password for a JWT
GET/auth/meFetch the current user
POST/auth/forgot-passwordRequest a password reset
POST/auth/reset-passwordReset the password
POST/api-keysCreate an API key (server-to-server)

Webhooks

Inbound provider events, HMAC-verified synchronously before they are processed.

POST/webhooks/stripeStripe events
POST/webhooks/vpsVPS / Payzone events
POST/webhooks/napsNAPS events

Payment intents

The server-to-server primitive for a one-time or pre-authorized charge.

POST/payment-intentsCreate a direct payment intent
GET/payment-intents/{id}Fetch an intent
GET/payment-intents/{id}/statusPoll the current status
POST/payment-intents/{id}/captureCapture a pre-authorized intent
POST/payment-intents/{id}/cancelCancel an intent

Transactions & refunds

Read every capture, and refund it — with the full ledger unwind posted automatically.

GET/transactionsList transactions
GET/transactions/{id}Fetch a transaction
POST/transactions/{id}/refundRefund a transaction

Wallets

Stored-value balances — top up, debit, refund, and adjust with signed MAD.

POST/walletsCreate a wallet
GET/wallets/{id}Fetch a wallet
POST/wallets/{id}/topupTop up a wallet
POST/wallets/{id}/debitDebit a wallet (pay-as-you-go)
POST/wallets/{id}/refundRefund into a wallet
POST/wallets/{id}/adjustSupport credit / adjustment

Subscriptions

Recurring billing with pause, resume, and a full event history.

GET/subscriptionsList subscriptions
GET/subscriptions/{id}Fetch a subscription
POST/subscriptions/{id}/pausePause billing
POST/subscriptions/{id}/resumeResume billing
GET/subscriptions/{id}/eventsList billing events

Installments

A down payment plus a fixed schedule — funded by the merchant.

POST/installment-plansCreate a plan
GET/installment-plansList plans
PATCH/installment-plans/{id}Update a plan
GET/installment-agreementsList agreements
POST/installment-agreements/{id}/cancelCancel an agreement

Marketplace splits

Roadmap

Split one payment across beneficiaries and the platform, with escrow release.

POST/split-partiesCreate a beneficiary
POST/split-rulesCreate a split rule
GET/splitsList splits
POST/splits/{id}/releaseRelease an escrowed split

Ledger

The double-entry record — nine accounts, always balanced.

GET/ledgerRead the tenant ledger

Payouts

Roadmap

Snapshot eligible funds into a payout, then settle it — MANUAL or STRIPE_CONNECT.

POST/payoutsSnapshot eligible funds into a payout
GET/payoutsList payouts
GET/payouts/{id}Fetch a payout
POST/payouts/{id}/processProcess (MANUAL / STRIPE_CONNECT)
POST/payouts/{id}/cancelCancel a payout

Fee schedules

Roadmap

Versioned, per-tenant fees — FLAT, PERCENTAGE, PER_METHOD, or TIERED.

POST/fee-schedulesCreate a fee schedule
GET/fee-schedulesList fee schedules
GET/fee-schedules/activeFetch the active schedule

Disputes & reversals

Roadmap

When a chargeback is lost, the money comes back — from available or reserve.

GET/disputesList disputes
GET/disputes/{id}Fetch a dispute
POST/disputes/{id}/resolveResolve a dispute

Settlement statements

Roadmap

Opening → closing balances, itemized by category, finalized into a tenant invoice.

POST/settlement-statementsCreate a statement
GET/settlement-statements/{id}Fetch a statement
POST/settlement-statements/{id}/finalizeFinalize a statement
POST/settlement-statements/{id}/voidVoid a statement

Reconciliation reports

Three-way match — provider report vs ledger vs payouts — surfaced as EXACT, AMOUNT_DIFF, or UNMATCHED.

POST/reconciliation-reportsCreate a report
POST/reconciliation-reports/{id}/runRun a three-way match
POST/reconciliation-reports/{id}/resolveResolve a difference

Admin

Super-admin surface — tenants, onboarding, risk, provider health, and manual payouts.

GET/admin/tenantsList tenants
PATCH/admin/tenants/{id}/statusUpdate tenant status
GET/admin/payments/searchSearch payments
GET/admin/provider-healthProvider health
POST/admin/payouts/{id}/executeManual payout (Morocco)

Conventions

Guarantees that hold across the whole surface.

Idempotency keys

Pass an idempotency key to retry safely — exactly-once money movement, even under replays.

HMAC-verified webhooks

Every webhook is signed and verified synchronously before processing, then deduped.

AES-256-GCM at rest

Provider credentials and card profiles are encrypted — never stored in plaintext.

Rate limits

Predictable headers let your application back off gracefully without surprise 429s.