{"components":{"schemas":{"BuyerInput":{"additionalProperties":false,"properties":{"document":{"description":"CPF or CNPJ, digits or formatted.","type":"string"},"email":{"type":"string"},"ip":{"description":"The buyer's IP as the seller saw it (IPv4 or IPv6). Stored flagged as seller-reported: it is\naudit context, never a verified fact.","type":["string","null"]},"name":{"type":"string"},"phone":{"description":"10 to 15 digits, with or without formatting.","type":"string"}},"required":["name","email","document","phone"],"type":"object"},"BuyerView":{"description":"The buyer as a read shows it.","properties":{"document":{"description":"Masked: `***.456.789-**`.","type":"string"},"email":{"description":"Partial: `m***@example.com`.","type":"string"},"name":{"type":"string"},"phone":{"description":"Only the last four digits.","type":"string"}},"required":["name","email","document","phone"],"type":"object"},"CreateIntentBody":{"additionalProperties":false,"properties":{"amount":{"description":"Integer cents, BRL. Minimum 100.","format":"int64","type":"integer"},"buyer":{"$ref":"#/components/schemas/BuyerInput"},"description":{"type":["string","null"]},"external_reference":{"description":"Your own reference; unique per seller.","type":["string","null"]},"metadata":{"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"type":["object","null"]},"wallet":{"description":"The `wal_…` id of the wallet to charge.","type":"string"}},"required":["wallet","amount","buyer"],"type":"object"},"ErrorBody":{"properties":{"code":{"description":"Stable, machine-readable. Branch on this, never on `message`.","type":"string"},"message":{"type":"string"},"param":{"description":"The request field at fault, when there is one.","type":["string","null"]},"request_id":{"type":"string"},"type":{"$ref":"#/components/schemas/ErrorType"}},"required":["type","code","message","request_id"],"type":"object"},"ErrorEnvelope":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"required":["error"],"type":"object"},"ErrorType":{"enum":["authentication","permission","invalid_request","rate_limit","gateway","idempotency","internal"],"type":"string"},"IntentList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PaymentIntentObject"},"type":"array"},"has_more":{"type":"boolean"},"next_cursor":{"description":"Pass as `starting_after` to get the next page.","type":["string","null"]},"object":{"type":"string"}},"required":["object","data","has_more"],"type":"object"},"IntentStatus":{"enum":["processing","requires_action","succeeded","expired","canceled","failed"],"type":"string"},"PaymentIntentObject":{"description":"The public payment intent object.","properties":{"amount":{"description":"Integer cents, BRL.","format":"int64","type":"integer"},"buyer":{"$ref":"#/components/schemas/BuyerView"},"canceled_at":{"type":["string","null"]},"created_at":{"type":"string"},"description":{"type":["string","null"]},"expires_at":{"type":"string"},"external_reference":{"type":["string","null"]},"id":{"description":"`pi_…`","type":"string"},"livemode":{"type":"boolean"},"metadata":{"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"type":"object"},"object":{"description":"Always `payment_intent`.","type":"string"},"pix":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PixView"}]},"status":{"$ref":"#/components/schemas/IntentStatus"},"succeeded_at":{"type":["string","null"]},"wallet":{"description":"The `wal_…` id of the wallet charged.","type":"string"}},"required":["id","object","livemode","status","amount","wallet","metadata","buyer","created_at","expires_at"],"type":"object"},"PixView":{"description":"The PIX of an intent, once it exists.","properties":{"copy_paste":{"description":"The \"copia e cola\" code.","type":"string"},"expires_at":{"type":"string"},"qr_base64":{"description":"The QR code image, base64.","type":"string"}},"required":["copy_paste","qr_base64","expires_at"],"type":"object"},"WalletList":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WalletView"},"type":"array"},"object":{"type":"string"}},"required":["object","data"],"type":"object"},"WalletView":{"description":"`GET /v1/wallets` item.","properties":{"active_pix_count":{"format":"int64","type":"integer"},"id":{"description":"The `wal_…` id a charge's `wallet` takes.","type":"string"},"name":{"type":"string"},"object":{"type":"string"}},"required":["id","object","name","active_pix_count"],"type":"object"}},"securitySchemes":{"bearer":{"description":"`ggpk_live_…` or `ggpk_test_…`","scheme":"bearer","type":"http"}}},"info":{"description":"Charge your GG Checkout wallet with PIX from your own code.","license":{"name":""},"title":"GG Checkout Payments API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/v1/payment_intents":{"get":{"description":"Only the intents of the key's mode (live or test) and wallets.","operationId":"list_intents","parameters":[{"description":"Page size, 1 to 100 (default 20).","in":"query","name":"limit","required":false,"schema":{"format":"int64","type":"integer"}},{"description":"The `next_cursor` of the previous page.","in":"query","name":"starting_after","required":false,"schema":{"type":"string"}},{"description":"Only intents in this status.","in":"query","name":"status","required":false,"schema":{"$ref":"#/components/schemas/IntentStatus"}},{"in":"query","name":"external_reference","required":false,"schema":{"type":"string"}},{"description":"Only intents created at or after this Unix timestamp (seconds).","in":"query","name":"created_gte","required":false,"schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntentList"}}},"description":"A page of intents"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"`invalid_status`, `invalid_cursor` or `invalid_created_gte`"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Invalid key"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"IP not allowed, or account suspended"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Rate limited"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"`rate_limiter_unavailable`: the limiter is down and the API fails closed"}},"security":[{"bearer":[]}],"summary":"List payment intents","tags":["Payment intents"]},"post":{"description":"Charges the wallet with a PIX. With a `ggpk_test_` key the PIX is simulated and nothing reaches a gateway. Requires an `Idempotency-Key` header.","operationId":"create_intent","parameters":[{"description":"1 to 255 printable ASCII characters; replayable for 24 hours.","in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIntentBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentObject"}}},"description":"A retry, after the 24-hour replay window, of a request that already created the intent (or a retry that recovered an attempt payments never answered)"},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentObject"}}},"description":"Created. A retry with the same Idempotency-Key within 24 hours replays this response with the `Idempotent-Replayed: true` header"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Invalid, revoked or expired key"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"No gateway could generate the PIX"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"IP not allowed, wallet out of scope, or account suspended"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Idempotency conflict or external_reference already used"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Rate limited"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"`gateway_unavailable`: the charge may or may not have happened; retry with the same Idempotency-Key"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"`rate_limiter_unavailable`: the limiter is down and the API fails closed"}},"security":[{"bearer":[]}],"summary":"Create a payment intent","tags":["Payment intents"]}},"/v1/payment_intents/{id}":{"get":{"operationId":"get_intent","parameters":[{"description":"The `pi_…` id.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentObject"}}},"description":"The intent"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Invalid key"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"IP not allowed, or account suspended"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"No such intent"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Rate limited"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"`rate_limiter_unavailable`: the limiter is down and the API fails closed"}},"security":[{"bearer":[]}],"summary":"Retrieve a payment intent","tags":["Payment intents"]}},"/v1/payment_intents/{id}/cancel":{"post":{"description":"Allowed before the intent succeeds, fails or expires. Canceling a canceled intent is a no-op. A PIX paid after the cancel still succeeds and emits `payment_intent.succeeded_after_cancel`.","operationId":"cancel_intent","parameters":[{"description":"The `pi_…` id.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Optional: cancel is idempotent by itself.","in":"header","name":"Idempotency-Key","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentObject"}}},"description":"The canceled intent"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Invalid key"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"IP not allowed, or account suspended"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"No such intent"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"The intent can no longer be canceled"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Rate limited"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"`rate_limiter_unavailable`: the limiter is down and the API fails closed"}},"security":[{"bearer":[]}],"summary":"Cancel a payment intent","tags":["Payment intents"]}},"/v1/wallets":{"get":{"operationId":"list_wallets","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletList"}}},"description":"The wallets in the key's scope"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Invalid key"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"IP not allowed, or account suspended"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"Rate limited"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}},"description":"`rate_limiter_unavailable`: the limiter is down and the API fails closed"}},"security":[{"bearer":[]}],"summary":"List wallets","tags":["Wallets"]}}},"servers":[{"url":"https://api.ggcheckout.app"}]}