{"openapi":"3.0.3","info":{"title":"lautbit Connect","description":"API lautbit","version":"1.0.0"},"servers":[{"url":"https://lautbit.my.id"}],"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"paths":{"/api/v1/ping":{"get":{"summary":"Check API access","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Blocked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service under maintenance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/balance":{"get":{"summary":"Get account balance","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","enum":["IDR"]},"balance":{"type":"integer"}},"required":["currency","balance"]}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Blocked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service under maintenance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products":{"get":{"summary":"List products","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}},"required":["products"]}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Blocked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service under maintenance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/catalog":{"get":{"summary":"List products (alias)","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}},"required":["products"]}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Blocked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service under maintenance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products/{id}":{"get":{"summary":"Get a product","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"product":{"$ref":"#/components/schemas/Product"}},"required":["product"]}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Blocked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service under maintenance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/orders":{"get":{"summary":"List recent orders","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}},"required":["orders"]}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Blocked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service under maintenance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/orders/{id}":{"get":{"summary":"Get an order","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"}},"required":["order"]}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Blocked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service under maintenance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/order":{"post":{"summary":"Purchase a variant using balance","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{12,100}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variant_id":{"type":"integer","minimum":1},"quantity":{"type":"integer","minimum":1,"maximum":10},"unit_price":{"type":"integer","minimum":1},"promo_code":{"type":"string","pattern":"^[A-Za-z0-9_-]{3,32}$"},"expected_total":{"type":"integer","minimum":1,"description":"Reject the order if the final amount in IDR differs."}},"required":["variant_id","quantity","unit_price"]}}}},"responses":{"200":{"description":"Existing order","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"}},"required":["order"]}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"}},"required":["order"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Blocked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service under maintenance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/topup":{"post":{"summary":"Create a QRIS balance top-up","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{12,100}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"integer","minimum":1000,"maximum":10000000,"description":"Top-up amount in IDR (active server minimum may be higher)."},"method":{"type":"string","enum":["gopay","shopeepay"]}},"required":["amount"]}}}},"responses":{"200":{"description":"Existing order","content":{"application/json":{"schema":{"type":"object","properties":{"topup":{"type":"object","properties":{"transaction_id":{"type":"string"},"amount":{"type":"integer","minimum":1},"payable":{"type":"integer","minimum":1},"method":{"type":"string"},"status":{"type":"string"},"qr_string":{"type":"string","nullable":true},"expires_in":{"type":"integer","minimum":0}},"required":["transaction_id","amount","payable","method","status","qr_string","expires_in"]}},"required":["topup"]}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"topup":{"type":"object","properties":{"transaction_id":{"type":"string"},"amount":{"type":"integer","minimum":1},"payable":{"type":"integer","minimum":1},"method":{"type":"string"},"status":{"type":"string"},"qr_string":{"type":"string","nullable":true},"expires_in":{"type":"integer","minimum":0}},"required":["transaction_id","amount","payable","method","status","qr_string","expires_in"]}},"required":["topup"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Blocked account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service under maintenance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"Order":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"quantity":{"type":"integer"},"total":{"type":"integer","minimum":1},"method":{"type":"string"},"status":{"type":"string"},"created":{"type":"integer","format":"int64","description":"Unix timestamp in milliseconds."},"delivered":{"type":"boolean"},"promo_code":{"type":"string"},"discount":{"type":"integer"}},"required":["id","label","quantity","total","method","status","created","delivered"]},"Product":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"active":{"type":"integer"},"sold":{"type":"integer"},"terms":{"type":"string","nullable":true},"termsDetails":{"type":"object","additionalProperties":{"type":"string"}},"category_id":{"type":"integer","nullable":true},"category":{"type":"string","nullable":true},"photo_url":{"type":"string","nullable":true},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"product_id":{"type":"integer"},"name":{"type":"string"},"price":{"type":"integer","minimum":1},"available":{"type":"integer"},"active":{"type":"integer"}},"required":["id","product_id","name","price","available","active"]}}},"required":["id","name","description","active","sold","terms","termsDetails","category_id","category","photo_url","variants"]}}}}