Midtrans

Midtrans is an Indonesian payment gateway (part of the GoTo Group, alongside Gojek) that lets businesses accept online payments across cards, bank transfer / virtual accounts, e-wallets (GoPay, ShopeePay, QRIS), over-the-counter outlets, and cardless credit. It exposes Snap - a hosted / drop-in checkout - and a Core API for building custom checkout flows (charge, status, cancel, expire, refund, and card / GoPay tokenization), plus Payment Link, recurring Subscriptions, and Iris for disbursements / payouts. All APIs are REST over HTTPS with separate production (api.midtrans.com) and sandbox environments, authenticated with a Server Key over HTTP Basic (key as username, empty password); a public Client Key is used for browser-side card tokenization.

Midtrans publishes 7 APIs on the APIs.io network, including Card Tokenization API, Core API API, GoPay Tokenization API, and 4 more. Tagged areas include Payments, Payment Gateway, Indonesia, Southeast Asia, and Snap.

Midtrans’ developer surface includes authentication, documentation, engineering blog, and 8 more developer resources.

36.4/100 thin ▬ flat Agent 48/100 agent ready Full breakdown ↓
scored 2026-07-23 · rubric v0.5
AccessFreemiumSelf serve⚡ Free to try
7 APIs
PaymentsPayment GatewayIndonesiaSoutheast AsiaSnapE-WalletVirtual AccountCardsBank TransferFintech

Kin Score

Kin Score Kin Score How this is scored →
scored 2026-07-23 · rubric v0.5
Composite quality — 36.4/100 · thin
Contract Quality 14.5 / 25
Developer Ergonomics 4.3 / 20
Commercial Clarity 7.9 / 20
Operational Transparency 4.8 / 13
Governance 0.0 / 12
Discoverability 6.8 / 10
Agent readiness — 48/100 · agent ready
Machine-Readable Contract 18 / 18
Agentic Access Contract 15 / 15
MCP Server 0 / 12
Machine-Readable Auth 10 / 10
Idempotency 0 / 9
Stable Error Semantics 0 / 8
Request/Response Examples 0 / 7
Rate-Limit Signaling 7 / 7
Typed Event Surface 0 / 6
Agent Skills 0 / 5
Well-Known Catalog 0 / 4
Consent & Bot Identity 0 / 3
Improve this rating by publishing the missing artifacts — every area above can be raised, and the full rubric is at apis.io/rating/. This rating is computed from github.com/api-evangelist/midtrans: open an issue to ask a question, or submit a pull request to add artifacts. Want it done for you? Prioritized profiling — $2,500 →

APIs 7

Individual APIs this provider publishes, each with its own machine-readable definition.

Midtrans Card Tokenization API

Client-key card token and card registration (browser-side).

Midtrans Core API API

Charge and manage the lifecycle of a transaction.

Midtrans GoPay Tokenization API

Bind and read a customer's GoPay account.

Midtrans Iris Disbursement API

Payouts, beneficiaries, balance, and account validation.

Midtrans Payment Link API

Create, read, and delete shareable payment links.

Midtrans Snap API

Hosted / drop-in checkout session creation.

Midtrans Subscription API

Recurring / subscription billing.

Scroll for all 7

Open Collections 1

Open, tool-agnostic API collections (OpenAPI-derived and Bruno).

Midtrans Payment API

OPEN COLLECTION

Pricing Plans 1

Published pricing tiers and plan structures.

Rate Limits 1

Documented rate limits and quota policies.

Midtrans Rate Limits

4 limits

RATE LIMITS

FinOps 1

Cost, billing, and metering signals for API financial operations.

Security Posture 2

Authentication, domain security, vulnerability disclosure, and trust-center signals.

Midtrans Authentication

http/apiKey · 3 schemes

SECURITY

Midtrans Domain Security

TLSv1.3 · HSTS · DMARC

SECURITY

Agentic Access 1

Recommended x-agentic-access execution contracts for AI agents.

Midtrans Agentic Access

33 operations · 21 acting · 1 human-in-the-loop

33 operations · 21 acting

AGENTIC

Resources

Documentation 1

Reference material describing how the API behaves

