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

# Create intent

> Create a payment intent



## OpenAPI

````yaml /openapi.yaml post /intent
openapi: 3.0.1
info:
  title: Push API
  version: 0.0.1
servers:
  - url: https://api.pushcash.com
    description: Production API
  - url: https://sandbox.pushcash.com
    description: Sandbox API used for developing an integration with Push
security:
  - bearer: []
tags:
  - name: user
  - name: tokenization
  - name: authorization
  - name: intent
  - name: dispute
  - name: refund
  - name: accounts
  - name: transactions
  - name: transfer
paths:
  /intent:
    post:
      tags:
        - intent
      summary: Create intent
      description: Create a payment intent
      operationId: createIntent
      parameters:
        - in: header
          name: X-Idempotency-Key
          description: >
            Setting the idempotency key header to a unique value for each
            request ensures that transactions are never duplicated. Push
            recommends storing your internal transaction identifier in this
            field.
          schema:
            type: string
            maxLength: 255
            example: f1bbb85
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIntentRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The payment intent ID
                    example: intent_sandbox_dMggQ93ZYH6DH9LBhVeijE
                  url:
                    type: string
                    description: The URL for the payment session
                required:
                  - id
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    CreateIntentRequest:
      type: object
      properties:
        redirect_url:
          type: string
          description: >
            The url to which the user will be redirected after completing the
            payment session.


            If this parameter is omitted, the UX will use `postMessage` to
            notify the wrapping browser that the payment session has been
            completed.
        webhook_url:
          type: string
          description: >
            The url to which Push will deliver webhooks for the payment intent.
            See our [Webhooks Guide](/webhooks) for details on what webhooks
            will be delivered.
        approval_mode:
          $ref: '#/components/schemas/ApprovalMode'
        direction:
          $ref: '#/components/schemas/Direction'
        user_id:
          type: string
          description: Push's unique identifier for the user
        account_id:
          type: string
          description: >-
            The settlement account which should be used for the transaction. If
            your program with Push utilizes multiple settlement accounts, this
            field is required to be set.
        amount:
          type: integer
          description: >-
            Amount for the transaction, in smallest unit of specified currency
            (ie if currency is USD, the unit would be cents)
        currency:
          $ref: '#/components/schemas/Currency'
      example:
        direction: cash_in
        user_id: user_28CJjV7P4Go5PNJvfzghiD
        account_id: account_28CJjV7P4Go5PNJvfzghiD
        amount: 1450
        currency: USD
      required:
        - user_id
        - amount
        - currency
        - direction
    error:
      description: Description of the error encountered from the API request
      type: object
    ApprovalMode:
      type: string
      description: >-
        Enable manual review of payouts or redemptions through this parameter.
        See [Manual Review](/manual-review) for details.
      enum:
        - automatic
        - manual
      x-enumDescriptions:
        automatic: >-
          (Default) The intent will be automatically approved and submitted for
          processing within the user payment session
        manual: >-
          The intent must be manually approved by the operator before being
          submitted for processing. **NOTE** Manual approval can only be used
          with `cash_out` intents.
    Direction:
      type: string
      description: |
        Direction of the payment.
        - Submit `cash_in` for deposits
        - Submit `cash_out` for withdrawals
      enum:
        - cash_in
        - cash_out
    Currency:
      type: string
      description: Currency associated with the amount
      enum:
        - USD
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````