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

# Post apitoken standardv0registrars registrytransfer instructionv1transfer factory

> Get the factory and choice context for executing a direct transfer.




## OpenAPI

````yaml /registry/apis/open-api-specs/utility-token-standard/v1/transfer-instruction-v1.yaml post /api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v1/transfer-factory
openapi: 3.0.0
info:
  title: transfer instruction off-ledger API
  description: >
    This is a fork of the official Open API spec defined as part of CIP 56.


    The only difference is in the URL prefix, which explicitly requires setting
    the `registrarParty` path parameter.


    This spec should not be used for client-side code generation, use the
    official one instead.
  version: 1.0.0
servers:
  - url: https://api.utilities.digitalasset.com
    description: MainNet
  - url: https://api.utilities.digitalasset-staging.com
    description: TestNet
  - url: https://api.utilities.digitalasset-dev.com
    description: DevNet
  - url: http://localhost:8080
    description: Local
security: []
paths:
  /api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v1/transfer-factory:
    post:
      tags:
        - public
      description: |
        Get the factory and choice context for executing a direct transfer.
      operationId: getTransferFactory
      parameters:
        - name: registrarParty
          description: The registrar party.
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetFactoryRequest'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferFactoryWithChoiceContext'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    GetFactoryRequest:
      type: object
      properties:
        choiceArguments:
          type: object
          description: >
            The arguments that are intended to be passed to the choice provided
            by the factory.

            To avoid repeating the Daml type definitions, they are specified as
            JSON objects.

            However the concrete format is given by how the choice arguments are
            encoded using the Daml JSON API

            (with the `extraArgs.context` and `extraArgs.meta` fields set to the
            empty object).


            The choice arguments are provided so that the registry can also
            provide choice-argument

            specific contracts, e.g., the configuration for a specific
            instrument-id.
        excludeDebugFields:
          description: If set to true, the response will not include debug fields.
          default: false
          type: boolean
      required:
        - choiceArguments
    TransferFactoryWithChoiceContext:
      description: >
        The transfer factory contract together with the choice context required
        to exercise the choice

        provided by the factory. Typically used to implement the generic
        initiation of on-ledger workflows

        via a Daml interface.


        Clients SHOULD avoid reusing the same `FactoryWithChoiceContext` for
        exercising multiple choices,

        as the choice context MAY be specific to the choice being exercised.
      type: object
      properties:
        factoryId:
          description: The contract ID of the contract implementing the factory interface.
          type: string
        transferKind:
          description: >
            The kind of transfer workflow that will be used:

            * `offer`: offer a transfer to the receiver and only transfer if
            they accept

            * `direct`: transfer directly to the receiver without asking them
            for approval.
              Only chosen if the receiver has pre-approved direct transfers.
            * `self`: a self-transfer where the sender and receiver are the same
            party.
              No approval is required, and the transfer is typically immediate.
          type: string
          enum:
            - self
            - direct
            - offer
        choiceContext:
          $ref: '#/components/schemas/ChoiceContext'
      required:
        - factoryId
        - choiceContext
        - transferKind
    ChoiceContext:
      description: >
        The context required to exercise a choice on a contract via an
        interface.

        Used to retrieve additional reference data that is passed in via
        disclosed contracts,

        which are in turn referred to via their contract ID in the
        `choiceContextData`.
      type: object
      properties:
        choiceContextData:
          description: The additional data to use when exercising the choice.
          type: object
        disclosedContracts:
          description: >
            The contracts that are required to be disclosed to the participant
            node for exercising

            the choice.
          type: array
          items:
            $ref: '#/components/schemas/DisclosedContract'
      required:
        - choiceContextData
        - disclosedContracts
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    DisclosedContract:
      type: object
      properties:
        templateId:
          type: string
        contractId:
          type: string
        createdEventBlob:
          type: string
        synchronizerId:
          description: >
            The synchronizer to which the contract is currently assigned.

            If the contract is in the process of being reassigned, then a "409"
            response is returned.
          type: string
        debugPackageName:
          description: >
            The name of the Daml package that was used to create the contract.

            Use this data only if you trust the provider, as it might not match
            the data in the

            `createdEventBlob`.
          type: string
        debugPayload:
          description: >
            The contract arguments that were used to create the contract.

            Use this data only if you trust the provider, as it might not match
            the data in the

            `createdEventBlob`.
          type: object
        debugCreatedAt:
          description: >
            The ledger effective time at which the contract was created.

            Use this data only if you trust the provider, as it might not match
            the data in the

            `createdEventBlob`.
          type: string
          format: date-time
      required:
        - templateId
        - contractId
        - createdEventBlob
        - synchronizerId
  responses:
    '400':
      description: bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '404':
      description: not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '500':
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````