Agent Surfaces 1

MCP servers, agent skills, and machine-readable catalogs

Build 1

SDKs, sample code, and the tooling you integrate with

Access & Security 2

Authentication, authorization, and security posture

Operate 1

Status, limits, changes, and where to get help

Commercial 2

Pricing, plans, and the legal terms of use

Company 3

The organization behind the API

Source (apis.yml)

apis.yml Raw ↑
opencollection: 1.0.0
info:
  name: Midtrans Payment API
  version: '1.0'
request:
  auth:
    type: basic
    username: '{{serverKey}}'
    password: ''
items:
- info:
    name: Snap
    type: folder
  items:
  - info:
      name: Create Snap transaction.
      type: http
    http:
      method: POST
      url: https://app.sandbox.midtrans.com/snap/v1/transactions
      body:
        type: json
        data: "{\n  \"transaction_details\": { \"order_id\": \"order-101\", \"gross_amount\": 44000 }\n}"
    docs: Creates a Snap checkout session and returns a token and redirect_url. Production host app.midtrans.com.
- info:
    name: Core API
    type: folder
  items:
  - info:
      name: Charge transaction.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v2/charge
      body:
        type: json
        data: "{\n  \"payment_type\": \"bank_transfer\",\n  \"bank_transfer\": { \"bank\": \"bca\" },\n  \"transaction_details\"\
          : { \"order_id\": \"order-101\", \"gross_amount\": 44000 }\n}"
    docs: Charges a transaction for the chosen payment_type. Production host api.midtrans.com.
  - info:
      name: Get transaction status.
      type: http
    http:
      method: GET
      url: https://api.sandbox.midtrans.com/v2/:order_id/status
      params:
      - name: order_id
        value: order-101
        type: path
        description: order_id or transaction_id.
    docs: Retrieves the latest status of a transaction.
  - info:
      name: Approve transaction.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v2/:order_id/approve
      params:
      - name: order_id
        value: order-101
        type: path
        description: order_id or transaction_id.
    docs: Approves a card transaction flagged with a fraud challenge status.
  - info:
      name: Deny transaction.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v2/:order_id/deny
      params:
      - name: order_id
        value: order-101
        type: path
        description: order_id or transaction_id.
    docs: Denies a card transaction flagged with a fraud challenge status.
  - info:
      name: Cancel transaction.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v2/:order_id/cancel
      params:
      - name: order_id
        value: order-101
        type: path
        description: order_id or transaction_id.
    docs: Cancels a transaction before it settles.
  - info:
      name: Expire transaction.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v2/:order_id/expire
      params:
      - name: order_id
        value: order-101
        type: path
        description: order_id or transaction_id.
    docs: Immediately expires a pending transaction.
  - info:
      name: Refund transaction.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v2/:order_id/refund
      params:
      - name: order_id
        value: order-101
        type: path
        description: order_id or transaction_id.
      body:
        type: json
        data: "{\n  \"refund_key\": \"ref-101\",\n  \"amount\": 44000,\n  \"reason\": \"Customer request\"\n}"
    docs: Refunds a settled transaction, fully or partially.
  - info:
      name: Online direct refund.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v2/:order_id/refund/online/direct
      params:
      - name: order_id
        value: order-101
        type: path
        description: order_id or transaction_id.
      body:
        type: json
        data: "{\n  \"refund_key\": \"ref-101\",\n  \"amount\": 44000,\n  \"reason\": \"Customer request\"\n}"
    docs: Performs a direct online refund for supported channels (GoPay, QRIS, ShopeePay).
- info:
    name: Card Tokenization
    type: folder
  items:
  - info:
      name: Get card token.
      type: http
    http:
      method: GET
      url: https://api.sandbox.midtrans.com/v2/token
      auth:
        type: none
      params:
      - name: client_key
        value: '{{clientKey}}'
        type: query
        description: Public Client Key.
      - name: card_number
        value: '4811111111111114'
        type: query
      - name: card_exp_month
        value: '12'
        type: query
      - name: card_exp_year
        value: '2026'
        type: query
      - name: card_cvv
        value: '123'
        type: query
    docs: Exchanges card data for a one-time token_id. Uses the public Client Key, not the Server Key.
  - info:
      name: Register card.
      type: http
    http:
      method: GET
      url: https://api.sandbox.midtrans.com/v2/card/register
      auth:
        type: none
      params:
      - name: client_key
        value: '{{clientKey}}'
        type: query
        description: Public Client Key.
      - name: card_number
        value: '5211111111111117'
        type: query
      - name: card_exp_month
        value: '12'
        type: query
      - name: card_exp_year
        value: '2026'
        type: query
    docs: Registers (saves) a card for one-click / two-click and recurring use.
