Midtrans Card Tokenization API

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

Operations 2

GET /v2/token Get a one-time card token #
GET /v2/card/register Register (save) a card #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/midtrans-card-tokenization-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

midtrans-card-tokenization-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Midtrans Payment Card Tokenization API
  description: A representative OpenAPI description of the Midtrans payment platform, an Indonesian payment gateway (part of the GoTo Group).
  version: '1.0'
  contact:
    name: Midtrans
    url: https://midtrans.com
  license:
    name: Proprietary
    url: https://midtrans.com
servers:
- url: https://api.midtrans.com
  description: Core API / Payment Link / Subscription - Production
- url: https://api.sandbox.midtrans.com
  description: Core API / Payment Link / Subscription - Sandbox
security:
- serverKeyAuth: []
tags:
- name: Card Tokenization
  description: Client-key card token and card registration (browser-side).
paths:
  /v2/token:
    get:
      operationId: getCardToken
      tags:
      - Card Tokenization
      summary: Get a one-time card token
      description: Exchanges raw card data (or a saved `token_id`) for a one-time `token_id` used by the Core API charge. Authenticated with the public Client Key passed as the `client_key` query parameter - this endpoint is called from the browser so raw PAN never touches the merchant server.
      security: []
      parameters:
      - name: client_key
        in: query
        required: true
        description: The merchant's public Client Key.
        schema:
          type: string
      - name: card_number
        in: query
        required: false
        schema:
          type: string
      - name: card_exp_month
        in: query
        required: false
        schema:
          type: string
      - name: card_exp_year
        in: query
        required: false
        schema:
          type: string
      - name: card_cvv
        in: query
        required: false
        schema:
          type: string
      - name: token_id
        in: query
        required: false
        description: A previously saved token to re-tokenize with a CVV.
        schema:
          type: string
      responses:
        '200':
          description: A one-time card token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardToken'
  /v2/card/register:
    get:
      operationId: registerCard
      tags:
      - Card Tokenization
      summary: Register (save) a card
      description: Registers a card for one-click / two-click and recurring use, returning a `saved_token_id`. Authenticated with the public Client Key query parameter.
      security: []
      parameters:
      - name: client_key
        in: query
        required: true
        schema:
          type: string
      - name: card_number
        in: query
        required: true
        schema:
          type: string
      - name: card_exp_month
        in: query
        required: true
        schema:
          type: string
      - name: card_exp_year
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A saved card token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardToken'
components:
  schemas:
    CardToken:
      type: object
      properties:
        status_code:
          type: string
        token_id:
          type: string
        saved_token_id:
          type: string
        hash:
          type: string
  securitySchemes:
    serverKeyAuth:
      type: http
      scheme: basic
      description: 'HTTP Basic authentication. Your Server Key is the username and the password is empty, so the header is `Authorization: Basic base64(SERVER_KEY:)`. Iris disbursement uses the same HTTP Basic scheme but with its own creator / approver API key.'