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

# Request Permit Data

> This endpoint returns the necessary data for a Credit token holder to create a permit signature. This permit is used to allow a third party to transfer tokens on behalf of the token holder. Once this permit is signed it is sent to the [Transfer Credit Token](/api-reference/endpoint/credit/post-credittransfer) endpoint to get a transfer transaction.

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "permitData": {
      "nonce": "123",
      "domainSeparator": "0x193363de76294f014e224981928e1e2fae58895ff731778504e61d93fc4805e8",
      "deadline": 1700766991,
      "hashToSign": "0x67a58ea20b44c0f6984a58efdd57b171fa1717dfc7cbe193dc22f5af64cd9c67"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": {
      "code": "validation_error",
      "message": "Some parameters are invalid",
      "issues": [
        {
          "code": "too_small",
          "message": "Number must be greater than 0",
          "parameter": "amount",
          "path": "amount"
        }
      ]
    }
  }
  ```

  ```JSON 404 theme={null}
  {
    "success": false,
    "error": {
      "code": "token_not_found",
      "message": "Credit token not found"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml post /credit/permit-data
openapi: 3.0.0
info:
  version: 0.1.0
  title: Openformat API
servers:
  - url: https://api.openformat.tech/v1
    description: Live server
security:
  - ApiKeyAuth: []
paths:
  /credit/permit-data:
    post:
      tags:
        - credit
        - permit
        - transfer
      description: Returns the permit data for a token transfer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                chain:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: Blockchain network to use
                  example: arbitrum-sepolia
                token_id:
                  type: string
                  description: Ethereum address of the credit token
                  example: '0xd1f09c70f6f2838a3ab6209c1465af68594667ec'
                holder_address:
                  type: string
                  description: Ethereum address of the user that holds the credit tokens
                  example: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
                receiver_address:
                  type: string
                  description: >-
                    Ethereum address of the user that will receive cthe redit
                    tokens
                  example: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
                amount:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                  description: Amount of credit tokens to transfer
                  example: 123
              required:
                - chain
                - token_id
                - holder_address
                - receiver_address
                - amount
      responses:
        '200':
          description: Permit Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                    description: Successful response
                    example: true
                  permitData:
                    type: object
                    properties:
                      nonce:
                        type: string
                        description: Permit nonce
                        example: '123'
                      domainSeparator:
                        type: string
                        description: Domain separator hashed
                        example: >-
                          0x193363de76294f014e224981928e1e2fae58895ff731778504e61d93fc4805e8
                      deadline:
                        type: number
                        minimum: 0
                        exclusiveMinimum: true
                        description: Deadline timestamp in seconds
                        example: 1700766991
                      hashToSign:
                        type: string
                        description: Hash string to be signed with holder private key
                        example: >-
                          0x67a58ea20b44c0f6984a58efdd57b171fa1717dfc7cbe193dc22f5af64cd9c67
                    required:
                      - nonce
                      - domainSeparator
                      - deadline
                      - hashToSign
                required:
                  - success
                  - permitData
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      issues:
                        type: array
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                              description: Error code for the field
                              example: invalid_type
                            path:
                              type: array
                              items:
                                type: string
                              description: Field with error
                              example:
                                - some_field
                            message:
                              type: string
                              description: Error message
                              example: Required
                          required:
                            - code
                            - path
                            - message
                        description: Error object with all validation issues
                    required:
                      - issues
                required:
                  - error
        '404':
          description: Credit token not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - failed
                    description: Failed reponse status
                    example: failed
                  error:
                    type: string
                    description: Error message
                    example: No Token found
                required:
                  - status
                  - error
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````