{"openapi":"3.1.0","info":{"title":"API Pix da LootPay","version":"1.0.0"},"servers":[{"url":"https://api.uselootpay.app/v1"}],"security":[{"basic":[]}],"paths":{"/stats":{"get":{"summary":"Indicadores acumulados de produção em BRL","parameters":[],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStats"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/health":{"get":{"summary":"Disponibilidade HTTP","parameters":[],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/openapi.json":{"get":{"security":[],"responses":{"200":{"description":"Documento OpenAPI"}}}},"/balance":{"get":{"summary":"Saldo · pix:read","parameters":[],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pix/fees":{"get":{"summary":"Tarifas · pix:read","parameters":[{"name":"amountCents","in":"query","schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Fees"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pix":{"get":{"summary":"Extrato com até 50 registros · pix:read","parameters":[{"name":"before","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"enum":["pending","completed","failed"],"type":"string"}},{"name":"direction","in":"query","schema":{"enum":["in","out"],"type":"string"}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Statement"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pix/{id}":{"get":{"summary":"Consultar Pix · pix:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pix/charges":{"post":{"summary":"Criar cobrança · pix:in","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Charge"}}}},"responses":{"201":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pix/withdrawals":{"post":{"summary":"Solicitar saque · pix:out","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}}},"responses":{"201":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/balance":{"get":{"summary":"Saldo · pix:read","parameters":[],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/fees":{"get":{"summary":"Tarifas · pix:read","parameters":[{"name":"amountCents","in":"query","schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Fees"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix":{"get":{"summary":"Extrato com até 50 registros · pix:read","parameters":[{"name":"before","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Statement"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/{id}":{"get":{"summary":"Consultar Pix · pix:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxOperation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/charges":{"post":{"summary":"Criar cobrança · pix:in","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Charge"}}}},"responses":{"201":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/withdrawals":{"post":{"summary":"Solicitar saque · pix:out","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}}},"responses":{"201":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pix/charges/{id}/link":{"post":{"summary":"Gerar página de pagamento · pix:in","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/charges/{id}/simulate":{"post":{"summary":"Simular resultado · pix:in","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Outcome"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/charges/{id}/refunds":{"post":{"summary":"Simular devolução · pix:in","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRefund"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundedOperation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/charges/{id}/events/{eventId}/replay":{"post":{"summary":"Reenviar webhook de teste · pix:in","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayedEvent"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/withdrawals/{id}/simulate":{"post":{"summary":"Simular resultado · pix:out","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Outcome"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/withdrawals/{id}/refunds":{"post":{"summary":"Simular devolução · pix:out","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRefund"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundedOperation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/withdrawals/{id}/events/{eventId}/replay":{"post":{"summary":"Reenviar webhook de teste · pix:out","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayedEvent"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox/pix/charges/{id}/med":{"post":{"summary":"Simular contestação · pix:in","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestMed"}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedOperation"}}}},"default":{"description":"Erro da API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"}},"schemas":{"PlatformStats":{"type":"object","properties":{"asOf":{"type":"string","format":"date-time"},"currency":{"const":"BRL"},"users":{"type":"integer","format":"int64"},"volumeCents":{"type":"integer","format":"int64"},"inVolumeCents":{"type":"integer","format":"int64"},"outVolumeCents":{"type":"integer","format":"int64"},"completedCount":{"type":"integer","format":"int64"},"inCount":{"type":"integer","format":"int64"},"outCount":{"type":"integer","format":"int64"},"medWon":{"type":"integer","format":"int64"}},"required":["asOf","currency","users","volumeCents","inVolumeCents","outVolumeCents","completedCount","inCount","outCount","medWon"]},"Health":{"type":"object","properties":{"status":{"const":"ok"}},"required":["status"]},"Error":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string","format":"uuid"}},"required":["statusCode","code","message","requestId"]},"Balance":{"type":"object","properties":{"currency":{"const":"BRL"},"availableCents":{"type":"integer","format":"int64"},"reservedCents":{"type":"integer","format":"int64"},"providerUnavailableCents":{"type":"integer","format":"int64"},"medPendingConfirmation":{"type":"boolean"}},"required":["currency","availableCents","reservedCents"]},"Fees":{"type":"object","properties":{"currency":{"const":"BRL"},"inCents":{"type":"integer","format":"int64"},"outCents":{"type":"integer","format":"int64"}},"required":["currency","inCents","outCents"]},"Operation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"direction":{"enum":["in","out"],"type":"string"},"status":{"enum":["pending","completed","failed"],"type":"string"},"amountCents":{"type":"integer","format":"int64"},"netCents":{"type":"integer","format":"int64"},"feeCents":{"type":"integer","format":"int64"},"returnedCents":{"type":"integer","format":"int64"},"failureReason":{"enum":["expired","cancelled",null]},"endToEnd":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"finalizedAt":{"type":"string","format":"date-time"},"pixCode":{"type":["string","null"]}},"required":["id","direction","status","amountCents","netCents","feeCents","createdAt","pixCode"]},"Charge":{"type":"object","properties":{"amountCents":{"type":"integer","format":"int64","minimum":200,"maximum":100000},"expectedFeeCents":{"type":"integer","format":"int64"},"idempotencyKey":{"type":"string","format":"uuid"},"payerName":{"type":"string","minLength":2,"maxLength":100}},"required":["amountCents","idempotencyKey","payerName"]},"Withdrawal":{"type":"object","properties":{"amountCents":{"type":"integer","format":"int64","minimum":200,"maximum":100000000},"expectedFeeCents":{"type":"integer","format":"int64"},"idempotencyKey":{"type":"string","format":"uuid"},"keyType":{"enum":["CPF","CNPJ","EMAIL","PHONE","EVP"]},"key":{"type":"string"}},"required":["amountCents","idempotencyKey","keyType","key"]},"Checkout":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"Outcome":{"type":"object","properties":{"status":{"enum":["completed","failed"]}},"required":["status"]},"TestRefund":{"type":"object","properties":{"idempotencyKey":{"type":"string","format":"uuid"},"amountCents":{"type":"integer","format":"int64","minimum":1,"maximum":100000000}},"required":["idempotencyKey","amountCents"]},"RefundedOperation":{"allOf":[{"$ref":"#/components/schemas/Operation"},{"type":"object","properties":{"returnedCents":{"type":"integer","format":"int64"},"refund":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"amountCents":{"type":"integer","format":"int64"}},"required":["id","amountCents"]}},"required":["returnedCents","refund"]}]},"MedNotice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"change":{"enum":["opened","updated","closed"]},"status":{"enum":["OPEN","IN_ANALYSIS","CLOSED","CANCELLED"]},"amountCents":{"type":"integer","format":"int64"},"deadline":{"type":["string","null"],"format":"date-time"},"outcome":{"type":["string","null"]}},"required":["id","change","status","amountCents","deadline","outcome"]},"SandboxOperation":{"allOf":[{"$ref":"#/components/schemas/Operation"},{"type":"object","properties":{"med":{"$ref":"#/components/schemas/MedNotice"}},"required":[]}]},"MedOperation":{"allOf":[{"$ref":"#/components/schemas/Operation"},{"type":"object","properties":{"med":{"$ref":"#/components/schemas/MedNotice"}},"required":["med"]}]},"TestMed":{"oneOf":[{"type":"object","properties":{"idempotencyKey":{"type":"string","format":"uuid"},"status":{"const":"OPEN"},"amountCents":{"type":"integer","format":"int64","minimum":1,"maximum":100000},"heldCents":{"type":"integer","format":"int64","minimum":0},"deadline":{"type":["string","null"],"format":"date-time"}},"required":["idempotencyKey","status","amountCents"]},{"type":"object","properties":{"idempotencyKey":{"type":"string","format":"uuid"},"status":{"enum":["IN_ANALYSIS","CANCELLED"]}},"required":["idempotencyKey","status"]},{"type":"object","properties":{"idempotencyKey":{"type":"string","format":"uuid"},"status":{"const":"CLOSED"},"outcome":{"enum":["favorable","unfavorable"]}},"required":["idempotencyKey","status","outcome"]}]},"ReplayedEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]},"Statement":{"type":"object","properties":{"operations":{"type":"array","items":{"$ref":"#/components/schemas/Operation"}},"next":{"type":["string","null"],"format":"uuid"}},"required":["operations","next"]}}}}