{"openapi":"3.0.3","info":{"title":"NokosKilat Public API","version":"1.0.0","description":"API nomor virtual & OTP NokosKilat. Semua harga dalam IDR dan dipotong dari saldo akun Anda."},"servers":[{"url":"https://nokoskilat.com/api/v1"}],"security":[{"ApiKey":[]}],"paths":{"/balance":{"get":{"summary":"Saldo akun","responses":{"200":{"description":"Saldo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/countries":{"get":{"summary":"Daftar negara aktif","responses":{"200":{"description":"Negara","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/services":{"get":{"summary":"Daftar layanan per negara","parameters":[{"name":"country_id","in":"query","required":true,"schema":{"type":"integer"},"description":""}],"responses":{"200":{"description":"Layanan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/operators":{"get":{"summary":"Daftar operator","parameters":[{"name":"country_id","in":"query","required":true,"schema":{"type":"integer"},"description":""},{"name":"service_id","in":"query","required":true,"schema":{"type":"integer"},"description":""}],"responses":{"200":{"description":"Operator","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/products":{"get":{"summary":"Produk, stok & harga jual","parameters":[{"name":"country_id","in":"query","required":true,"schema":{"type":"integer"},"description":""},{"name":"service_id","in":"query","required":true,"schema":{"type":"integer"},"description":""},{"name":"operator_id","in":"query","required":false,"schema":{"type":"integer"},"description":""}],"responses":{"200":{"description":"Produk","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/orders":{"get":{"summary":"Riwayat pesanan","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Pesanan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Buat pesanan OTP","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["country_id","service_id","product_id"],"properties":{"country_id":{"type":"integer"},"service_id":{"type":"integer"},"product_id":{"type":"integer"},"operator_id":{"type":"integer","nullable":true}}}}}},"responses":{"200":{"description":"Replay pesanan (200); balance adalah saldo saat respons dibaca","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"201":{"description":"Pesanan dibuat. data.balance adalah snapshot saldo IDR setelah pembuatan; null bila saldo belum dapat dibaca. Retry dengan key yang sama tidak memotong saldo lagi.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreatedEnvelope"}}}},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/orders/{id}":{"get":{"summary":"Status pesanan","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Pesanan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/orders/{id}/cancel":{"post":{"summary":"Batalkan pesanan","description":"Pembatalan dibuka minimal 3 menit (180 detik) setelah pembelian, selama OTP belum masuk dan pesanan dapat dibatalkan. Periksa can_cancel dan cancel_available_at bila tersedia. Refund dicatat sekali.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Dibatalkan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/servers":{"get":{"summary":"Status Server 1–5","responses":{"200":{"description":"Server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/servers/{n}/countries":{"get":{"summary":"Negara Server 2–5","parameters":[{"name":"n","in":"path","required":true,"schema":{"type":"integer","enum":[2,3,4,5]}}],"responses":{"200":{"description":"Negara","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/servers/{n}/services":{"get":{"summary":"Layanan Server 2–5","parameters":[{"name":"n","in":"path","required":true,"schema":{"type":"integer","enum":[2,3,4,5]}},{"name":"country_id","in":"query","required":true,"schema":{"type":"integer"},"description":""}],"responses":{"200":{"description":"Layanan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/servers/{n}/products":{"get":{"summary":"Produk Server 2–5 (Server 2: service_id, Server 3–5: service)","parameters":[{"name":"n","in":"path","required":true,"schema":{"type":"integer","enum":[2,3,4,5]}},{"name":"country_id","in":"query","required":true,"schema":{"type":"integer"},"description":""},{"name":"service_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Server 2"},{"name":"service","in":"query","required":false,"schema":{"type":"string"},"description":"Server 3–5, mis. wa"}],"responses":{"200":{"description":"Produk","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/servers/{n}/orders":{"post":{"summary":"Buat pesanan Server 2–5","parameters":[{"name":"n","in":"path","required":true,"schema":{"type":"integer","enum":[2,3,4,5]}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["country_id","product_id"],"additionalProperties":false,"properties":{"country_id":{"type":"integer"},"service_id":{"type":"integer","description":"Server 2"},"service":{"type":"string","description":"Server 3–5"},"product_id":{"type":"integer"}}}}}},"responses":{"200":{"description":"Pesanan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"201":{"description":"Pesanan dibuat. data.balance adalah snapshot saldo IDR setelah pembuatan; null bila saldo belum dapat dibaca. Retry dengan key yang sama tidak memotong saldo lagi.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreatedEnvelope"}}}},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/email/offers":{"get":{"summary":"Email OTP: domain & harga","description":"site adalah situs tujuan verifikasi, bukan domain inbox. Tanpa site memakai telegram.com. Nama singkat telegram dinormalisasi menjadi telegram.com. Pilih domain dan product_id dari penawaran berstok; gunakan site yang sama saat membeli.","parameters":[{"name":"site","in":"query","required":false,"schema":{"type":"string","maxLength":80,"default":"telegram.com","example":"telegram"}}],"responses":{"200":{"description":"Offers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/email/orders":{"post":{"summary":"Email OTP: buat pesanan","description":"Ambil domain dan product_id dari GET /email/offers untuk site yang sama. site wajib; nama singkat dinormalisasi menjadi .com. Domain gmail.com hanya dapat dipilih bila tersedia di penawaran, bukan jaminan stok Gmail.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["site","domain","product_id"],"additionalProperties":false,"properties":{"site":{"type":"string","maxLength":80,"example":"telegram.com"},"domain":{"type":"string"},"product_id":{"type":"integer"}}}}}},"responses":{"200":{"description":"Pesanan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"201":{"description":"Pesanan dibuat. data.balance adalah snapshot saldo IDR setelah pembuatan; null bila saldo belum dapat dibaca. Retry dengan key yang sama tidak memotong saldo lagi.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreatedEnvelope"}}}},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/orders/{id}/finish":{"post":{"summary":"Selesaikan pesanan Server 2–5","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Selesai","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/otp/{order_id}":{"get":{"summary":"Ambil OTP","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OTP","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Envelope":{"type":"object","properties":{"ok":{"type":"boolean"},"data":{}}},"OrderCreatedEnvelope":{"type":"object","required":["ok","data"],"properties":{"ok":{"type":"boolean","example":true},"data":{"type":"object","required":["id","balance"],"additionalProperties":true,"properties":{"id":{"type":"string","format":"uuid"},"price":{"type":"number"},"balance":{"type":"number","nullable":true,"description":"Snapshot saldo IDR saat respons dibuat, bukan saldo terkunci per pesanan. null bila pembacaan gagal.","example":6400}}}}},"Error":{"type":"object","properties":{"ok":{"type":"boolean","example":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}