{
    "openapi": "3.1.0",
    "info": {
        "title": "H2H IndoTopup API",
        "version": "1.0.0",
        "description": "API top up game & produk digital H2H IndoTopup. Autentikasi: Authorization: Bearer <kunci> (itp_test_… untuk simulasi, itp_live_… untuk order sungguhan). Webhook ditandatangani HMAC-SHA256 (header H2H-Signature)."
    },
    "servers": [
        {
            "url": "https://h2h.indotopup.com"
        }
    ],
    "security": [
        {
            "Bearer": []
        }
    ],
    "tags": [
        {
            "name": "Akun"
        },
        {
            "name": "Katalog"
        },
        {
            "name": "Order"
        },
        {
            "name": "Batch"
        },
        {
            "name": "Cek Pemain"
        },
        {
            "name": "Webhook"
        }
    ],
    "paths": {
        "/api/v1/account": {
            "get": {
                "operationId": "account",
                "summary": "Info akun",
                "description": "Profil, mode kunci yang dipakai (test/live), saldo, level, dan batas. Cara tercepat memastikan kunci dan IP kamu benar.",
                "tags": [
                    "Akun"
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "id": "56f64556-373d-47a1-9d2b-0c5e8f1a77b2",
                                    "object": "account",
                                    "name": "Toko Contoh",
                                    "email": "mitra@contoh.id",
                                    "mode": "test",
                                    "live_enabled": false,
                                    "balance": 250000,
                                    "currency": "IDR",
                                    "level": {
                                        "code": "starter",
                                        "name": "Starter",
                                        "rate_limit_per_minute": 100,
                                        "max_ip_rules": 5
                                    },
                                    "volume_30d": 1250000,
                                    "webhook_url": "https://toko.contoh.id/h2h/webhook",
                                    "created_at": "2026-10-02T03:00:00Z"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/catalog/brands": {
            "get": {
                "operationId": "brands",
                "summary": "Daftar brand",
                "description": "Brand yang punya produk. Dibatasi 30 request/menit untuk semua endpoint katalog; simpan katalog di sisimu dan sinkronkan berkala.",
                "tags": [
                    "Katalog"
                ],
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "standard | fallback",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "id": 696,
                                            "object": "brand",
                                            "name": "Lords Mobile",
                                            "slug": "lords-mobile",
                                            "category": "Game",
                                            "types": [
                                                "standard"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/catalog/products": {
            "get": {
                "operationId": "products",
                "summary": "Daftar produk",
                "description": "Produk dengan harga untuk level akunmu dan field isian yang menempel (fields). Produk fallback (type=fallback) wajib memakai max_price saat dipesan.",
                "tags": [
                    "Katalog"
                ],
                "parameters": [
                    {
                        "name": "brand",
                        "in": "query",
                        "required": false,
                        "description": "ID atau slug brand.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "standard | fallback",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Cari nama produk.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Jumlah item (1–200).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "Salin paging.next_after dari halaman sebelumnya.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "code": "P12319",
                                            "object": "product",
                                            "type": "standard",
                                            "name": "67 Diamonds",
                                            "brand": {
                                                "id": 696,
                                                "name": "Lords Mobile",
                                                "slug": "lords-mobile",
                                                "image": "https://indotopup.com/assets/upload/melostore/brand-696.webp"
                                            },
                                            "price": 10207,
                                            "price_max": null,
                                            "requires_max_price": false,
                                            "available": true,
                                            "fields": [
                                                {
                                                    "key": "id",
                                                    "label": "User ID",
                                                    "type": "text",
                                                    "required": true,
                                                    "in": "target"
                                                }
                                            ]
                                        }
                                    ],
                                    "paging": {
                                        "limit": 25,
                                        "has_more": true,
                                        "next_after": "MTIzNDU="
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/catalog/products/{code}": {
            "get": {
                "operationId": "product",
                "summary": "Detail produk",
                "description": "Satu produk berdasarkan kode.",
                "tags": [
                    "Katalog"
                ],
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "description": "Kode produk, mis. P12319.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "code": "P12319",
                                    "object": "product",
                                    "type": "standard",
                                    "name": "67 Diamonds",
                                    "price": 10207,
                                    "available": true
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "404": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/orders": {
            "post": {
                "operationId": "order-fallback",
                "summary": "Buat order fallback",
                "description": "Produk fallback (kode F…) mencoba jalur termurah dulu lalu pindah jalur bila gagal. Kirim max_price sebagai batas harga; biaya akhir tidak pernah melebihinya dan selisihnya dikembalikan.",
                "tags": [
                    "Order"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "product": {
                                        "type": "string",
                                        "description": "Kode produk fallback (F…)."
                                    },
                                    "target": {
                                        "type": "object",
                                        "description": "ID pemain."
                                    },
                                    "reference": {
                                        "type": "string",
                                        "description": "Referensi unik."
                                    },
                                    "max_price": {
                                        "type": "integer",
                                        "description": "Batas harga maksimal (≥ harga saat ini)."
                                    }
                                },
                                "required": [
                                    "product",
                                    "target",
                                    "reference",
                                    "max_price"
                                ]
                            },
                            "example": {
                                "product": "F3345",
                                "target": {
                                    "id": "123456789",
                                    "zone": "1234"
                                },
                                "reference": "order-0002",
                                "max_price": 25000
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "product": {
                                        "code": "F3345",
                                        "name": "Mobile Legends (ID) - 86 Diamond",
                                        "type": "fallback"
                                    },
                                    "amount": 25000,
                                    "max_price": 25000,
                                    "id": "ord_k3x9m2v7q1a8c5d0e4f6",
                                    "object": "order",
                                    "reference": "order-0001",
                                    "status": "processing",
                                    "target": {
                                        "id": "123456789",
                                        "zone": null,
                                        "extra": {}
                                    },
                                    "serial": null,
                                    "failure": null,
                                    "mode": "test",
                                    "channel": "api",
                                    "batch": null,
                                    "webhook": {
                                        "status": "pending",
                                        "attempts": 0
                                    },
                                    "verification": null,
                                    "created_at": "2026-10-19T08:12:44Z",
                                    "completed_at": null
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "product": {
                                        "code": "F3345",
                                        "name": "Mobile Legends (ID) - 86 Diamond",
                                        "type": "fallback"
                                    },
                                    "amount": 25000,
                                    "max_price": 25000,
                                    "id": "ord_k3x9m2v7q1a8c5d0e4f6",
                                    "object": "order",
                                    "reference": "order-0001",
                                    "status": "processing",
                                    "target": {
                                        "id": "123456789",
                                        "zone": null,
                                        "extra": {}
                                    },
                                    "serial": null,
                                    "failure": null,
                                    "mode": "test",
                                    "channel": "api",
                                    "batch": null,
                                    "webhook": {
                                        "status": "pending",
                                        "attempts": 0
                                    },
                                    "verification": null,
                                    "created_at": "2026-10-19T08:12:44Z",
                                    "completed_at": null
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Galat (lihat error.code)"
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "402": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            },
            "get": {
                "operationId": "order-list",
                "summary": "Daftar order",
                "description": "Order terbaru lebih dulu.",
                "tags": [
                    "Order"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "queued | processing | succeeded | failed",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "mode",
                        "in": "query",
                        "required": false,
                        "description": "test | live",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal/waktu awal (ISO 8601).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal/waktu akhir.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Jumlah item (1–200).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "Salin paging.next_after dari halaman sebelumnya.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "status": "succeeded",
                                            "serial": "ABCD-1",
                                            "id": "ord_k3x9m2v7q1a8c5d0e4f6",
                                            "object": "order",
                                            "reference": "order-0001",
                                            "product": {
                                                "code": "P12319",
                                                "name": "Lords Mobile - 67 Diamonds",
                                                "type": "standard"
                                            },
                                            "target": {
                                                "id": "123456789",
                                                "zone": null,
                                                "extra": {}
                                            },
                                            "amount": 10207,
                                            "max_price": null,
                                            "failure": null,
                                            "mode": "test",
                                            "channel": "api",
                                            "batch": null,
                                            "webhook": {
                                                "status": "pending",
                                                "attempts": 0
                                            },
                                            "verification": null,
                                            "created_at": "2026-10-19T08:12:44Z",
                                            "completed_at": null
                                        }
                                    ],
                                    "paging": {
                                        "limit": 25,
                                        "has_more": true,
                                        "next_after": "MTIzNDU="
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/orders/{id}": {
            "get": {
                "operationId": "order-get",
                "summary": "Detail order",
                "description": "Ambil order lewat ID atau reference. serial berisi kode voucher/serial bila ada; failure terisi bila gagal (saldo dikembalikan otomatis).",
                "tags": [
                    "Order"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID order (ord_…) atau reference milikmu.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "status": "succeeded",
                                    "serial": "ABCD-EFGH-1234",
                                    "mode": "live",
                                    "webhook": {
                                        "status": "delivered",
                                        "attempts": 1
                                    },
                                    "completed_at": "2026-10-19T08:13:02Z",
                                    "id": "ord_k3x9m2v7q1a8c5d0e4f6",
                                    "object": "order",
                                    "reference": "order-0001",
                                    "product": {
                                        "code": "P12319",
                                        "name": "Lords Mobile - 67 Diamonds",
                                        "type": "standard"
                                    },
                                    "target": {
                                        "id": "123456789",
                                        "zone": null,
                                        "extra": {}
                                    },
                                    "amount": 10207,
                                    "max_price": null,
                                    "failure": null,
                                    "channel": "api",
                                    "batch": null,
                                    "verification": null,
                                    "created_at": "2026-10-19T08:12:44Z"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "404": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/orders/{id}/verification": {
            "post": {
                "operationId": "order-verify",
                "summary": "Kirim kode verifikasi",
                "description": "Sebagian order meminta kode dari pembeli: order.verification.state = \"required\" dan can_submit = true. Kirim kodenya di sini. 202 hanya berarti kode diterima untuk diproses, bukan bukti valid. Kode sama dikirim ulang mengembalikan hasil sebelumnya; kode berbeda ditolak 409. Batas 5 request/menit per order.",
                "tags": [
                    "Order"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID order (ord_…) atau reference milikmu.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "code": {
                                        "type": "string",
                                        "description": "Kode dari pembeli, 1–128 karakter."
                                    },
                                    "action_id": {
                                        "type": "string",
                                        "description": "verification.id terbaru."
                                    },
                                    "version": {
                                        "type": "integer",
                                        "description": "verification.version terbaru."
                                    }
                                },
                                "required": [
                                    "code"
                                ]
                            },
                            "example": {
                                "code": "482913"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "verification": {
                                        "id": "aaaaaaaa-0000-4000-8000-000000000001",
                                        "type": "two_factor",
                                        "state": "submitted",
                                        "version": 2,
                                        "message": "Kode diterima dan menunggu diproses.",
                                        "can_submit": false,
                                        "updated_at": "2026-10-19T08:20:00Z"
                                    },
                                    "id": "ord_k3x9m2v7q1a8c5d0e4f6",
                                    "object": "order",
                                    "reference": "order-0001",
                                    "status": "processing",
                                    "product": {
                                        "code": "P12319",
                                        "name": "Lords Mobile - 67 Diamonds",
                                        "type": "standard"
                                    },
                                    "target": {
                                        "id": "123456789",
                                        "zone": null,
                                        "extra": {}
                                    },
                                    "amount": 10207,
                                    "max_price": null,
                                    "serial": null,
                                    "failure": null,
                                    "mode": "test",
                                    "channel": "api",
                                    "batch": null,
                                    "webhook": {
                                        "status": "pending",
                                        "attempts": 0
                                    },
                                    "created_at": "2026-10-19T08:12:44Z",
                                    "completed_at": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "404": {
                        "description": "Galat (lihat error.code)"
                    },
                    "409": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/batches": {
            "post": {
                "operationId": "batch-create",
                "summary": "Buat batch",
                "description": "Satu produk standar, satu tujuan, 1–100 order berurutan. Seluruh biaya dipotong di muka dan harga dikunci. reference unik; kirim ulang request identik mengembalikan batch asli, request berbeda dengan reference sama ditolak 409.",
                "tags": [
                    "Batch"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "product": {
                                        "type": "string",
                                        "description": "Kode produk dari katalog (P… standar, F… fallback)."
                                    },
                                    "target": {
                                        "type": "object",
                                        "description": "ID pemain / nomor tujuan."
                                    },
                                    "reference": {
                                        "type": "string",
                                        "description": "Referensi batch unik."
                                    },
                                    "count": {
                                        "type": "integer",
                                        "description": "Jumlah order, 1–100."
                                    }
                                },
                                "required": [
                                    "product",
                                    "target",
                                    "reference",
                                    "count"
                                ]
                            },
                            "example": {
                                "product": "P12319",
                                "target": {
                                    "id": "123456789"
                                },
                                "reference": "batch-0001",
                                "count": 3
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "status": "queued",
                                    "progress": {
                                        "succeeded": 0,
                                        "failed": 0,
                                        "processing": 0,
                                        "queued": 3,
                                        "remaining": 3
                                    },
                                    "id": "bat_p8w2n6t1y4h7j3k9s5d0",
                                    "object": "batch",
                                    "reference": "batch-0001",
                                    "product": {
                                        "code": "P12319",
                                        "name": "Lords Mobile - 67 Diamonds"
                                    },
                                    "target": {
                                        "id": "123456789",
                                        "zone": null,
                                        "extra": {}
                                    },
                                    "count": 3,
                                    "unit_amount": 10207,
                                    "total_amount": 30621,
                                    "mode": "live",
                                    "channel": "api",
                                    "invoice_available": false,
                                    "created_at": "2026-10-19T08:12:44Z",
                                    "completed_at": null
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "status": "queued",
                                    "progress": {
                                        "succeeded": 0,
                                        "failed": 0,
                                        "processing": 0,
                                        "queued": 3,
                                        "remaining": 3
                                    },
                                    "id": "bat_p8w2n6t1y4h7j3k9s5d0",
                                    "object": "batch",
                                    "reference": "batch-0001",
                                    "product": {
                                        "code": "P12319",
                                        "name": "Lords Mobile - 67 Diamonds"
                                    },
                                    "target": {
                                        "id": "123456789",
                                        "zone": null,
                                        "extra": {}
                                    },
                                    "count": 3,
                                    "unit_amount": 10207,
                                    "total_amount": 30621,
                                    "mode": "live",
                                    "channel": "api",
                                    "invoice_available": false,
                                    "created_at": "2026-10-19T08:12:44Z",
                                    "completed_at": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "402": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "409": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            },
            "get": {
                "operationId": "batch-list",
                "summary": "Daftar batch",
                "description": "Batch terbaru lebih dulu.",
                "tags": [
                    "Batch"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "queued | processing | completed | partially_failed | failed",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Awal (ISO 8601).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Akhir.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Jumlah item (1–200).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "Salin paging.next_after dari halaman sebelumnya.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "id": "bat_p8w2n6t1y4h7j3k9s5d0",
                                            "object": "batch",
                                            "reference": "batch-0001",
                                            "status": "processing",
                                            "product": {
                                                "code": "P12319",
                                                "name": "Lords Mobile - 67 Diamonds"
                                            },
                                            "target": {
                                                "id": "123456789",
                                                "zone": null,
                                                "extra": {}
                                            },
                                            "count": 3,
                                            "unit_amount": 10207,
                                            "total_amount": 30621,
                                            "progress": {
                                                "succeeded": 1,
                                                "failed": 0,
                                                "processing": 1,
                                                "queued": 1,
                                                "remaining": 2
                                            },
                                            "mode": "live",
                                            "channel": "api",
                                            "invoice_available": false,
                                            "created_at": "2026-10-19T08:12:44Z",
                                            "completed_at": null
                                        }
                                    ],
                                    "paging": {
                                        "limit": 25,
                                        "has_more": false,
                                        "next_after": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/batches/{id}": {
            "get": {
                "operationId": "batch-get",
                "summary": "Progres batch",
                "description": "Status dan hitungan progres.",
                "tags": [
                    "Batch"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID batch (bat_…) atau reference milikmu.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "id": "bat_p8w2n6t1y4h7j3k9s5d0",
                                    "object": "batch",
                                    "reference": "batch-0001",
                                    "status": "processing",
                                    "product": {
                                        "code": "P12319",
                                        "name": "Lords Mobile - 67 Diamonds"
                                    },
                                    "target": {
                                        "id": "123456789",
                                        "zone": null,
                                        "extra": {}
                                    },
                                    "count": 3,
                                    "unit_amount": 10207,
                                    "total_amount": 30621,
                                    "progress": {
                                        "succeeded": 1,
                                        "failed": 0,
                                        "processing": 1,
                                        "queued": 1,
                                        "remaining": 2
                                    },
                                    "mode": "live",
                                    "channel": "api",
                                    "invoice_available": false,
                                    "created_at": "2026-10-19T08:12:44Z",
                                    "completed_at": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "404": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/batches/{id}/orders": {
            "get": {
                "operationId": "batch-orders",
                "summary": "Order di dalam batch",
                "description": "Order anak berurutan (field sequence), masing-masing dengan ID sendiri.",
                "tags": [
                    "Batch"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID batch (bat_…) atau reference milikmu.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Jumlah item (1–200).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "Salin paging.next_after dari halaman sebelumnya.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "channel": "batch",
                                            "batch": "bat_p8w2n6t1y4h7j3k9s5d0",
                                            "status": "succeeded",
                                            "serial": "ABCD-1",
                                            "id": "ord_k3x9m2v7q1a8c5d0e4f6",
                                            "object": "order",
                                            "reference": "order-0001",
                                            "product": {
                                                "code": "P12319",
                                                "name": "Lords Mobile - 67 Diamonds",
                                                "type": "standard"
                                            },
                                            "target": {
                                                "id": "123456789",
                                                "zone": null,
                                                "extra": {}
                                            },
                                            "amount": 10207,
                                            "max_price": null,
                                            "failure": null,
                                            "mode": "test",
                                            "webhook": {
                                                "status": "pending",
                                                "attempts": 0
                                            },
                                            "verification": null,
                                            "created_at": "2026-10-19T08:12:44Z",
                                            "completed_at": null,
                                            "sequence": 1
                                        }
                                    ],
                                    "paging": {
                                        "limit": 25,
                                        "has_more": false,
                                        "next_after": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "404": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/batches/{id}/invoice": {
            "get": {
                "operationId": "batch-invoice",
                "summary": "Invoice batch (PDF)",
                "description": "Satu PDF ringkasan biaya dan refund setelah semua order selesai. 409 bila belum selesai atau batch uji. Respons sukses berupa berkas application/pdf.",
                "tags": [
                    "Batch"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID batch (bat_…) atau reference milikmu.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil"
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "404": {
                        "description": "Galat (lihat error.code)"
                    },
                    "409": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/lookups/games": {
            "get": {
                "operationId": "lookup-games",
                "summary": "Game yang bisa dicek",
                "description": "Daftar kode game dan kebutuhan zona. Publik, tanpa kunci.",
                "tags": [
                    "Cek Pemain"
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "code": "mobile-legends",
                                            "name": "Mobile Legends",
                                            "needs_zone": true,
                                            "zones": null,
                                            "available": true
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/lookups/quota": {
            "get": {
                "operationId": "lookup-quota",
                "summary": "Jatah & tarif cek pemain",
                "description": "Jatah gratis harian dan tarif tambahan. Publik. Cek pemain dan cek batas pembelian memakai jatah yang sama; reset pukul 00:00 UTC.",
                "tags": [
                    "Cek Pemain"
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "quota_plan",
                                    "free_per_day": 40,
                                    "free_per_minute": 5,
                                    "paid_price": 1,
                                    "paid_per_minute": 20,
                                    "resets_at": "00:00 UTC"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/lookups/player": {
            "post": {
                "operationId": "lookup-player",
                "summary": "Cek nama pemain",
                "description": "Validasi ID pemain sebelum order. Hasil ditemukan maupun tidak ditemukan memakai jatah. 404 akun tidak ada, 402 saldo kurang untuk cek berbayar, 429 jatah habis.",
                "tags": [
                    "Cek Pemain"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "game": {
                                        "type": "string",
                                        "description": "Kode game dari /lookups/games."
                                    },
                                    "id": {
                                        "type": "string",
                                        "description": "ID akun pemain."
                                    },
                                    "zone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Server/zona bila diwajibkan."
                                    }
                                },
                                "required": [
                                    "game",
                                    "id"
                                ]
                            },
                            "example": {
                                "game": "mobile-legends",
                                "id": "123456789",
                                "zone": "1234"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "player",
                                    "game": "mobile-legends",
                                    "id": "123456789",
                                    "zone": "1234",
                                    "name": "Budi",
                                    "region": "ID",
                                    "quota": {
                                        "charged": 0,
                                        "free_remaining_today": 39,
                                        "lookup_id": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "402": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "404": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    },
                    "502": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/lookups/purchase-limit/mobile-legends": {
            "post": {
                "operationId": "lookup-ml",
                "summary": "Batas pembelian Mobile Legends",
                "description": "Cek apakah paket mingguan/double diamond sudah mencapai batas pembelian. Memakai jatah yang sama dengan cek pemain.",
                "tags": [
                    "Cek Pemain"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string",
                                        "description": "ID akun."
                                    },
                                    "zone": {
                                        "type": "string",
                                        "description": "Zona."
                                    }
                                },
                                "required": [
                                    "id",
                                    "zone"
                                ]
                            },
                            "example": {
                                "id": "123456789",
                                "zone": "1234"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "purchase_limit",
                                    "game": "mobile-legends",
                                    "id": "123456789",
                                    "zone": "1234",
                                    "name": "Budi",
                                    "weekly_pass": {
                                        "limit_reached": false,
                                        "items": []
                                    },
                                    "double_diamonds": {
                                        "eligible": true,
                                        "items": []
                                    },
                                    "quota": {
                                        "charged": 0,
                                        "free_remaining_today": 38,
                                        "lookup_id": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "402": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "404": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    },
                    "502": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        },
        "/api/v1/webhooks/test": {
            "post": {
                "operationId": "webhook-test",
                "summary": "Kirim webhook uji",
                "description": "Mengirim event webhook.test bertanda tangan ke Webhook URL-mu, supaya penerimamu bisa diuji tanpa membuat order. Isi Webhook URL dan buat rahasia webhook di dashboard terlebih dulu.",
                "tags": [
                    "Webhook"
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "object": "webhook_test",
                                    "delivered": true,
                                    "http_status": 200,
                                    "error": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Galat (lihat error.code)"
                    },
                    "403": {
                        "description": "Galat (lihat error.code)"
                    },
                    "422": {
                        "description": "Galat (lihat error.code)"
                    },
                    "429": {
                        "description": "Galat (lihat error.code)"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "Bearer": {
                "type": "http",
                "scheme": "bearer",
                "description": "Kunci API: itp_test_… atau itp_live_…"
            }
        }
    }
}