> ## Documentation Index
> Fetch the complete documentation index at: https://fastpay-mintlify-9618a7a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quote live freight for a payment link checkout

> Public endpoint called by the payment link checkout to compute live
freight options for a destination postal code. Requires the link to be
configured with freight mode `checkout`, currency `BRL`, and at least
one physical product with dimensions and weight.

Only services in the merchant's `enabledServices` list are returned.
Results are cached for 15 minutes per (link, postal code, items).

The buyer then sends the chosen `serviceId` as `freightServiceId` when
creating the charge. The server re-quotes the same combination to
validate the price (anti-fraud) — clients cannot send
`freight_amount` or `freight_details` directly.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/payment-links/{id}/freight/quote
openapi: 3.0.0
info:
  title: FastPay API
  version: 1.0.0
  description: >-
    API for creating and managing payment charges.


    ## Authentication


    This API uses **Basic Authentication** for direct API access, such as
    creating charges.

    Use your API key as the username and an empty string as password.

    The header should be formatted as:


    `Authorization: Basic {base64(apiKey:)}`.


    For example:


    ```

    Authorization: Basic YWxleG91dG9uOiIi

    ```


    ## Webhooks


    FastPay sends webhooks to notify your application about charge status
    changes in real-time.

    Webhooks are sent via HTTP POST requests to your configured webhook
    endpoints.


    ### Webhook Events


    The following webhook events are available for charges:


    - `charge.created` - Sent when a new charge is created

    - `charge.pending` - Sent when a charge is pending payment

    - `charge.paid` - Sent when a charge is successfully paid

    - `charge.updated` - Sent when a charge is updated


    ### Webhook Payload Structure


    All webhook payloads follow this structure:


    ```json

    {
      "id": "webhook_event_id",
      "event": "charge.paid",
      "data": {
        // Complete charge object
      }
    }

    ```


    ### Webhook Delivery


    - Webhooks are sent via HTTP POST requests

    - Content-Type: `application/json`

    - Retry logic is implemented for failed deliveries

    - Webhook events are stored in the database for audit purposes

    - Delivery logs are maintained for debugging and monitoring


    ### Webhook Security


    - Webhooks are sent to pre-configured endpoints

    - Endpoints can be enabled/disabled per merchant

    - Event filtering is supported (only receive specific events)

    - Failed deliveries are retried with exponential backoff
servers:
  - url: https://api-global.fastpaybrasil.com
    description: Produção e Sandbox (diferenciados pela API key)
security: []
paths:
  /v1/payment-links/{id}/freight/quote:
    post:
      tags:
        - Payment Links
      summary: Quote live freight for a payment link checkout
      description: |-
        Public endpoint called by the payment link checkout to compute live
        freight options for a destination postal code. Requires the link to be
        configured with freight mode `checkout`, currency `BRL`, and at least
        one physical product with dimensions and weight.

        Only services in the merchant's `enabledServices` list are returned.
        Results are cached for 15 minutes per (link, postal code, items).

        The buyer then sends the chosen `serviceId` as `freightServiceId` when
        creating the charge. The server re-quotes the same combination to
        validate the price (anti-fraud) — clients cannot send
        `freight_amount` or `freight_details` directly.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: Payment link ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - postalCode
              properties:
                postalCode:
                  type: string
                  description: >-
                    Destination postal code (CEP). Accepts `00000-000` or
                    `00000000`.
                  example: 20040-020
      responses:
        '200':
          description: Freight options for this link and destination
          content:
            application/json:
              schema:
                type: object
                properties:
                  options:
                    type: array
                    items:
                      type: object
                      properties:
                        serviceId:
                          type: integer
                          example: 2
                        name:
                          type: string
                          example: SEDEX
                        company:
                          type: string
                          example: Correios
                        price:
                          type: number
                          format: float
                          example: 42.9
                        deliveryTime:
                          type: integer
                          description: Estimated delivery time in business days.
                          example: 2
                        currency:
                          type: string
                          enum:
                            - BRL
        '404':
          description: Payment link not found.
        '422':
          description: |-
            Link does not use freight mode `checkout`, is not in BRL, or has no
            physical product with dimensions/weight.

````