openapi: 3.0.1 info: title: Pagar.me Core API description: >- The Pagar.me Core API (v5) is a REST API for online payments in Brazil. It processes orders and charges via credit card, PIX, and boleto; manages customers, addresses, cards, and tokens; supports recurring billing through plans, subscriptions, and invoices; and provides marketplace capabilities via recipients, split, transfers, and anticipations, with webhook event notifications. Authentication uses HTTP Basic auth with the account secret key as the username and an empty password. termsOfService: https://pagar.me/termos-de-uso/ contact: name: Pagar.me Support url: https://docs.pagar.me version: '5' servers: - url: https://api.pagar.me/core/v5 description: Pagar.me Core API v5 production security: - basicAuth: [] tags: - name: Orders description: Top-level checkout objects bundling customer, items, and payments. - name: Charges description: Individual payment attempts generated by an order. - name: Customers description: Buyers and their addresses. - name: Cards description: Reusable card wallet and tokens for a customer. - name: Subscriptions description: Recurring billing agreements. - name: Plans description: Reusable subscription templates. - name: Invoices description: Invoices generated by subscription cycles. - name: Recipients description: Marketplace recipients for split and payouts. - name: Transfers description: Recipient transfers and withdrawals. - name: Anticipations description: Receivable anticipations for recipients. paths: /orders: post: operationId: createOrder tags: - Orders summary: Create order description: Creates an order, bundling customer, items, and payments. Generates one or more charges. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateOrderRequest' responses: '200': description: Order created content: application/json: schema: $ref: '#/components/schemas/Order' get: operationId: listOrders tags: - Orders summary: List orders description: Returns a paginated list of orders. parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Size' responses: '200': description: A list of orders content: application/json: schema: $ref: '#/components/schemas/OrderList' /orders/{order_id}: get: operationId: getOrder tags: - Orders summary: Get order parameters: - $ref: '#/components/parameters/OrderId' responses: '200': description: The order content: application/json: schema: $ref: '#/components/schemas/Order' /orders/{order_id}/closed: patch: operationId: closeOrder tags: - Orders summary: Close or reopen an order parameters: - $ref: '#/components/parameters/OrderId' requestBody: required: true content: application/json: schema: type: object properties: status: type: string enum: [open, closed] responses: '200': description: The updated order content: application/json: schema: $ref: '#/components/schemas/Order' /charges/{charge_id}: get: operationId: getCharge tags: - Charges summary: Get charge parameters: - $ref: '#/components/parameters/ChargeId' responses: '200': description: The charge content: application/json: schema: $ref: '#/components/schemas/Charge' delete: operationId: cancelCharge tags: - Charges summary: Cancel or refund a charge parameters: - $ref: '#/components/parameters/ChargeId' responses: '200': description: The cancelled charge content: application/json: schema: $ref: '#/components/schemas/Charge' /charges: get: operationId: listCharges tags: - Charges summary: List charges parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Size' responses: '200': description: A list of charges content: application/json: schema: $ref: '#/components/schemas/ChargeList' /charges/{charge_id}/capture: post: operationId: captureCharge tags: - Charges summary: Capture a charge description: Captures a previously authorized credit card charge. parameters: - $ref: '#/components/parameters/ChargeId' requestBody: required: false content: application/json: schema: type: object properties: amount: type: integer description: Amount to capture in cents. responses: '200': description: The captured charge content: application/json: schema: $ref: '#/components/schemas/Charge' /charges/{charge_id}/card: patch: operationId: updateChargeCard tags: - Charges summary: Update charge card parameters: - $ref: '#/components/parameters/ChargeId' requestBody: required: true content: application/json: schema: type: object properties: card_id: type: string card_token: type: string responses: '200': description: The updated charge content: application/json: schema: $ref: '#/components/schemas/Charge' /charges/{charge_id}/payment-method: patch: operationId: updateChargePaymentMethod tags: - Charges summary: Update charge payment method parameters: - $ref: '#/components/parameters/ChargeId' requestBody: required: true content: application/json: schema: type: object properties: payment_method: type: string enum: [credit_card, boleto, pix] update_subscription: type: boolean responses: '200': description: The updated charge content: application/json: schema: $ref: '#/components/schemas/Charge' /customers: post: operationId: createCustomer tags: - Customers summary: Create customer requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateCustomerRequest' responses: '200': description: The created customer content: application/json: schema: $ref: '#/components/schemas/Customer' get: operationId: listCustomers tags: - Customers summary: List customers parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Size' responses: '200': description: A list of customers content: application/json: schema: $ref: '#/components/schemas/CustomerList' /customers/{customer_id}: get: operationId: getCustomer tags: - Customers summary: Get customer parameters: - $ref: '#/components/parameters/CustomerId' responses: '200': description: The customer content: application/json: schema: $ref: '#/components/schemas/Customer' put: operationId: updateCustomer tags: - Customers summary: Update customer parameters: - $ref: '#/components/parameters/CustomerId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateCustomerRequest' responses: '200': description: The updated customer content: application/json: schema: $ref: '#/components/schemas/Customer' /customers/{customer_id}/addresses: post: operationId: createAddress tags: - Customers summary: Create customer address parameters: - $ref: '#/components/parameters/CustomerId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Address' responses: '200': description: The created address content: application/json: schema: $ref: '#/components/schemas/Address' /customers/{customer_id}/cards: post: operationId: createCard tags: - Cards summary: Create card description: Adds a card to the customer wallet. Send card_token or card_id; never raw card data in production flows that require tokenization. parameters: - $ref: '#/components/parameters/CustomerId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateCardRequest' responses: '200': description: The created card content: application/json: schema: $ref: '#/components/schemas/Card' get: operationId: listCards tags: - Cards summary: List customer cards parameters: - $ref: '#/components/parameters/CustomerId' responses: '200': description: A list of cards content: application/json: schema: $ref: '#/components/schemas/CardList' /customers/{customer_id}/cards/{card_id}: get: operationId: getCard tags: - Cards summary: Get card parameters: - $ref: '#/components/parameters/CustomerId' - $ref: '#/components/parameters/CardId' responses: '200': description: The card content: application/json: schema: $ref: '#/components/schemas/Card' delete: operationId: deleteCard tags: - Cards summary: Delete card parameters: - $ref: '#/components/parameters/CustomerId' - $ref: '#/components/parameters/CardId' responses: '200': description: The deleted card content: application/json: schema: $ref: '#/components/schemas/Card' /tokens: post: operationId: createToken tags: - Cards summary: Create card token description: Generates a single-use token from card data using the account public key (appId query parameter). parameters: - name: appId in: query required: true description: Account public key. schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateTokenRequest' responses: '200': description: The created token content: application/json: schema: $ref: '#/components/schemas/Token' /plans: post: operationId: createPlan tags: - Plans summary: Create plan requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreatePlanRequest' responses: '200': description: The created plan content: application/json: schema: $ref: '#/components/schemas/Plan' get: operationId: listPlans tags: - Plans summary: List plans parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Size' responses: '200': description: A list of plans content: application/json: schema: $ref: '#/components/schemas/PlanList' /plans/{plan_id}: get: operationId: getPlan tags: - Plans summary: Get plan parameters: - $ref: '#/components/parameters/PlanId' responses: '200': description: The plan content: application/json: schema: $ref: '#/components/schemas/Plan' put: operationId: updatePlan tags: - Plans summary: Update plan parameters: - $ref: '#/components/parameters/PlanId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreatePlanRequest' responses: '200': description: The updated plan content: application/json: schema: $ref: '#/components/schemas/Plan' delete: operationId: deletePlan tags: - Plans summary: Delete plan parameters: - $ref: '#/components/parameters/PlanId' responses: '200': description: The deleted plan content: application/json: schema: $ref: '#/components/schemas/Plan' /subscriptions: post: operationId: createSubscription tags: - Subscriptions summary: Create subscription description: Creates a recurring subscription, either from a plan (plan_id) or standalone with inline items and interval. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateSubscriptionRequest' responses: '200': description: The created subscription content: application/json: schema: $ref: '#/components/schemas/Subscription' get: operationId: listSubscriptions tags: - Subscriptions summary: List subscriptions parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Size' responses: '200': description: A list of subscriptions content: application/json: schema: $ref: '#/components/schemas/SubscriptionList' /subscriptions/{subscription_id}: get: operationId: getSubscription tags: - Subscriptions summary: Get subscription parameters: - $ref: '#/components/parameters/SubscriptionId' responses: '200': description: The subscription content: application/json: schema: $ref: '#/components/schemas/Subscription' delete: operationId: cancelSubscription tags: - Subscriptions summary: Cancel subscription parameters: - $ref: '#/components/parameters/SubscriptionId' responses: '200': description: The cancelled subscription content: application/json: schema: $ref: '#/components/schemas/Subscription' /subscriptions/{subscription_id}/cycles: post: operationId: createSubscriptionCycle tags: - Subscriptions summary: Renew subscription cycle parameters: - $ref: '#/components/parameters/SubscriptionId' responses: '200': description: The created cycle content: application/json: schema: type: object /invoices: get: operationId: listInvoices tags: - Invoices summary: List invoices parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Size' responses: '200': description: A list of invoices content: application/json: schema: $ref: '#/components/schemas/InvoiceList' /invoices/{invoice_id}: get: operationId: getInvoice tags: - Invoices summary: Get invoice parameters: - $ref: '#/components/parameters/InvoiceId' responses: '200': description: The invoice content: application/json: schema: $ref: '#/components/schemas/Invoice' delete: operationId: cancelInvoice tags: - Invoices summary: Cancel invoice parameters: - $ref: '#/components/parameters/InvoiceId' responses: '200': description: The cancelled invoice content: application/json: schema: $ref: '#/components/schemas/Invoice' /recipients: post: operationId: createRecipient tags: - Recipients summary: Create recipient requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateRecipientRequest' responses: '200': description: The created recipient content: application/json: schema: $ref: '#/components/schemas/Recipient' get: operationId: listRecipients tags: - Recipients summary: List recipients parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Size' responses: '200': description: A list of recipients content: application/json: schema: $ref: '#/components/schemas/RecipientList' /recipients/{recipient_id}: get: operationId: getRecipient tags: - Recipients summary: Get recipient parameters: - $ref: '#/components/parameters/RecipientId' responses: '200': description: The recipient content: application/json: schema: $ref: '#/components/schemas/Recipient' put: operationId: updateRecipient tags: - Recipients summary: Update recipient parameters: - $ref: '#/components/parameters/RecipientId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateRecipientRequest' responses: '200': description: The updated recipient content: application/json: schema: $ref: '#/components/schemas/Recipient' /recipients/{recipient_id}/default-bank-account: patch: operationId: updateRecipientBankAccount tags: - Recipients summary: Update recipient default bank account parameters: - $ref: '#/components/parameters/RecipientId' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BankAccount' responses: '200': description: The updated recipient content: application/json: schema: $ref: '#/components/schemas/Recipient' /recipients/{recipient_id}/transfer-settings: patch: operationId: updateRecipientTransferSettings tags: - Recipients summary: Update recipient transfer settings parameters: - $ref: '#/components/parameters/RecipientId' requestBody: required: true content: application/json: schema: type: object properties: transfer_enabled: type: boolean transfer_interval: type: string enum: [Daily, Weekly, Monthly] transfer_day: type: integer responses: '200': description: The updated recipient content: application/json: schema: $ref: '#/components/schemas/Recipient' /recipients/{recipient_id}/balance: get: operationId: getRecipientBalance tags: - Recipients summary: Get recipient balance parameters: - $ref: '#/components/parameters/RecipientId' responses: '200': description: The recipient balance content: application/json: schema: $ref: '#/components/schemas/Balance' /recipients/{recipient_id}/transfers: post: operationId: createTransfer tags: - Transfers summary: Create transfer description: Creates a transfer (withdrawal) from a recipient balance to its bank account. parameters: - $ref: '#/components/parameters/RecipientId' requestBody: required: true content: application/json: schema: type: object required: [amount] properties: amount: type: integer description: Amount in cents. responses: '200': description: The created transfer content: application/json: schema: $ref: '#/components/schemas/Transfer' get: operationId: listTransfers tags: - Transfers summary: List transfers parameters: - $ref: '#/components/parameters/RecipientId' - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Size' responses: '200': description: A list of transfers content: application/json: schema: $ref: '#/components/schemas/TransferList' /recipients/{recipient_id}/transfers/{transfer_id}: get: operationId: getTransfer tags: - Transfers summary: Get transfer parameters: - $ref: '#/components/parameters/RecipientId' - $ref: '#/components/parameters/TransferId' responses: '200': description: The transfer content: application/json: schema: $ref: '#/components/schemas/Transfer' /recipients/{recipient_id}/anticipations: post: operationId: createAnticipation tags: - Anticipations summary: Create anticipation description: Requests an advance (anticipation) of a recipient's future receivables. parameters: - $ref: '#/components/parameters/RecipientId' requestBody: required: true content: application/json: schema: type: object required: [amount, timeframe, payment_date] properties: amount: type: integer timeframe: type: string enum: [start, end] payment_date: type: string format: date-time responses: '200': description: The created anticipation content: application/json: schema: $ref: '#/components/schemas/Anticipation' get: operationId: listAnticipations tags: - Anticipations summary: List anticipations parameters: - $ref: '#/components/parameters/RecipientId' - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Size' responses: '200': description: A list of anticipations content: application/json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/Anticipation' components: securitySchemes: basicAuth: type: http scheme: basic description: HTTP Basic auth with the account secret key as the username and an empty password. parameters: Page: name: page in: query schema: type: integer default: 1 Size: name: size in: query schema: type: integer default: 10 OrderId: name: order_id in: path required: true schema: type: string ChargeId: name: charge_id in: path required: true schema: type: string CustomerId: name: customer_id in: path required: true schema: type: string CardId: name: card_id in: path required: true schema: type: string PlanId: name: plan_id in: path required: true schema: type: string SubscriptionId: name: subscription_id in: path required: true schema: type: string InvoiceId: name: invoice_id in: path required: true schema: type: string RecipientId: name: recipient_id in: path required: true schema: type: string TransferId: name: transfer_id in: path required: true schema: type: string schemas: CreateOrderRequest: type: object required: - items - payments properties: code: type: string description: Merchant order identifier. customer_id: type: string customer: $ref: '#/components/schemas/CreateCustomerRequest' items: type: array items: $ref: '#/components/schemas/OrderItem' payments: type: array items: $ref: '#/components/schemas/Payment' shipping: $ref: '#/components/schemas/Shipping' closed: type: boolean metadata: type: object additionalProperties: type: string OrderItem: type: object properties: amount: type: integer description: Unit amount in cents. description: type: string quantity: type: integer code: type: string Payment: type: object properties: payment_method: type: string enum: [credit_card, debit_card, boleto, pix] amount: type: integer credit_card: $ref: '#/components/schemas/CreditCardPayment' boleto: $ref: '#/components/schemas/BoletoPayment' pix: $ref: '#/components/schemas/PixPayment' split: type: array items: $ref: '#/components/schemas/Split' CreditCardPayment: type: object properties: installments: type: integer statement_descriptor: type: string card_id: type: string card_token: type: string card: $ref: '#/components/schemas/CardInput' BoletoPayment: type: object properties: instructions: type: string due_at: type: string format: date-time PixPayment: type: object properties: expires_in: type: integer description: Expiration in seconds. additional_information: type: array items: type: object properties: name: type: string value: type: string Split: type: object properties: amount: type: integer recipient_id: type: string type: type: string enum: [flat, percentage] options: type: object properties: charge_processing_fee: type: boolean liable: type: boolean Shipping: type: object properties: amount: type: integer description: type: string recipient_name: type: string address: $ref: '#/components/schemas/Address' Order: type: object properties: id: type: string code: type: string amount: type: integer currency: type: string status: type: string customer: $ref: '#/components/schemas/Customer' items: type: array items: $ref: '#/components/schemas/OrderItem' charges: type: array items: $ref: '#/components/schemas/Charge' created_at: type: string format: date-time OrderList: type: object properties: data: type: array items: $ref: '#/components/schemas/Order' paging: $ref: '#/components/schemas/Paging' Charge: type: object properties: id: type: string code: type: string amount: type: integer paid_amount: type: integer status: type: string enum: [pending, paid, canceled, processing, failed, overpaid, underpaid] currency: type: string payment_method: type: string order_id: type: string customer: $ref: '#/components/schemas/Customer' last_transaction: type: object additionalProperties: true created_at: type: string format: date-time ChargeList: type: object properties: data: type: array items: $ref: '#/components/schemas/Charge' paging: $ref: '#/components/schemas/Paging' CreateCustomerRequest: type: object properties: name: type: string email: type: string format: email document: type: string description: CPF or CNPJ. document_type: type: string enum: [CPF, CNPJ, PASSPORT] type: type: string enum: [individual, company] phones: type: object properties: home_phone: $ref: '#/components/schemas/Phone' mobile_phone: $ref: '#/components/schemas/Phone' address: $ref: '#/components/schemas/Address' Customer: allOf: - $ref: '#/components/schemas/CreateCustomerRequest' - type: object properties: id: type: string created_at: type: string format: date-time CustomerList: type: object properties: data: type: array items: $ref: '#/components/schemas/Customer' paging: $ref: '#/components/schemas/Paging' Phone: type: object properties: country_code: type: string area_code: type: string number: type: string Address: type: object properties: line_1: type: string line_2: type: string zip_code: type: string city: type: string state: type: string country: type: string description: ISO 3166-1 alpha-2 country code. CardInput: type: object properties: number: type: string holder_name: type: string exp_month: type: integer exp_year: type: integer cvv: type: string billing_address: $ref: '#/components/schemas/Address' CreateCardRequest: type: object properties: number: type: string holder_name: type: string exp_month: type: integer exp_year: type: integer cvv: type: string token: type: string billing_address: $ref: '#/components/schemas/Address' Card: type: object properties: id: type: string first_six_digits: type: string last_four_digits: type: string brand: type: string holder_name: type: string exp_month: type: integer exp_year: type: integer status: type: string type: type: string created_at: type: string format: date-time CardList: type: object properties: data: type: array items: $ref: '#/components/schemas/Card' paging: $ref: '#/components/schemas/Paging' CreateTokenRequest: type: object properties: type: type: string enum: [card] card: $ref: '#/components/schemas/CardInput' Token: type: object properties: id: type: string type: type: string card: $ref: '#/components/schemas/Card' expires_at: type: string format: date-time CreatePlanRequest: type: object required: - name - interval - interval_count properties: name: type: string description: type: string interval: type: string enum: [day, week, month, year] interval_count: type: integer billing_type: type: string enum: [prepaid, postpaid, exact_day] payment_methods: type: array items: type: string enum: [credit_card, boleto, pix] installments: type: array items: type: integer items: type: array items: $ref: '#/components/schemas/PlanItem' currency: type: string PlanItem: type: object properties: name: type: string quantity: type: integer pricing_scheme: $ref: '#/components/schemas/PricingScheme' PricingScheme: type: object properties: scheme_type: type: string enum: [unit, package, volume, tier] price: type: integer Plan: allOf: - $ref: '#/components/schemas/CreatePlanRequest' - type: object properties: id: type: string status: type: string created_at: type: string format: date-time PlanList: type: object properties: data: type: array items: $ref: '#/components/schemas/Plan' paging: $ref: '#/components/schemas/Paging' CreateSubscriptionRequest: type: object properties: plan_id: type: string code: type: string payment_method: type: string enum: [credit_card, boleto, pix] customer_id: type: string customer: $ref: '#/components/schemas/CreateCustomerRequest' card_id: type: string card_token: type: string interval: type: string enum: [day, week, month, year] interval_count: type: integer billing_type: type: string enum: [prepaid, postpaid, exact_day] items: type: array items: $ref: '#/components/schemas/PlanItem' Subscription: type: object properties: id: type: string code: type: string status: type: string payment_method: type: string interval: type: string interval_count: type: integer plan: $ref: '#/components/schemas/Plan' customer: $ref: '#/components/schemas/Customer' current_cycle: type: object additionalProperties: true created_at: type: string format: date-time SubscriptionList: type: object properties: data: type: array items: $ref: '#/components/schemas/Subscription' paging: $ref: '#/components/schemas/Paging' Invoice: type: object properties: id: type: string amount: type: integer status: type: string enum: [pending, paid, canceled, scheduled, failed] payment_method: type: string subscription_id: type: string customer: $ref: '#/components/schemas/Customer' charge: $ref: '#/components/schemas/Charge' due_at: type: string format: date-time created_at: type: string format: date-time InvoiceList: type: object properties: data: type: array items: $ref: '#/components/schemas/Invoice' paging: $ref: '#/components/schemas/Paging' CreateRecipientRequest: type: object required: - name - email - document properties: name: type: string email: type: string format: email description: type: string document: type: string type: type: string enum: [individual, corporation] default_bank_account: $ref: '#/components/schemas/BankAccount' transfer_settings: type: object properties: transfer_enabled: type: boolean transfer_interval: type: string enum: [Daily, Weekly, Monthly] transfer_day: type: integer BankAccount: type: object properties: holder_name: type: string holder_type: type: string enum: [individual, company] holder_document: type: string bank: type: string description: Bank code (e.g. 341). branch_number: type: string branch_check_digit: type: string account_number: type: string account_check_digit: type: string type: type: string enum: [checking, savings] Recipient: type: object properties: id: type: string name: type: string email: type: string document: type: string type: type: string status: type: string default_bank_account: $ref: '#/components/schemas/BankAccount' created_at: type: string format: date-time RecipientList: type: object properties: data: type: array items: $ref: '#/components/schemas/Recipient' paging: $ref: '#/components/schemas/Paging' Balance: type: object properties: currency: type: string available_amount: type: integer waiting_funds_amount: type: integer transferred_amount: type: integer recipient_id: type: string Transfer: type: object properties: id: type: string amount: type: integer status: type: string type: type: string source_id: type: string source_type: type: string target_id: type: string target_type: type: string bank_account: $ref: '#/components/schemas/BankAccount' created_at: type: string format: date-time TransferList: type: object properties: data: type: array items: $ref: '#/components/schemas/Transfer' paging: $ref: '#/components/schemas/Paging' Anticipation: type: object properties: id: type: string amount: type: integer net_amount: type: integer fee: type: integer status: type: string timeframe: type: string enum: [start, end] payment_date: type: string format: date-time created_at: type: string format: date-time Paging: type: object properties: total: type: integer page: type: integer size: type: integer Error: type: object properties: message: type: string errors: type: object additionalProperties: type: array items: type: string