> ## Documentation Index
> Fetch the complete documentation index at: https://docs.en.amplopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Pix charge

> Create a Pix charge

Creates a Pix charge.

## Body parameters

<ParamField body="identifier" type="string" required>
  Unique identifier for this transaction in your application.
</ParamField>

<ParamField body="amount" type="number" required>
  Transaction amount in BRL.
</ParamField>

<ParamField body="client" type="object" required>
  Customer information.
</ParamField>

<ParamField body="client.name" type="string" required>
  Customer full name.
</ParamField>

<ParamField body="client.email" type="string" required>
  Customer email address.
</ParamField>

<ParamField body="client.phone" type="string" required>
  Customer phone number.
</ParamField>

<ParamField body="client.document" type="string" required>
  Customer document, such as CPF or CNPJ for Brazilian customers.
</ParamField>

<ParamField body="products" type="array">
  Products included in the transaction.
</ParamField>

<ParamField body="products[].id" type="string" required>
  Product identifier in your application.
</ParamField>

<ParamField body="products[].name" type="string" required>
  Product name.
</ParamField>

<ParamField body="products[].quantity" type="number">
  Product quantity.
</ParamField>

<ParamField body="products[].price" type="number" required>
  Product unit price in BRL.
</ParamField>

<ParamField body="products[].physical" type="boolean">
  Indicates whether the product is physical.
</ParamField>

<ParamField body="shippingFee" type="number">
  Shipping fee in BRL.
</ParamField>

<ParamField body="extraFee" type="number">
  Additional fee in BRL.
</ParamField>

<ParamField body="discount" type="number">
  Discount amount in BRL.
</ParamField>

<ParamField body="splits" type="array">
  Payment split configuration.
</ParamField>

<ParamField body="splits[].producerId" type="string" required>
  Producer ID that will receive the split amount.
</ParamField>

<ParamField body="splits[].amount" type="number" required>
  Amount sent to the split receiver, in BRL.
</ParamField>

<ParamField body="metadata" type="object">
  Free-form metadata associated with the transaction.
</ParamField>

<ParamField body="dueDate" type="string">
  Charge due date in `YYYY-MM-DD` format.
</ParamField>

<ParamField body="callbackUrl" type="string">
  URL that will receive payment status webhook notifications.
</ParamField>

## Request example

<RequestExample>
  ```bash theme={null}
  curl --request POST \
    --url https://app.amplopay.com/api/v1/gateway/pix/receive \
    --header 'Content-Type: application/json' \
    --header 'x-public-key: SUA_CHAVE_PUBLICA_AQUI' \
    --header 'x-secret-key: SUA_CHAVE_PRIVADA_AQUI' \
    --data '{
      "identifier": "pedido-123",
      "amount": 100,
      "client": {
        "name": "João da Silva",
        "email": "joao@email.com",
        "phone": "(11) 99999-9999",
        "document": "123.456.789-00"
      },
      "products": [
        {
          "id": "produto-1",
          "name": "Produto 1",
          "quantity": 1,
          "price": 100
        }
      ],
      "callbackUrl": "https://example.com/webhooks/payment"
    }'
  ```
</RequestExample>

## Payload example

```json theme={null}
{
  "identifier": "pedido-123",
  "amount": 100,
  "client": {
    "name": "João da Silva",
    "email": "joao@email.com",
    "phone": "(11) 99999-9999",
    "document": "123.456.789-00"
  },
  "products": [
    {
      "id": "produto-1",
      "name": "Produto 1",
      "quantity": 1,
      "price": 100
    }
  ],
  "callbackUrl": "https://example.com/webhooks/payment"
}
```

## Response

<ResponseField name="transactionId" type="string" required>
  Transaction ID generated by the Gateway API.
</ResponseField>

<ResponseField name="status" type="string" required>
  Initial transaction status.
</ResponseField>

<ResponseField name="fee" type="number" required>
  Transaction fee amount.
</ResponseField>

<ResponseField name="order" type="object" required>
  Order information and hosted order URL.
</ResponseField>

<ResponseField name="pix" type="object" required>
  Pix payment information.
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "transactionId": "clwuwmn4i0007emp9lgn66u1h",
    "status": "OK",
    "fee": 2.5,
    "order": {
      "id": "cm92389asdaskdjkasjdka",
      "url": "https://app.amplopay.com/order/cm92389asdaskdjkasjdka",
      "receiptUrl": "https://app.amplopay.com/order/cm92389asdaskdjkasjdka/receipt"
    },
    "pix": {
      "code": "00020101021126530014BR.GOV.BCB.PIX...",
      "image": "https://app.amplopay.com/api/v1/pix/qr/000201...",
      "base64": ""
    }
  }
  ```
</ResponseExample>

## QR Code note

The Pix `base64` field is deprecated and returns an empty string. Render the QR Code from the `qrCode` or `code` field, depending on the endpoint response.
