Skip to main content
POST
/
v2
/
transactions
Create a Transaction
curl --request POST \
  --url https://api.pagou.ai/v2/transactions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 123,
  "method": "pix",
  "buyer": {
    "id": 0,
    "name": "<string>",
    "email": "jsmith@example.com",
    "phone": "<string>",
    "birth_date": "<string>",
    "document": {
      "type": "CPF",
      "number": "<string>"
    },
    "address": {
      "street": "<string>",
      "city": "<string>",
      "number": "<string>",
      "complement": "<string>",
      "neighborhood": "<string>",
      "state": "<string>",
      "zipCode": "<string>",
      "country": "BR"
    }
  },
  "products": [
    {
      "name": "<string>",
      "price": 4503599627370495,
      "quantity": 1,
      "tangible": false,
      "sku": "<string>"
    }
  ],
  "external_ref": "<string>",
  "currency": "BRL",
  "installments": 6,
  "token": "<string>",
  "notify_url": "<string>",
  "metadata": "<string>",
  "traceable": false,
  "ip_address": "127.0.0.1"
}
'
{
  "success": true,
  "requestId": "<string>",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "amount": 4503599627370546,
    "currency": "BRL",
    "buyer": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "email": "jsmith@example.com",
      "phone": "<string>",
      "birth_date": "<string>",
      "document": {
        "type": "CPF",
        "number": "<string>"
      },
      "address": {
        "street": "<string>",
        "city": "<string>",
        "country": "BR",
        "number": "<string>",
        "complement": "<string>",
        "neighborhood": "<string>",
        "state": "<string>",
        "zipCode": "<string>"
      }
    },
    "fee": {
      "net_amount": 4503599627370495,
      "estimated_fee": 4503599627370495
    },
    "informations": [
      {
        "key": "<string>",
        "value": "<string>"
      }
    ],
    "paid_amount": 4503599627370546,
    "method": "pix",
    "refunded_amount": 4503599627370495,
    "products": [
      {
        "name": "<string>",
        "price": 4503599627370495,
        "quantity": 4503599627370496
      }
    ],
    "traceable": true,
    "splits": [
      {
        "recipient_id": 0,
        "amount": 4503599627370496,
        "charge_processing_fee": true
      }
    ],
    "status": "authorized",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "voucher": {
      "barcode": "<string>",
      "digitable_line": "<string>",
      "url": "<string>",
      "expiration_date": "2023-11-07T05:31:56Z",
      "instructions": "<string>",
      "receipt_url": "<string>"
    },
    "external_ref": "<string>",
    "installments": 6,
    "paid_at": "2023-11-07T05:31:56Z",
    "pix": {
      "qr_code": "<string>",
      "expiration_date": "2023-11-07T05:31:56Z",
      "end_to_end_id": "<string>",
      "receipt_url": "<string>"
    },
    "metadata": {},
    "ip_address": "127.0.0.1",
    "next_action": {
      "type": "three_ds_challenge",
      "challenge_session_id": "<string>",
      "client_secret": "<string>",
      "expires_at": "2023-11-07T05:31:56Z"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
amount
integer
required
Required range: x <= 100000000
method
enum<string>
default:pix
required

Payment method to be used for the transaction.

Available options:
pix,
credit_card
buyer
object
required

Buyer information for the transaction.

products
object[]
required

List of products associated with the transaction.

Minimum array length: 1
external_ref
string | null

Optional idempotency key or external reference from your system.

currency
enum<string>
default:BRL

Transaction currency. Defaults to BRL.

Available options:
BRL
installments
integer | null

Number of installments for the transaction when applicable.

Required range: 1 <= x <= 12
token
string

Optional payment token for card transactions, starting with 'pgct_' prefix.

Pattern: ^pgct_.*
notify_url
string<uri> | null

Optional HTTPS URL to receive webhooks for this transaction.

metadata
string | null

Optional metadata string for your own reference.

traceable
boolean
default:false

Whether the transaction should be traceable for fraud or risk analysis.

ip_address

IPv4 or IPv6 address of the buyer or request origin.

Pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$

Response

HTTP 201 response

success
boolean
required
requestId
string
required
data
object
required