> ## Documentation Index
> Fetch the complete documentation index at: https://developers.squads.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Payment Intent

> Create a payment intent for various transfer types

## Fee Config Breaking Change

<Warning>
  The `fee_config` field is required for non-enterprise tier customers. Requests without it return a `missing_fee_config` error.
</Warning>

### Migration

Add `fee_config` to your `create_payment_intent` request body:

```json theme={null}
{
  "source": { "type": "smart_account" },
  "destination": { "address": "<DESTINATION>", "network": "solana" },
  "amount": "1000000",
  "currency": "usdc",
  "fee_config": {
    "currency": "sol",
    "payer_address": "<PUBKEY_THAT_WILL_PAY_THE_FEE>"
  }
}
```

<ParamField body="fee_config" type="object" required>
  Fee configuration specifying who pays the transaction fee and in which currency.

  <Expandable title="fee_config properties">
    <ParamField body="currency" type="string" required>
      Token used to pay the transaction fee. Accepted values: `sol`, `usdc`.
    </ParamField>

    <ParamField body="payer_address" type="string" required>
      Public key of the account that pays the fee.
    </ParamField>
  </Expandable>
</ParamField>

### How Fees Work

1. You submit a payment intent with `fee_config`.
2. The API builds the transaction and calculates the fee (compute, signatures, and ATA rent if needed).
3. A repayment instruction is appended that transfers the fee from `payer_address` to the paymaster.
4. The response includes a `fee` object with the exact amount charged.

### Fee Payer Signing

The `payer_address` **must sign the transaction**. The API automatically adds it as a required signer.

* **SOL fees**: The payer needs enough SOL to cover the fee.
* **USDC fees**: The payer needs enough USDC in their associated token account.

### Response

When `fee_config` is provided, the response includes a `fee` field:

<ResponseField name="fee" type="object">
  Breakdown of the transaction fee charged.

  <Expandable title="fee properties">
    <ResponseField name="amount" type="string">
      Fee amount in the smallest unit of the fee currency.
    </ResponseField>

    <ResponseField name="amount_decimal" type="string">
      Human-readable fee amount.
    </ResponseField>

    <ResponseField name="currency" type="string">
      Fee currency (`sol` or `usdc`).
    </ResponseField>

    <ResponseField name="sol_equivalent" type="object">
      Fee expressed in SOL for reference.

      <Expandable title="sol_equivalent properties">
        <ResponseField name="amount" type="string">
          SOL amount in lamports.
        </ResponseField>

        <ResponseField name="amount_decimal" type="string">
          Human-readable SOL amount.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

### Errors

<Note>
  `missing_fee_config` — Request has no `fee_config` (required for non-enterprise tier).
</Note>


## OpenAPI

````yaml POST /api/grid/v1/accounts/{address}/payment-intent
openapi: 3.1.0
info:
  title: Grid v1 API
  description: Grid v1 REST API for Solana-based smart account system
  contact:
    name: Grid API Support
    url: https://squads.so
    email: support@squads.so
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://grid.squads.xyz
    description: Production server
security:
  - bearer_auth: []
tags:
  - name: accounts
    description: Smart account management operations
  - name: spending-limits
    description: Spending limit management
  - name: standing-orders
    description: Standing order operations
  - name: transactions
    description: Transaction management
  - name: trade
    description: Trade operations and management
  - name: payments
    description: Payment intent operations
  - name: passkeys
    description: Passkey management
  - name: kyc
    description: Know Your Customer operations
  - name: external-accounts
    description: External bank account management
  - name: virtual-accounts
    description: Virtual account management
  - name: auth
    description: Authentication operations
  - name: proposals
    description: Proposal management for multi-sig operations
  - name: compliance
    description: Compliance entity management and KYB/KYC operations
paths:
  /api/grid/v1/accounts/{address}/payment-intent:
    post:
      tags:
        - payments
      summary: Create a payment intent
      description: >-
        Create a payment intent for transferring funds between accounts and
        external payment rails
      operationId: handler
      parameters:
        - name: address
          in: path
          description: Smart account address
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentIntentRequestPayload'
        required: true
      responses:
        '200':
          description: Payment intent created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePaymentIntentResponsePayload'
        '400':
          description: Invalid request parameters
        '404':
          description: Smart account not found
        '500':
          description: Internal server error
      security:
        - bearer_auth: []
