> ## 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.

# Transfer Credit Token

> This is endpoint receives transfer information, a permit signature and returns an [unsigned transaction](/api-reference/architecture/transaction-lifecycle) that executes the transfer. Permit data is obtained by calling the [Request Permit Data](/api-reference/endpoint/credit/post-creditpermitdata) endpoint and it is signed using the private key of the token holder. Transfer information needs to match the used to generate the permit. The unsigned transaction should be signed using your private key and can be broadcasted using [Execute Transaction](/api-reference/endpoint/transactions/post-transactionsexecute) or [Execute Transaction and Wait](/api-reference/endpoint/transactions/post-transactionsexecuteandwait) endpoints.

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "unsignedTransaction": {
      "to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
      "data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
      "maxPriorityFeePerGas": "1020840008",
      "maxFeePerGas": "1035102698",
      "gas": "476358",
      "gasLimit": "476358",
      "nonce": 36,
      "chainId": 31337,
      "type": 2
    }
  }
  ```

  ```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/transfer
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/transfer:
    post:
      tags:
        - credit
        - permit
        - transfer
      description: Returns transaction for permit and transfer of credit tokens
      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
                deadline:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                  description: Deadline timestamp in seconds
                  example: 1700766991
                signedPermit:
                  type: object
                  properties:
                    r:
                      type: string
                      description: Value of r in signature
                      example: >-
                        0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0
                    s:
                      type: string
                      description: Value of s in signature
                      example: >-
                        0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f
                    v:
                      type: number
                      description: Value of v in signature
                      example: 28
                  required:
                    - r
                    - s
                    - v
              required:
                - chain
                - token_id
                - holder_address
                - receiver_address
                - amount
                - deadline
                - signedPermit
      responses:
        '200':
          description: Transfer transaction to sign
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                    description: Success response
                    example: true
                  unsignedTransaction:
                    nullable: true
                    description: Unsigned transaction object for the user to sign
                required:
                  - success
        '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

````