{"openapi":"3.1.0","info":{"title":"Aporta API","version":"0.0.1","description":"Gateway de pagamentos para desenvolvedores (sandbox). Envelope `{ data, success, error }`. Métodos: PIX · BOLETO · CARD · CRYPTO. Auth: `Authorization: Bearer sk_test_…` ou sessão merchant.","contact":{"name":"Aporta / Iniciador","url":"https://aporta-web.fly.dev"}},"servers":[{"url":"https://aporta-api.fly.dev","description":"Sandbox (Fly gru)"},{"url":"http://localhost:3001","description":"Local"}],"tags":[{"name":"Health"},{"name":"Auth"},{"name":"Customers"},{"name":"Products"},{"name":"Checkouts"},{"name":"Payment links"},{"name":"Transparents"},{"name":"Coupons"},{"name":"Subscriptions"},{"name":"Webhooks"},{"name":"Payouts"},{"name":"PIX send"},{"name":"Crypto"},{"name":"Store"},{"name":"API keys"},{"name":"KYC"},{"name":"Disputes"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key `sk_test_…` / `sk_live_…` or merchant session `sess_…`"}},"schemas":{"EnvelopeSuccess":{"type":"object","required":["data","success","error"],"properties":{"data":{},"success":{"const":true},"error":{"const":null}}},"EnvelopeError":{"type":"object","required":["data","success","error"],"properties":{"data":{"const":null},"success":{"const":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}},"Pagination":{"type":"object","properties":{"hasMore":{"type":"boolean"},"next":{"type":["string","null"]},"before":{"type":["string","null"]}}},"PaymentMethod":{"type":"string","enum":["PIX","BOLETO","CARD","CRYPTO"]},"WebhookEventName":{"type":"string","enum":["checkout.completed","checkout.refunded","checkout.expired","checkout.disputed","transparent.completed","transparent.refunded","transparent.disputed","subscription.completed","subscription.cancelled","subscription.plan_changed","subscription.renewed","subscription.trial_started","payout.completed","payout.failed","transfer.completed","transfer.failed","crypto.receive.completed","crypto.send.completed","crypto.send.failed"]}}},"security":[{"bearerAuth":[]}],"paths":{"/v1/fees/calculate":{"get":{"tags":["Store"],"summary":"Fee calculator (sandbox stub)","security":[{"bearerAuth":[]}],"parameters":[{"name":"amount","in":"query","required":true,"schema":{"type":"integer"}},{"name":"method","in":"query","schema":{"$ref":"#/components/schemas/PaymentMethod"}}],"responses":{"200":{"description":"Estimate"}}}},"/v1/stores/list":{"get":{"tags":["Store"],"summary":"List stores (current store stub)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Store list"}}}},"/v1/checkouts/apply-coupon":{"post":{"tags":["Checkouts"],"summary":"Apply coupon on pending checkout","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Updated checkout"}}}},"/":{"get":{"tags":["Health"],"summary":"API root","security":[],"responses":{"200":{"description":"Metadata"}}}},"/v1/health":{"get":{"tags":["Health"],"summary":"Healthcheck","security":[],"responses":{"200":{"description":"OK"}}}},"/v1/openapi.json":{"get":{"tags":["Health"],"summary":"OpenAPI 3.1 document","security":[],"responses":{"200":{"description":"OpenAPI JSON"}}}},"/v1/customers/create":{"post":{"tags":["Customers"],"summary":"Create customer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"},"cellphone":{"type":"string"},"taxId":{"type":"string"},"zipCode":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"201":{"description":"Created"}}}},"/v1/customers/list":{"get":{"tags":["Customers"],"summary":"List customers (cursor pagination)","parameters":[{"name":"after","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"startDate","in":"query","schema":{"type":"string"}},{"name":"endDate","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Page"}}}},"/v1/customers/{id}":{"get":{"tags":["Customers"],"summary":"Get customer","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Customer"},"404":{"description":"Not found"}}}},"/v1/customers/delete":{"post":{"tags":["Customers"],"summary":"Delete customer","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}},"responses":{"200":{"description":"Deleted"}}}},"/v1/products/create":{"post":{"tags":["Products"],"summary":"Create product","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name","price"],"properties":{"name":{"type":"string"},"price":{"type":"integer","description":"Centavos BRL"},"description":{"type":"string"},"currency":{"type":"string","enum":["BRL"]},"cycle":{"type":"string","enum":["WEEKLY","MONTHLY","QUARTERLY","SEMIANNUALLY","ANNUALLY"]}}}}}},"responses":{"201":{"description":"Created"}}}},"/v1/products/list":{"get":{"tags":["Products"],"summary":"List products","responses":{"200":{"description":"Page"}}}},"/v1/checkouts/create":{"post":{"tags":["Checkouts"],"summary":"Create hosted checkout","description":"Provide `amount` or catalog `items[]`. Optional `upSellProductId` for bump offer on hosted `/c/[id]`.","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["methods"],"properties":{"amount":{"type":"integer","minimum":1},"items":{"type":"array","items":{"type":"object","required":["id","quantity"],"properties":{"id":{"type":"string"},"quantity":{"type":"integer","minimum":1}}}},"methods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"},"minItems":1},"customerId":{"type":"string"},"returnUrl":{"type":"string"},"completionUrl":{"type":"string"},"couponCode":{"type":"string"},"upSellProductId":{"type":"string"},"dueDate":{"type":"string","description":"YYYY-MM-DD (boleto)"},"interest":{"type":"object","properties":{"value":{"type":"integer"}}},"fine":{"type":"object","properties":{"value":{"type":"integer"},"type":{"type":"string","enum":["PERCENTAGE","FIXED"]}}},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"201":{"description":"Created with url + rails"}}}},"/v1/checkouts/list":{"get":{"tags":["Checkouts"],"summary":"List checkouts","responses":{"200":{"description":"Page"}}}},"/v1/checkouts/one":{"get":{"tags":["Checkouts"],"summary":"Get checkout by id","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Checkout"}}}},"/v1/checkouts/check":{"get":{"tags":["Checkouts"],"summary":"Check checkout status","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Checkout"}}}},"/v1/checkouts/simulate-payment":{"post":{"tags":["Checkouts"],"summary":"Sandbox: mark checkout PAID","responses":{"200":{"description":"Paid"}}}},"/v1/checkouts/accept-upsell":{"post":{"tags":["Checkouts"],"summary":"Accept upsell bump (adds product price to amount)","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated checkout"}}}},"/v1/checkouts/simulate-dispute":{"post":{"tags":["Disputes"],"summary":"Sandbox stub: emit checkout.disputed","responses":{"200":{"description":"Event emitted"}}}},"/v1/checkouts/refund":{"post":{"tags":["Checkouts"],"summary":"Refund or cancel checkout","responses":{"200":{"description":"Refunded/cancelled"}}}},"/v1/checkouts/delete":{"post":{"tags":["Checkouts"],"summary":"Delete unpaid checkout","responses":{"200":{"description":"Deleted"}}}},"/v1/payment-links/create":{"post":{"tags":["Payment links"],"summary":"Create reusable payment link","responses":{"201":{"description":"Created"}}}},"/v1/transparents/create":{"post":{"tags":["Transparents"],"summary":"Create transparent charge (PIX/BOLETO/CARD/CRYPTO)","responses":{"201":{"description":"Created"}}}},"/v1/transparents/simulate-dispute":{"post":{"tags":["Disputes"],"summary":"Sandbox stub: emit transparent.disputed","responses":{"200":{"description":"Event emitted"}}}},"/v1/coupons/create":{"post":{"tags":["Coupons"],"summary":"Create coupon","responses":{"201":{"description":"Created"}}}},"/v1/subscriptions/create":{"post":{"tags":["Subscriptions"],"summary":"Create subscription (legacy amount or items[] checkout)","responses":{"201":{"description":"Created"}}}},"/v1/subscriptions/simulate-renewal":{"post":{"tags":["Subscriptions"],"summary":"Sandbox stub: emit subscription.renewed","responses":{"200":{"description":"Event emitted"}}}},"/v1/subscriptions/simulate-trial":{"post":{"tags":["Subscriptions"],"summary":"Sandbox stub: emit subscription.trial_started","responses":{"200":{"description":"Event emitted"}}}},"/v1/webhooks/create":{"post":{"tags":["Webhooks"],"summary":"Register HTTPS webhook endpoint","description":"Deliveries signed with `X-Aporta-Signature: t=…,v1=…` (HMAC-SHA256 of `t.rawBody` with `whsec_…`).","responses":{"201":{"description":"Created with secret"}}}},"/v1/webhooks/events":{"get":{"tags":["Webhooks"],"summary":"List supported webhook event names","security":[],"responses":{"200":{"description":"Event catalog"}}}},"/v1/webhooks/list":{"get":{"tags":["Webhooks"],"summary":"List webhooks","responses":{"200":{"description":"Page"}}}},"/v1/payouts/create":{"post":{"tags":["Payouts"],"summary":"Create payout (PIX withdraw)","responses":{"201":{"description":"Created"}}}},"/v1/pix/send/create":{"post":{"tags":["PIX send"],"summary":"Send PIX (emits transfer.completed|failed)","responses":{"201":{"description":"Created"}}}},"/v1/crypto/receive/create":{"post":{"tags":["Crypto"],"summary":"Create crypto receive address","responses":{"201":{"description":"Created"}}}},"/v1/crypto/receive/simulate-payment":{"post":{"tags":["Crypto"],"summary":"Sandbox: mark crypto receive PAID (emits crypto.receive.completed)","responses":{"200":{"description":"Paid"}}}},"/v1/crypto/send/create":{"post":{"tags":["Crypto"],"summary":"Send crypto (emits crypto.send.completed|failed)","responses":{"201":{"description":"Created"}}}},"/v1/store/get":{"get":{"tags":["Store"],"summary":"Store profile + balance","responses":{"200":{"description":"Store"}}}},"/v1/api-keys/create":{"post":{"tags":["API keys"],"summary":"Create API key (full secret once)","responses":{"201":{"description":"Created"}}}},"/v1/api-keys/list":{"get":{"tags":["API keys"],"summary":"List API keys (masked)","responses":{"200":{"description":"Keys"}}}},"/v1/auth/register":{"post":{"tags":["Auth"],"summary":"Register merchant","security":[],"responses":{"201":{"description":"Registered"}}}},"/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Login merchant","security":[],"responses":{"200":{"description":"Session"}}}},"/v1/kyc/applications":{"get":{"tags":["KYC"],"summary":"List KYC applications","responses":{"200":{"description":"Applications"}}}}}}