components:
  schemas:
    CreatePaymentIntentRequestPayload:
      type: object
      required:
        - amount
        - source
        - destination
      properties:
        amount:
          type: string
        destination:
          $ref: '#/components/schemas/Details'
        fee_config:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FeeConfigV2'
        source:
          $ref: '#/components/schemas/Details'
    CreatePaymentIntentResponsePayload:
      type: object
      required:
        - id
        - payment_rail
        - amount
        - currency
        - source
        - destination
        - status
        - created_at
        - transaction_signers
        - valid_until
      properties:
        amount:
          type: string
        created_at:
          type: string
          format: date-time
        currency:
          type: string
        destination: {}
        fee:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FinalizedFees'
        id:
          type: string
        kms_payloads:
          type: array
          items:
            $ref: '#/components/schemas/KmsPayload'
        payment_rail:
          type: string
        source: {}
        source_deposit_instructions: {}
        status:
          type: string
        threshold:
          type:
            - integer
            - 'null'
          format: int32
        transaction:
          type:
            - string
            - 'null'
        transaction_signers:
          type: array
          items:
            type: string
        valid_until:
          type: string
          format: date-time
    Details:
      oneOf:
        - $ref: '#/components/schemas/NewExternalAccountDetails'
        - $ref: '#/components/schemas/ExistingExternalAccountDetails'
        - $ref: '#/components/schemas/GridAccountDetails'
        - $ref: '#/components/schemas/SolanaDetails'
    FeeConfigV2:
      type: object
      required:
        - currency
        - payer_address
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        payer_address:
          type: string
        self_managed_fees:
          type:
            - boolean
            - 'null'
    FinalizedFees:
      type: object
      required:
        - amount
        - amount_decimal
        - currency
        - sol_equivalent
      properties:
        amount:
          type: string
        amount_decimal:
          type: string
        currency:
          $ref: '#/components/schemas/Currency'
        sol_equivalent:
          $ref: '#/components/schemas/SolEquivalent'
    KmsPayload:
      type: object
      required:
        - provider
        - address
        - payload
      properties:
        address:
          type: string
        payload:
          type: string
        provider:
          $ref: '#/components/schemas/GridMPCProvider'
    NewExternalAccountDetails:
      type: object
      required:
        - payment_rail
        - currency
        - details
      properties:
        currency:
          type: string
        details: {}
        payment_rail:
          type: string
    ExistingExternalAccountDetails:
      type: object
      required:
        - payment_rail
        - currency
        - external_account_id
      properties:
        currency:
          type: string
        external_account_id:
          type: string
        payment_rail:
          type: string
    GridAccountDetails:
      type: object
      required:
        - account
        - currency
      properties:
        account:
          type: string
        currency:
          type: string
        transaction_signers:
          type: array
          items:
            type: string
    SolanaDetails:
      type: object
      required:
        - currency
      properties:
        address:
          type: string
        currency:
          type: string
    Currency:
      oneOf:
        - $ref: '#/components/schemas/StandardCurrency'
        - $ref: '#/components/schemas/CustomCurrency'
    SolEquivalent:
      type: object
      required:
        - amount
        - amount_decimal
      properties:
        amount:
          type: string
        amount_decimal:
          type: string
    GridMPCProvider:
      type: string
      enum:
        - privy
        - dynamic
        - passkey
        - turnkey
        - external
    StandardCurrency:
      type: string
      enum:
        - sol
        - usdc
        - usdt
        - pyusd
        - eurc
    CustomCurrency:
      type: object
      required:
        - mint
        - decimals
      properties:
        decimals:
          type: integer
          format: int32
          minimum: 0
        mint:
          type: string
        symbol:
          type:
            - string
            - 'null'
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: Your Grid API key from the Grid Dashboard

````