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

# Criar link de pagamento

> Cria um link reutilizável com checkout hospedado GoatPay.

<Note>
  **URL:** `POST https://api.goatpay.com.br/v1/payment-links/create` · Permissão: `payment-links/create`
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://api.goatpay.com.br/v1/payment-links/create' \
    -H 'X-API-Key: gp_live_SUA_CHAVE' \
    -H 'Content-Type: application/json' \
    -d '{
      "name": "Plano Pro",
      "slug": "plano-pro",
      "description": "Assinatura mensal",
      "fixedAmount": 99.90,
      "allowedMethods": ["PIX", "CRYPTO"],
      "requireEmail": true
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "message": "Link de pagamento criado",
    "data": {
      "id": "clx_link",
      "name": "Plano Pro",
      "publicCode": "abc12",
      "slug": "plano-pro",
      "fixedAmount": 99.9,
      "allowedMethods": ["PIX", "CRYPTO"],
      "status": "ACTIVE",
      "payPageUrl": "https://pay.goatpay.com.br/pay/abc12/plano-pro",
      "checkoutPath": "/pay/abc12/plano-pro"
    },
    "requestId": "req_abc"
  }
  ```
</ResponseExample>

### Corpo

<ParamField body="name" type="string" required>Nome interno do link.</ParamField>
<ParamField body="slug" type="string" required>Identificador na URL (único na plataforma).</ParamField>
<ParamField body="allowedMethods" type="string[]" required>`PIX` ou `CRYPTO` (um ou ambos).</ParamField>
<ParamField body="fixedAmount" type="number">Valor fixo em BRL. Omita para valor aberto no checkout.</ParamField>
<ParamField body="payerCoversFee" type="boolean">Cliente absorve taxas GoatPay.</ParamField>

Guia: [Links de pagamento](/api-reference/guides/loja#links-de-pagamento) · [Loja](/api-reference/guides/loja).


## OpenAPI

````yaml POST /payment-links/create
openapi: 3.1.0
info:
  title: GoatPay API
  description: >
    API pública merchant da GoatPay. Autenticação via header `X-API-Key:
    gp_live_...`.

    Respostas de sucesso usam o envelope `{ success, message, data, requestId
    }`.

    Campos internos (`accountId`, `metadata`, histórico de entregas de webhook,
    etc.) não são expostos.

    `providerTransactionId` aparece como `referenceId`; `providerInfractionId`
    como `infractionId`.

    Rate limit global: 100 requisições por minuto por API key (HTTP 429). Sem
    chave, limite por IP.
  version: 1.0.0
servers:
  - url: https://api.goatpay.com.br/v1
    description: Produção
security:
  - apiKeyAuth: []
tags:
  - name: pix
    description: >-
      Cobranças PIX (receber), reembolsos de depósito recebido e transferências
      PIX (enviar). Alias legado em payouts/* para envios.
  - name: transfer-internal
    description: Transferências entre contas GoatPay
  - name: transfer-scheduled
    description: Transferências programadas (agendar, repetir ou por saldo)
  - name: crypto
    description: Depósitos e transferências em criptomoeda
  - name: billings
    description: >-
      Cobranças avulsas (pagamento único) — boleto, cartão ou PIX na Conta
      Padrão (PF ou PJ)
  - name: subscriptions
    description: >-
      Assinaturas recorrentes com ciclo fixo — boleto, cartão ou PIX na Conta
      Padrão (PF ou PJ)
  - name: account
    description: Saldo e extrato
  - name: subaccount
    description: Subcontas merchant (carteiras lógicas sob a conta principal)
  - name: meds
    description: Disputas MED
  - name: webhooks
    description: Endpoints de webhook de saída
  - name: payouts
    description: Alias de transfer-pix para saques PIX
  - name: customers
    description: Clientes da loja (CRM)
  - name: products
    description: Produtos e entregas digitais
  - name: coupons
    description: Cupons de desconto para links
  - name: payment-links
    description: Links de pagamento e checkout hospedado
paths:
  /payment-links/create:
    post:
      tags:
        - payment-links
      summary: Criar link de pagamento
      operationId: createPaymentLink
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentLink'
      responses:
        '200':
          $ref: '#/components/responses/PaymentLinkSuccess'
components:
  schemas:
    CreatePaymentLink:
      type: object
      required:
        - name
        - slug
        - allowedMethods
      properties:
        name:
          type: string
        slug:
          type: string
        description:
          type: string
        fixedAmount:
          type: number
          minimum: 0.01
        allowedMethods:
          type: array
          minItems: 1
          items:
            type: string
            enum:
              - PIX
              - CRYPTO
        requireName:
          type: boolean
        requireDocument:
          type: boolean
        requireEmail:
          type: boolean
        requirePhone:
          type: boolean
        customerMode:
          type: string
          enum:
            - NONE
            - OPTIONAL
            - REQUIRED
        payerCoversFee:
          type: boolean
        productIds:
          type: array
          items:
            type: string
    PublicPaymentLink:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        publicCode:
          type: string
        fixedAmount:
          type:
            - number
            - 'null'
        allowedMethods:
          type: array
          items:
            type: string
        status:
          type: string
        payPageUrl:
          type: string
        checkoutPath:
          type: string
  responses:
    PaymentLinkSuccess:
      description: Link de pagamento.
      content:
        application/json:
          schema:
            type: object
            required:
              - success
              - message
              - data
            properties:
              success:
                type: boolean
              message:
                type: string
              data:
                $ref: '#/components/schemas/PublicPaymentLink'
              requestId:
                type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Chave `gp_live_...` criada em Integrações → Chaves de API no dashboard.

````