- info:
    name: GoPay Tokenization
    type: folder
  items:
  - info:
      name: Create pay account.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v2/pay/account
      body:
        type: json
        data: "{\n  \"payment_type\": \"gopay\",\n  \"gopay_partner\": { \"phone_number\": \"81234567890\", \"country_code\"\
          : \"62\", \"redirect_url\": \"https://example.com/callback\" }\n}"
    docs: Links a customer's GoPay account and returns activation actions.
  - info:
      name: Get pay account.
      type: http
    http:
      method: GET
      url: https://api.sandbox.midtrans.com/v2/pay/account/:account_id
      params:
      - name: account_id
        value: ''
        type: path
        description: The linked pay account id.
    docs: Retrieves a linked GoPay account's status and payment tokens.
- info:
    name: Payment Link
    type: folder
  items:
  - info:
      name: Create payment link.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v1/payment-links
      body:
        type: json
        data: "{\n  \"transaction_details\": { \"order_id\": \"order-link-101\", \"gross_amount\": 44000 },\n  \"usage_limit\"\
          : 1\n}"
    docs: Creates a shareable hosted payment page for an order.
  - info:
      name: Get payment link.
      type: http
    http:
      method: GET
      url: https://api.sandbox.midtrans.com/v1/payment-links/:order_id
      params:
      - name: order_id
        value: order-link-101
        type: path
        description: The payment link order_id.
    docs: Retrieves a payment link's details and payment status.
  - info:
      name: Delete payment link.
      type: http
    http:
      method: DELETE
      url: https://api.sandbox.midtrans.com/v1/payment-links/:order_id
      params:
      - name: order_id
        value: order-link-101
        type: path
        description: The payment link order_id.
    docs: Deletes a payment link.
- info:
    name: Subscription
    type: folder
  items:
  - info:
      name: Create subscription.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v1/subscriptions
      body:
        type: json
        data: "{\n  \"name\": \"MONTHLY_2026\",\n  \"amount\": \"44000\",\n  \"currency\": \"IDR\",\n  \"payment_type\": \"\
          credit_card\",\n  \"token\": \"<saved_token_id>\",\n  \"schedule\": { \"interval\": 1, \"interval_unit\": \"month\"\
          , \"max_interval\": 12 }\n}"
    docs: Creates a recurring subscription on a saved card or GoPay token.
  - info:
      name: Get subscription.
      type: http
    http:
      method: GET
      url: https://api.sandbox.midtrans.com/v1/subscriptions/:subscription_id
      params:
      - name: subscription_id
        value: ''
        type: path
        description: The subscription id.
    docs: Retrieves a subscription by its ID.
  - info:
      name: Update subscription.
      type: http
    http:
      method: PATCH
      url: https://api.sandbox.midtrans.com/v1/subscriptions/:subscription_id
      params:
      - name: subscription_id
        value: ''
        type: path
        description: The subscription id.
      body:
        type: json
        data: "{\n  \"amount\": \"55000\"\n}"
    docs: Updates the amount, schedule, or token of a subscription.
  - info:
      name: Enable subscription.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v1/subscriptions/:subscription_id/enable
      params:
      - name: subscription_id
        value: ''
        type: path
        description: The subscription id.
    docs: Re-enables a disabled subscription.
  - info:
      name: Disable subscription.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v1/subscriptions/:subscription_id/disable
      params:
      - name: subscription_id
        value: ''
        type: path
        description: The subscription id.
    docs: Pauses a subscription until re-enabled.
  - info:
      name: Cancel subscription.
      type: http
    http:
      method: POST
      url: https://api.sandbox.midtrans.com/v1/subscriptions/:subscription_id/cancel
      params:
      - name: subscription_id
        value: ''
        type: path
        description: The subscription id.
    docs: Permanently cancels a subscription.
