{"openapi":"3.1.0","info":{"title":"Api","version":"0.0.1"},"paths":{"/api/v1/payments":{"post":{"tags":["payments"],"operationId":"payments.create","parameters":[],"security":[{"apiKey":[]}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["payment"]},"status":{"type":"string","enum":["pending","confirming","partially_paid","paid","expired"]},"order_id":{"type":"string"},"amount":{"type":"string"},"currency":{"type":"string","enum":["IDR","USD"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"redirect_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"payment_url":{"type":"string"},"amount_received":{"type":"string"},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"expires_at":{"type":"string"},"created_at":{"type":"string"},"payments":{"type":"array","items":{"type":"object","properties":{"method":{"type":"string","enum":["wallet","deposit"]},"chain":{"type":"string","enum":["ethereum","base"]},"token":{"type":"string","enum":["ETH","WETH","USDT","USDC"]},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"string"},"network_fee":{"type":"string"},"value":{"type":"string"},"confirmed":{"type":"boolean"},"tx_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"payer":{"anyOf":[{"type":"string"},{"type":"null"}]},"deposit_address":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["method","chain","token","decimals","amount","network_fee","value","confirmed","tx_hash","payer","deposit_address"],"additionalProperties":false}}},"required":["id","object","status","order_id","amount","currency","description","redirect_url","payment_url","amount_received","paid_at","expires_at","created_at","payments"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/InvalidRequestEncoded"}}}},"401":{"description":"Missing or invalid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/UnauthenticatedEncoded"}}}},"403":{"description":"Confirm the account's email (link in the signup email, or resend it from the dashboard) before creating live payments","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/EmailNotConfirmedEncoded"}}}},"409":{"description":"A payment with this order_id already exists","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/OrderIdTakenEncoded"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string","minLength":1,"maxLength":64},"amount":{"type":"string","maxLength":32},"currency":{"type":"string","enum":["IDR","USD"]},"description":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"redirect_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}]},"expiry_minutes":{"anyOf":[{"type":"integer","minimum":5,"maximum":10080},{"type":"null"}]}},"required":["order_id","amount","currency"],"additionalProperties":false}}},"required":true}}},"/api/v1/payments/{id}":{"get":{"tags":["payments"],"operationId":"payments.get","parameters":[{"name":"id","in":"path","schema":{"type":"string","maxLength":64},"required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["payment"]},"status":{"type":"string","enum":["pending","confirming","partially_paid","paid","expired"]},"order_id":{"type":"string"},"amount":{"type":"string"},"currency":{"type":"string","enum":["IDR","USD"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"redirect_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"payment_url":{"type":"string"},"amount_received":{"type":"string"},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"expires_at":{"type":"string"},"created_at":{"type":"string"},"payments":{"type":"array","items":{"type":"object","properties":{"method":{"type":"string","enum":["wallet","deposit"]},"chain":{"type":"string","enum":["ethereum","base"]},"token":{"type":"string","enum":["ETH","WETH","USDT","USDC"]},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"string"},"network_fee":{"type":"string"},"value":{"type":"string"},"confirmed":{"type":"boolean"},"tx_hash":{"anyOf":[{"type":"string"},{"type":"null"}]},"payer":{"anyOf":[{"type":"string"},{"type":"null"}]},"deposit_address":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["method","chain","token","decimals","amount","network_fee","value","confirmed","tx_hash","payer","deposit_address"],"additionalProperties":false}}},"required":["id","object","status","order_id","amount","currency","description","redirect_url","payment_url","amount_received","paid_at","expires_at","created_at","payments"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/InvalidRequestEncoded"}}}},"401":{"description":"Missing or invalid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/UnauthenticatedEncoded"}}}},"404":{"description":"Payment not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/PaymentNotFoundEncoded"}}}}}}},"/api/v1/checkout/{id}":{"get":{"tags":["checkout"],"operationId":"checkout.get","parameters":[{"name":"id","in":"path","schema":{"type":"string","maxLength":64},"required":true}],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","confirming","partially_paid","paid","expired"]},"merchant_name":{"type":"string"},"amount":{"type":"string"},"currency":{"type":"string","enum":["IDR","USD"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"redirect_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"expires_at":{"type":"string"},"chains":{"type":"array","items":{"type":"object","properties":{"chain":{"type":"string","enum":["ethereum","base"]},"name":{"type":"string"},"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tokens":{"type":"array","items":{"type":"string","enum":["ETH","WETH","USDT","USDC"]}}},"required":["chain","name","chain_id","tokens"],"additionalProperties":false}}},"required":["id","status","merchant_name","amount","currency","description","redirect_url","expires_at","chains"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/InvalidRequestEncoded"}}}},"404":{"description":"Payment not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/PaymentNotFoundEncoded"}}}}}}},"/api/v1/checkout/{id}/quotes":{"post":{"tags":["checkout"],"operationId":"checkout.quote","parameters":[{"name":"id","in":"path","schema":{"type":"string","maxLength":64},"required":true}],"security":[],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"chain":{"type":"string","enum":["ethereum","base"]},"token":{"type":"string","enum":["ETH","WETH","USDT","USDC"]},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"string"},"expires_at":{"type":"string"},"wallet":{"type":"object","properties":{"chain_id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"router":{"type":"string"},"quote":{"type":"object","properties":{"invoice_id":{"type":"string"},"merchant":{"type":"string"},"token":{"type":"string"},"amount":{"type":"string"},"fee_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoice_id","merchant","token","amount","fee_bps","expires_at"],"additionalProperties":false},"signature":{"type":"string"}},"required":["chain_id","router","quote","signature"],"additionalProperties":false},"deposit":{"anyOf":[{"type":"object","properties":{"address":{"type":"string"},"amount":{"type":"string"},"network_fee":{"type":"string"}},"required":["address","amount","network_fee"],"additionalProperties":false},{"type":"null"}]}},"required":["id","chain","token","decimals","amount","expires_at","wallet","deposit"],"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/InvalidRequestEncoded"}}}},"404":{"description":"Payment not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/PaymentNotFoundEncoded"}}}},"409":{"description":"This payment can no longer be paid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/PaymentNotPayableEncoded"}}}},"422":{"description":"This token is not available on this chain","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/TokenUnavailableEncoded"}}}},"503":{"description":"Prices are temporarily unavailable; try again shortly","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/PricingUnavailableEncoded"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","enum":["ethereum","base"]},"token":{"type":"string","enum":["ETH","WETH","USDT","USDC"]}},"required":["chain","token"],"additionalProperties":false}}},"required":true}}}},"components":{"schemas":{"InvalidRequestEncoded":{"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}},"type":{"type":"string","enum":["/errors/invalid-request"]},"status":{"type":"number","enum":[400]},"title":{"type":"string","enum":["Invalid request"]}},"required":["type"],"additionalProperties":false},"PricingUnavailableEncoded":{"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string"},"type":{"type":"string","enum":["/errors/pricing-unavailable"]},"status":{"type":"number","enum":[503]},"title":{"type":"string","enum":["Prices are temporarily unavailable; try again shortly"]}},"required":["type"],"additionalProperties":false},"TokenUnavailableEncoded":{"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string"},"type":{"type":"string","enum":["/errors/token-unavailable"]},"status":{"type":"number","enum":[422]},"title":{"type":"string","enum":["This token is not available on this chain"]}},"required":["type"],"additionalProperties":false},"PaymentNotPayableEncoded":{"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string"},"status_code":{"type":"string","enum":["pending","confirming","partially_paid","paid","expired"]},"type":{"type":"string","enum":["/errors/payment-not-payable"]},"status":{"type":"number","enum":[409]},"title":{"type":"string","enum":["This payment can no longer be paid"]}},"required":["status_code","type"],"additionalProperties":false},"PaymentNotFoundEncoded":{"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string"},"type":{"type":"string","enum":["/errors/payment-not-found"]},"status":{"type":"number","enum":[404]},"title":{"type":"string","enum":["Payment not found"]}},"required":["type"],"additionalProperties":false},"UnauthenticatedEncoded":{"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string"},"type":{"type":"string","enum":["/errors/unauthenticated"]},"status":{"type":"number","enum":[401]},"title":{"type":"string","enum":["Missing or invalid API key"]}},"required":["type"],"additionalProperties":false},"EmailNotConfirmedEncoded":{"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string"},"type":{"type":"string","enum":["/errors/email-not-confirmed"]},"status":{"type":"number","enum":[403]},"title":{"type":"string","enum":["Confirm the account's email (link in the signup email, or resend it from the dashboard) before creating live payments"]}},"required":["type"],"additionalProperties":false},"OrderIdTakenEncoded":{"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string"},"order_id":{"type":"string"},"type":{"type":"string","enum":["/errors/order-id-taken"]},"status":{"type":"number","enum":[409]},"title":{"type":"string","enum":["A payment with this order_id already exists"]}},"required":["order_id","type"],"additionalProperties":false}},"securitySchemes":{"apiKey":{"type":"http","scheme":"Bearer"}}},"security":[],"tags":[{"name":"payments"},{"name":"checkout"}]}