{"openapi":"3.1.0","info":{"title":"Midtrans (BYOK) API","version":"0.1.0","description":"Midtrans (BYOK) lets an AI assistant read your own Midtrans data through the Midtrans API with a key you supply (server key (production)). Read-only: 5 tools (get_transaction_status, get_balance_mutation, get_subscription, get_invoice, get_card_bin_info). The BYOK key travels with each request, is used for that one call only and is never stored, logged or cached; it is only ever sent to...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-midtrans.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-midtrans/docs"},"termsOfService":"https://connectorbay.com/byok-midtrans/terms"},"servers":[{"url":"https://byok-midtrans.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-midtrans/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/get_transaction_status":{"post":{"operationId":"get_transaction_status","summary":"Get the status of one transaction by merchant order id or Midtrans transaction id: payment type, status, fraud status, g","description":"Get the status of one transaction by merchant order id or Midtrans transaction id: payment type, status, fraud status, gross amount, bank and refunds. The masked card and signature are not returned. Use for \"What is the status of Midtrans order example-1424936368\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"order_id":{"description":"Your order id, or the Midtrans transaction id (use the transaction id for DANA and BI-SNAP payments).","maxLength":200,"title":"Order Id","type":"string"}},"required":["order_id"],"title":"get_transaction_statusArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_balance_mutation":{"post":{"operationId":"get_balance_mutation","summary":"Get balance mutations for a currency over a time window: opening and closing effective, pending and overall balance, per","description":"Get balance mutations for a currency over a time window: opening and closing effective, pending and overall balance, per wallet source. Useful for reconciliation. Use for \"What was my Midtrans opening and closing balance for the first half of March\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"currency":{"description":"Currency code, for example IDR.","maxLength":3,"title":"Currency","type":"string"},"start_time":{"description":"Start of the window, ISO 8601 with offset, for example 2026-03-02T00:00:00+07:00.","maxLength":200,"title":"Start Time","type":"string"},"end_time":{"description":"End of the window, ISO 8601 with offset, for example 2026-03-16T23:59:59+07:00.","maxLength":200,"title":"End Time","type":"string"}},"required":["currency","start_time","end_time"],"title":"get_balance_mutationArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_subscription":{"post":{"operationId":"get_subscription","summary":"Get one recurring-payment subscription by id: name, amount, currency, status, schedule and payment type. Customer detail","description":"Get one recurring-payment subscription by id: name, amount, currency, status, schedule and payment type. Customer details and the card token are not returned. Use for \"Show Midtrans subscription d98a63b8-97e4-4059-825f-0f62340407e9\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"subscription_id":{"description":"Subscription id returned when it was created.","maxLength":200,"title":"Subscription Id","type":"string"}},"required":["subscription_id"],"title":"get_subscriptionArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_invoice":{"post":{"operationId":"get_invoice","summary":"Get one Midtrans invoice or quotation by invoice id: number, status, dates, amount, items and taxes. Customer contact de","description":"Get one Midtrans invoice or quotation by invoice id: number, status, dates, amount, items and taxes. Customer contact details are not returned. Use for \"What is the status of Midtrans invoice 65e7e8e657389830d04836fc\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"invoice_id":{"description":"Invoice id (the 'id' field of the invoice, not the order id).","maxLength":200,"title":"Invoice Id","type":"string"}},"required":["invoice_id"],"title":"get_invoiceArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_card_bin_info":{"post":{"operationId":"get_card_bin_info","summary":"Look up what a card BIN (the first 6 or 8 digits only) is: issuing country, card network, credit or debit, class and ban","description":"Look up what a card BIN (the first 6 or 8 digits only) is: issuing country, card network, credit or debit, class and bank. Never pass a full card number. Use for \"Which bank issued cards starting with 45563300 in Midtrans\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"bin_number":{"description":"First 6 or 8 digits of a card, digits only.","maxLength":200,"title":"Bin Number","type":"string"}},"required":["bin_number"],"title":"get_card_bin_infoArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}