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

# Prepare a Headless Payment

> Prepares a Solana headless transaction. Returns a payload that the payer can sign and submit.

<Info>
  **Note:** When using the production environment at [moonpay.hel.io](http://app.hel.io), set your API endpoint to `api.hel.io/v1` and generate API keys there. For the development environment, use `api.dev.hel.io/v1` and generate API keys from [moonpay.dev.hel.io](http://app.dev.hel.io).
</Info>


## OpenAPI

````yaml POST /v1/transaction/headless/prepare
openapi: 3.0.0
info:
  title: Helio Open API
  description: |-
    API schema and definitions for Helio API. <br/> 
          The API is using two types of Authentication, for dashboard endpoints we use <b>JSON Web Token (JWT)</b> that is generated by self custodial wallet signing a message from API.</br> 
          We also support authentication with <b>API Key and Secret</b> which can be generated on <a href='https://hel.io'>Helio dashboard</a>.
  version: 1.0.0
  contact: {}
servers:
  - description: Helio API (Mainnet)
    url: https://api.hel.io
  - description: Helio API (Devnet)
    url: https://api.dev.hel.io
security: []
tags:
  - name: Webhooks
  - name: Exports
  - name: Currencies
    description: >-
      Supported currencies endpoint, includes fiat and digital assets
      </br><i>Authentication: </i><b>None</b>
externalDocs:
  description: Helio product documentation
  url: https://docs.hel.io/
paths:
  /v1/transaction/headless/prepare:
    post:
      tags:
        - Headless Transactions
      summary: Prepare a Headless Payment
      description: >-
        Prepares a Solana headless transaction. Returns a payload that the payer
        can sign and submit.
      operationId: HeadlessController_prepareTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrepareHeadlessTransaction'
      responses:
        '200':
          description: The transaction was prepared successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PrepareHeadlessTransaction'
              examples:
                exportedPaymentsList:
                  summary: Example of a successful prepare transaction response
                  value:
                    transactionToken: string
                    transactionMessage: string
                    serializedTransaction: string
                    addressLookupTableAccounts:
                      - string
components:
  schemas:
    PrepareHeadlessTransaction:
      type: object
      properties:
        paymentRequestId:
          type: string
          description: The ID of the associated payment request.
        senderPublicKey:
          type: string
          description: The sender’s public key on the Solana blockchain.
        currencyId:
          type: string
          description: The identifier of the currency being used for the transaction.
        quantity:
          type: number
          description: The quantity of the selected currency.
        minimalUnitAmount:
          type: number
          description: The minimal unit amount (e.g., in lamports for Solana).
        affiliateCode:
          type: string
          description: Optional affiliate or referral code linked to the transaction.
        btcPublicKey:
          type: string
          description: Optional Bitcoin public key if BTC-related properties are included.
        customerDetails:
          type: object
          description: >-
            Details of the customer making the transaction. If the pay link is
            configured to require these fields, they are no longer optional.
          properties:
            email:
              type: string
              description: The customer’s email address.
            discordUser:
              type: object
              description: Discord user details.
              properties:
                id:
                  type: string
                  description: Discord user ID.
                username:
                  type: string
                  description: Discord username.
            twitterUsername:
              type: string
              description: Twitter username.
            telegramUser:
              type: object
              description: Telegram user details.
              properties:
                id:
                  type: number
                  description: Telegram user ID.
                username:
                  type: string
                  description: Telegram username.
            fullName:
              type: string
              description: The customer’s full name.
            country:
              type: string
              description: Country of the customer.
            state:
              type: string
              description: State of the customer.
            city:
              type: string
              description: City of the customer.
            street:
              type: string
              description: Street name.
            streetNumber:
              type: string
              description: Street number.
            areaCode:
              type: string
              description: Postal or area code.
            deliveryAddress:
              type: string
              description: Delivery address, if applicable.
            blinkAddress:
              type: string
              description: Optional Blink wallet address.
            phoneNumber:
              type: string
              description: The customer’s phone number.
            additionalJSON:
              type: string
              description: Optional additional metadata in JSON format.
            btcProperties:
              type: object
              description: Additional Bitcoin-related properties.
              properties:
                ordinalsAddress:
                  type: string
                  description: The Ordinals wallet address for inscriptions.
        productDetails:
          type: object
          description: Details of the product involved in the transaction.
          properties:
            name:
              type: string
              description: The name of the product.
            value:
              type: string
              description: The value or SKU of the product.
            active:
              type: boolean
              description: Whether the product is active.
      required:
        - paymentRequestId
        - senderPublicKey

````