---
updatedAt: 2026-04-06T17:19:44.000Z
agentTools:
  projectIndex: https://docs.pagar.me/v2/llms.txt
---

# Criando um Link de Pagamento

Crie um Link de Pagamento para compartilhar com seus clientes e receber pagamentos de forma mais simples

> 🚧 Expiração
>
> Existem duas formas de definir quando um Link de Pagamento irá expirar: **expires\_at** e **expires\_in**. Estes parâmetros não podem ser enviados juntos

> 📘 Atenção
>
> É importante notar que o campo `expires_at` utiliza unixTimeStamp como valor. Para gerar o unixTimeStamp de uma data, é possível utilizar o console do Google Chrome com o seguinte código em Javascript : new Date("2018-06-03T00:32:00.000Z").getTime() que retornará 1527985920000. Substitua 2018-06-03 pela data que deseja que seu link expire

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://api.pagar.me/1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "x-default": "",
        "type": "apiKey",
        "name": "api_key",
        "in": "query"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/payment_links": {
      "post": {
        "summary": "Criando um Link de Pagamento",
        "description": "Crie um Link de Pagamento para compartilhar com seus clientes e receber pagamentos de forma mais simples",
        "operationId": "criando-um-link-de-pagamento",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount",
                  "items"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Nome para o Link de Pagamento"
                  },
                  "amount": {
                    "type": "integer",
                    "description": "Valor total a ser cobrado. Deve ser passado em centavos. Ex: R$ 10.00 = 1000. Deve ser no mínimo 1 real (100)",
                    "format": "int32"
                  },
                  "items": {
                    "type": "object",
                    "description": "Define os dados dos itens vendidos, como nome, preço unitário e quantidade (ver objeto [**items**](https://docs.pagar.me/v2017-08-28/reference#objeto-items-itens))",
                    "properties": {}
                  },
                  "payment_config": {
                    "properties": {
                      "boleto": {
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "description": "Define se o Link poderá ser pago com boleto"
                          },
                          "expires_in": {
                            "type": "integer",
                            "description": "Quantidade de dias para o vencimento do boleto",
                            "format": "int32"
                          }
                        },
                        "description": "Configurações para pagamento com boleto",
                        "required": [
                          "enabled"
                        ],
                        "type": "object"
                      },
                      "credit_card": {
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "description": "payment_config[credit_card][enabled]"
                          },
                          "free_installments": {
                            "type": "integer",
                            "description": "Quantidade de parcelas sem juros. Mínimo: 1 - Máximo: 12",
                            "format": "int32"
                          },
                          "interest_rate": {
                            "type": "number",
                            "description": "Percentual de juros aplicados. Mínimo: 0.01 - Máximo: 100",
                            "format": "double"
                          },
                          "max_installments": {
                            "type": "integer",
                            "description": "Número máximo de parcelas. Mínimo: 1 - Máximo: 12",
                            "default": 1,
                            "format": "int32"
                          }
                        },
                        "description": "Configurações para pagamento com cartão de crédito",
                        "required": [
                          "enabled"
                        ],
                        "type": "object"
                      },
                      "default_payment_method": {
                        "type": "string",
                        "description": "Método de pagamento padrão. Valores possíveis: \"boleto\" e \"credit_card\""
                      }
                    },
                    "required": [],
                    "type": "object",
                    "description": "Define as configurações de pagamento"
                  },
                  "max_orders": {
                    "type": "integer",
                    "description": "Número máximo de pedidos gerados",
                    "format": "int32"
                  },
                  "expires_at": {
                    "type": "string",
                    "description": "Data em que o Link de Pagamento irá expirar",
                    "format": "date-time"
                  },
                  "expires_in": {
                    "type": "integer",
                    "description": "Quantidade de minutos em que o Link de Pagamento irá expirar",
                    "format": "int32"
                  },
                  "postback_config": {
                    "properties": {
                      "orders": {
                        "type": "string",
                        "description": "Define a URL que receberá o postback ao mudar o status do pedido"
                      },
                      "transactions": {
                        "type": "string",
                        "description": "Define a URL que receberá o postback ao mudar o status da transação"
                      }
                    },
                    "required": [],
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"amount\": 1000,\n    \"date_created\": \"2018-08-02T14:29:47.128Z\",\n    \"date_updated\": \"2018-08-02T14:29:47.128Z\",\n    \"expires_at\": \"2018-08-02T15:29:47.126Z\",\n    \"id\": \"pl_cjkcnpnug01w3nx6d7rz1dgit\",\n    \"items\": [\n        {\n            \"category\": null,\n            \"created_at\": \"2018-08-02T14:29:47.149Z\",\n            \"date\": null,\n            \"external_id\": \"1\",\n            \"id\": \"cjkcnpnv101w4nx6djl4kz1xw\",\n            \"model\": \"payment_link\",\n            \"model_id\": \"pl_cjkcnpnug01w3nx6d7rz1dgit\",\n            \"quantity\": 1,\n            \"tangible\": true,\n            \"title\": \"Bola de futebol\",\n            \"transaction_id\": null,\n            \"unit_price\": 400,\n            \"updated_at\": \"2018-08-02T14:29:47.149Z\",\n            \"venue\": null\n        },\n        {\n            \"category\": null,\n            \"created_at\": \"2018-08-02T14:29:47.149Z\",\n            \"date\": null,\n            \"external_id\": \"a123\",\n            \"id\": \"cjkcnpnv101w5nx6d7bq9rkg3\",\n            \"model\": \"payment_link\",\n            \"model_id\": \"pl_cjkcnpnug01w3nx6d7rz1dgit\",\n            \"quantity\": 1,\n            \"tangible\": true,\n            \"title\": \"Caderno do Goku\",\n            \"transaction_id\": null,\n            \"unit_price\": 600,\n            \"updated_at\": \"2018-08-02T14:29:47.149Z\",\n            \"venue\": null\n        }\n    ],\n    \"max_orders\": 1,\n    \"object\": \"payment_link\",\n    \"payment_config\": {\n        \"boleto\": {\n            \"enabled\": true,\n            \"expires_in\": 20\n        },\n        \"credit_card\": {\n            \"enabled\": true,\n            \"free_installments\": 4,\n            \"interest_rate\": 25,\n            \"max_installments\": 12\n        },\n        \"default_payment_method\": \"boleto\"\n    },\n  \t\"postback_config\": {\n   \t\t\"orders\": \"http://postback.url/orders\",\n    \t\"transactions\": \"http://postback.url/transactions\"\n\t\t},\n    \"short_id\": \"tBJ7Dr9xSX\",\n    \"status\": \"active\",\n    \"url\": \"https://link.sandbox.pagar.me/tBJ7Dr9xSX\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "integer",
                      "example": 1000,
                      "default": 0
                    },
                    "date_created": {
                      "type": "string",
                      "example": "2018-08-02T14:29:47.128Z"
                    },
                    "date_updated": {
                      "type": "string",
                      "example": "2018-08-02T14:29:47.128Z"
                    },
                    "expires_at": {
                      "type": "string",
                      "example": "2018-08-02T15:29:47.126Z"
                    },
                    "id": {
                      "type": "string",
                      "example": "pl_cjkcnpnug01w3nx6d7rz1dgit"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "category": {},
                          "created_at": {
                            "type": "string",
                            "example": "2018-08-02T14:29:47.149Z"
                          },
                          "date": {},
                          "external_id": {
                            "type": "string",
                            "example": "1"
                          },
                          "id": {
                            "type": "string",
                            "example": "cjkcnpnv101w4nx6djl4kz1xw"
                          },
                          "model": {
                            "type": "string",
                            "example": "payment_link"
                          },
                          "model_id": {
                            "type": "string",
                            "example": "pl_cjkcnpnug01w3nx6d7rz1dgit"
                          },
                          "quantity": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "tangible": {
                            "type": "boolean",
                            "example": true,
                            "default": true
                          },
                          "title": {
                            "type": "string",
                            "example": "Bola de futebol"
                          },
                          "transaction_id": {},
                          "unit_price": {
                            "type": "integer",
                            "example": 400,
                            "default": 0
                          },
                          "updated_at": {
                            "type": "string",
                            "example": "2018-08-02T14:29:47.149Z"
                          },
                          "venue": {}
                        }
                      }
                    },
                    "max_orders": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "object": {
                      "type": "string",
                      "example": "payment_link"
                    },
                    "payment_config": {
                      "type": "object",
                      "properties": {
                        "boleto": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean",
                              "example": true,
                              "default": true
                            },
                            "expires_in": {
                              "type": "integer",
                              "example": 20,
                              "default": 0
                            }
                          }
                        },
                        "credit_card": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean",
                              "example": true,
                              "default": true
                            },
                            "free_installments": {
                              "type": "integer",
                              "example": 4,
                              "default": 0
                            },
                            "interest_rate": {
                              "type": "integer",
                              "example": 25,
                              "default": 0
                            },
                            "max_installments": {
                              "type": "integer",
                              "example": 12,
                              "default": 0
                            }
                          }
                        },
                        "default_payment_method": {
                          "type": "string",
                          "example": "boleto"
                        }
                      }
                    },
                    "postback_config": {
                      "type": "object",
                      "properties": {
                        "orders": {
                          "type": "string",
                          "example": "http://postback.url/orders"
                        },
                        "transactions": {
                          "type": "string",
                          "example": "http://postback.url/transactions"
                        }
                      }
                    },
                    "short_id": {
                      "type": "string",
                      "example": "tBJ7Dr9xSX"
                    },
                    "status": {
                      "type": "string",
                      "example": "active"
                    },
                    "url": {
                      "type": "string",
                      "example": "https://link.sandbox.pagar.me/tBJ7Dr9xSX"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X POST 'https://api.pagar.me/1/payment_links' -H 'content-type: application/json' -d '{\n  \"api_key\": \"SUA_API_KEY\",\n  \"amount\": 1000,\n  \"items\": [\n    {\n      \"id\": \"1\",\n      \"title\": \"Bola de futebol\",\n      \"unit_price\": 400,\n      \"quantity\": 1,\n      \"tangible\": true\n    },\n    {\n      \"id\": \"a123\",\n      \"title\": \"Caderno do Goku\",\n      \"unit_price\": 600,\n      \"quantity\": 1,\n      \"tangible\": true\n    }\n  ],\n  \"postback_config\": {\n   \t\"orders\": \"http://postback.url/orders\",\n    \"transactions\": \"http://postback.url/transactions\"\n\t},\n  \"payment_config\": {\n    \"boleto\": {\n      \"enabled\": true,\n      \"expires_in\": 20,\n    },\n    \"credit_card\": {\n      \"enabled\": true,\n      \"free_installments\": 4,\n      \"interest_rate\": 25,\n      \"max_installments\": 12,\n    },\n    \"default_payment_method\": \"boleto\",\n  },\n  \"max_orders\": 1,\n  \"expires_in\": 60\n}",
              "name": "cURL"
            },
            {
              "language": "php",
              "code": "<?php\nrequire(\"vendor/autoload.php\");\n$pagarme = new PagarMe\\Client('SUA_CHAVE_DE_API');\n\n$paymentLink = $pagarme->paymentLinks()->create([\n  'amount' => 10000,\n  'items' => [\n    [\n      'id' => '1',\n      'title' => \"Fighter's Sword\",\n      'unit_price' => 4000,\n      'quantity' => 1,\n      'tangible' => true,\n      'category' => 'weapon',\n      'venue' => 'A Link To The Past',\n      'date' => '1991-11-21'\n    ],\n    [\n      'id' => '2',\n      'title' => 'Kokiri Sword',\n      'unit_price' => 6000,\n      'quantity' => 1,\n      'tangible' => true,\n      'category' => 'weapon',\n      'venue' => \"Majora's Mask\",\n      'date' => '2000-04-27'\n    ],\n  ],\n  'payment_config' => [\n    'boleto' => [\n      'enabled' => true,\n      'expires_in' => 20\n    ],\n    'credit_card' => [\n      'enabled' => true,\n      'free_installments' => 4,\n      'interest_rate' => 25,\n      'max_installments' => 12\n    ],\n    'default_payment_method' => 'boleto'\n  ],\n  'max_orders' => 1,\n  'expires_in' => 60\n]);"
            },
            {
              "language": "python",
              "code": " paymentLink = pagarme.payment_link.create({\n    'amount' : 10000,\n    'items' : {\n      {\n        'id' : '1',\n        'title' : \"Fighter's Sword\",\n        'unit_price' : 4000,\n        'quantity' : 1,\n        'tangible' : true,\n        'category' : 'weapon',\n        'venue' : 'A Link To The Past',\n        'date' : '1991-11-21'\n      },\n      {\n        'id' : '2',\n        'title' : 'Kokiri Sword',\n        'unit_price' : 6000,\n        'quantity' : 1,\n        'tangible' : true,\n        'category' : 'weapon',\n        'venue' : \"Majora's Mask\",\n        'date' : '2000-04-27'\n      },\n    },\n    'payment_config' : {\n      'boleto' : {\n        'enabled' : true,\n        'expires_in' : 20\n      },\n      'credit_card' : {\n        'enabled' : true,\n        'free_installments' : 4,\n        'interest_rate' : 25,\n        'max_installments' : 12\n      },\n      'default_payment_method' : 'boleto'\n    },\n    'max_orders' : 1,\n    'expires_in' : 60\n  })\n\n  print(paymentLink)"
            },
            {
              "language": "javascript",
              "code": "pagarme.client.connect({ api_key: 'SUA_API_KEY' })\n  .then(client => client.paymentLinks.create({\n    \"amount\": 1000,\n    \"items\": [\n      {\n        \"id\": \"1\",\n        \"title\": \"Bola de futebol\",\n        \"unit_price\": 400,\n        \"quantity\": 1,\n        \"tangible\": true\n      },\n      {\n        \"id\": \"a123\",\n        \"title\": \"Caderno do Goku\",\n        \"unit_price\": 600,\n        \"quantity\": 1,\n        \"tangible\": true\n      }\n    ],\n    \"postback_config\": {\n      \"orders\": \"http://postback.url/orders\",\n      \"transactions\": \"http://postback.url/transactions\"\n    },\n    \"payment_config\": {\n      \"boleto\": {\n        \"enabled\": true,\n        \"expires_in\": 20,\n      },\n      \"credit_card\": {\n        \"enabled\": true,\n        \"free_installments\": 4,\n        \"interest_rate\": 25,\n        \"max_installments\": 12,\n      },\n      \"default_payment_method\": \"boleto\",\n    },\n     \"max_orders\": 1,\n     \"expires_in\": 60\n  }))\n  .then(paymentLinks => console.log(paymentLinks))\n  .catch(error => console.log(JSON.stringify(error)))"
            }
          ],
          "samples-languages": [
            "curl",
            "php",
            "python",
            "javascript"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```