- info:
    name: Iris Disbursement
    type: folder
  items:
  - info:
      name: Ping.
      type: http
    http:
      method: GET
      url: https://app.sandbox.midtrans.com/iris/api/v1/ping
    docs: Health check that returns pong. Iris uses its own creator/approver API key.
  - info:
      name: List beneficiaries.
      type: http
    http:
      method: GET
      url: https://app.sandbox.midtrans.com/iris/api/v1/beneficiaries
    docs: Lists saved beneficiaries.
  - info:
      name: Create beneficiary.
      type: http
    http:
      method: POST
      url: https://app.sandbox.midtrans.com/iris/api/v1/beneficiaries
      body:
        type: json
        data: "{\n  \"name\": \"Budi\",\n  \"account\": \"0611101146\",\n  \"bank\": \"bca\",\n  \"alias_name\": \"budi01\"\
          ,\n  \"email\": \"budi@example.com\"\n}"
    docs: Creates a new beneficiary.
  - info:
      name: Update beneficiary.
      type: http
    http:
      method: PATCH
      url: https://app.sandbox.midtrans.com/iris/api/v1/beneficiaries/:alias_name
      params:
      - name: alias_name
        value: budi01
        type: path
        description: The beneficiary alias.
      body:
        type: json
        data: "{\n  \"name\": \"Budi Update\",\n  \"account\": \"0611101146\",\n  \"bank\": \"bca\",\n  \"alias_name\": \"\
          budi01\",\n  \"email\": \"budi@example.com\"\n}"
    docs: Updates an existing beneficiary by alias_name.
  - info:
      name: Create payouts.
      type: http
    http:
      method: POST
      url: https://app.sandbox.midtrans.com/iris/api/v1/payouts
      body:
        type: json
        data: "{\n  \"payouts\": [ { \"beneficiary_name\": \"Budi\", \"beneficiary_account\": \"0611101146\", \"beneficiary_bank\"\
          : \"bca\", \"amount\": \"100000\", \"notes\": \"Vendor payout\" } ]\n}"
    docs: Creates one or more payouts (Creator role).
  - info:
      name: Approve payouts.
      type: http
    http:
      method: POST
      url: https://app.sandbox.midtrans.com/iris/api/v1/payouts/approve
      body:
        type: json
        data: "{\n  \"reference_nos\": [\"a3f47c8b\"]\n}"
    docs: Approves requested payouts (Approver role).
  - info:
      name: Reject payouts.
      type: http
    http:
      method: POST
      url: https://app.sandbox.midtrans.com/iris/api/v1/payouts/reject
      body:
        type: json
        data: "{\n  \"reference_nos\": [\"a3f47c8b\"],\n  \"reject_reason\": \"Wrong account\"\n}"
    docs: Rejects requested payouts (Approver role).
  - info:
      name: Get payout details.
      type: http
    http:
      method: GET
      url: https://app.sandbox.midtrans.com/iris/api/v1/payouts/:reference_no
      params:
      - name: reference_no
        value: ''
        type: path
        description: The payout reference number.
    docs: Retrieves the details and status of a single payout.
  - info:
      name: Get balance.
      type: http
    http:
      method: GET
      url: https://app.sandbox.midtrans.com/iris/api/v1/balance
    docs: Returns the current Iris account balance.
  - info:
      name: List bank accounts.
      type: http
    http:
      method: GET
      url: https://app.sandbox.midtrans.com/iris/api/v1/bank_accounts
    docs: Lists registered bank accounts (facilitator scheme).
  - info:
      name: Validate bank account.
      type: http
    http:
      method: GET
      url: https://app.sandbox.midtrans.com/iris/api/v1/account_validation
      params:
      - name: bank
        value: bca
        type: query
        description: Bank code.
      - name: account
        value: '0611101146'
        type: query
        description: Destination account number.
    docs: Validates a bank account and returns the account holder name.
bundled: true