Midtrans Subscription API

Recurring / subscription billing.

Operations 6

POST /v1/subscriptions Create a subscription #
GET /v1/subscriptions/{subscription_id} Get a subscription #
PATCH /v1/subscriptions/{subscription_id} Update a subscription #
POST /v1/subscriptions/{subscription_id}/enable Enable a subscription #
POST /v1/subscriptions/{subscription_id}/disable Disable a subscription #
POST /v1/subscriptions/{subscription_id}/cancel Cancel a subscription #

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-subscription-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-subscription-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Midtrans Payment Subscription 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: Subscription
  description: Recurring / subscription billing.
paths:
  /v1/subscriptions:
    post:
      operationId: createSubscription
      tags:
      - Subscription
      summary: Create a subscription
      description: Creates a recurring subscription against a saved card or GoPay token, with an amount, currency, payment_type, token, and a schedule (interval, interval_unit, start_time, max_interval).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionRequest'
      responses:
        '201':
          description: The created subscription.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/subscriptions/{subscription_id}:
    parameters:
    - $ref: '#/components/parameters/SubscriptionId'
    get:
      operationId: getSubscription
      tags:
      - Subscription
      summary: Get a subscription
      description: Retrieves a subscription by its ID.
      responses:
        '200':
          description: The subscription.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateSubscription
      tags:
      - Subscription
      summary: Update a subscription
      description: Updates the amount, schedule, or token of an existing subscription.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionRequest'
      responses:
        '200':
          description: The updated subscription.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /v1/subscriptions/{subscription_id}/enable:
    parameters:
    - $ref: '#/components/parameters/SubscriptionId'
    post:
      operationId: enableSubscription
      tags:
      - Subscription
      summary: Enable a subscription
      description: Re-enables a previously disabled subscription.
      responses:
        '200':
          description: Enable confirmation.
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/subscriptions/{subscription_id}/disable:
    parameters:
    - $ref: '#/components/parameters/SubscriptionId'
    post:
      operationId: disableSubscription
      tags:
      - Subscription
      summary: Disable a subscription
      description: Pauses a subscription so no further charges are made until it is re-enabled.
      responses:
        '200':
          description: Disable confirmation.
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/subscriptions/{subscription_id}/cancel:
    parameters:
    - $ref: '#/components/parameters/SubscriptionId'
    post:
      operationId: cancelSubscription
      tags:
      - Subscription
      summary: Cancel a subscription
      description: Permanently cancels a subscription.
      responses:
        '200':
          description: Cancel confirmation.
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Subscription:
      allOf:
      - $ref: '#/components/schemas/SubscriptionRequest'
      - type: object
        properties:
          id:
            type: string
          status:
            type: string
            enum:
            - active
            - inactive
    Error:
      type: object
      properties:
        status_code:
          type: string
        status_message:
          type: string
        id:
          type: string
    CustomerDetails:
      type: object
      properties:
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        phone:
          type: string
    SubscriptionSchedule:
      type: object
      properties:
        interval:
          type: integer
        interval_unit:
          type: string
          enum:
          - day
          - week
          - month
        max_interval:
          type: integer
        start_time:
          type: string
    SubscriptionRequest:
      type: object
      required:
      - name
      - amount
      - currency
      - payment_type
      - token
      - schedule
      properties:
        name:
          type: string
        amount:
          type: string
        currency:
          type: string
          enum:
          - IDR
        payment_type:
          type: string
          enum:
          - credit_card
          - gopay
        token:
          type: string
          description: Saved card token or GoPay token.
        schedule:
          $ref: '#/components/schemas/SubscriptionSchedule'
        metadata:
          type: object
          additionalProperties: true
        customer_details:
          $ref: '#/components/schemas/CustomerDetails'
  responses:
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    SubscriptionId:
      name: subscription_id
      in: path
      required: true
      description: The subscription identifier.
      schema:
        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.'