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

# Specify Recipient

> Select where purchased items should be delivered in Headless Checkout

<Snippet file="specify-recipient-common.mdx" />

## Specifying the Recipient

For Headless Checkout, you specify the recipient when creating or updating an order.

### Recipient by Email

When specifying a recipient by email, Crossmint will automatically create a secure custodial wallet on the fly for that email address:

<Tabs>
  <Tab title="Create Order">
    ```json {4} theme={null}
    POST /api/2022-06-09/orders
    {
      "recipient": {
        "email": "user@example.com" // Email address of the recipient
      },
      "locale": "en-US",
      "payment": {
        "method": "ethereum-sepolia",
        "currency": "eth",
        "payerAddress": "0x1234abcd...",
        "receiptEmail": "user@example.com"
      },
      "lineItems": [
        {
          "collectionLocator": "crossmint:cosdahdasda",
          "callData": {
            "totalPrice": "0.0001",
            "quantity": 1
          }
        }
      ]
    }
    ```
  </Tab>

  <Tab title="Edit Order">
    ```json {4} theme={null}
    PATCH /api/2022-06-09/orders/{orderId}
    {
      "recipient": {
        "email": "user@example.com" // Email address of the recipient
      }
    }
    ```
  </Tab>
</Tabs>

The recipient will be able to access their purchased items by logging into their Crossmint wallet in [staging](https://staging.crossmint.com/user/collection) or [mainnet](https://www.crossmint.com/user/collection).

### Recipient by Wallet Address

To deliver items directly to a specific blockchain wallet address:

<Tabs>
  <Tab title="Create Order">
    <CodeGroup>
      ```json {4} EVM theme={null}
      POST /api/2022-06-09/orders
      {
        "recipient": {
          "walletAddress": "0x1234567890abcdef1234567890abcdef12345678" // For EVM chains
        },
        "locale": "en-US",
        "payment": {
          "method": "ethereum-sepolia",
          "currency": "eth",
          "payerAddress": "0x1234abcd...",
          "receiptEmail": "user@example.com" // Required when using wallet address
        },
        "lineItems": [
          {
            "collectionLocator": "crossmint:_YOUR_EVM_COLLECTION_",
            "callData": {
              "totalPrice": "0.0001",
              "quantity": 1
            }
          }
        ]
      }
      ```

      ```json {4} Solana theme={null}
      POST /api/2022-06-09/orders
      {
        "recipient": {
          "walletAddress": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty" // For Solana
        },
        "locale": "en-US",
        "payment": {
          "method": "solana",
          "currency": "sol",
          "payerAddress": "5FHne...",
          "receiptEmail": "user@example.com" // Required when using wallet address
        },
        "lineItems": [
          {
            "collectionLocator": "crossmint:_YOUR_SOLANA_COLLECTION_",
            "callData": {
              "totalPrice": "0.0001",
              "quantity": 1
            }
          }
        ]
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Edit Order">
    <CodeGroup>
      ```json {4} EVM theme={null}
      PATCH /api/2022-06-09/orders/{orderId}
      {
        "recipient": {
          "walletAddress": "0x1234567890abcdef1234567890abcdef12345678" // For EVM chains
        }
      }
      ```

      ```json {4} Solana theme={null}
      PATCH /api/2022-06-09/orders/{orderId}
      {
        "recipient": {
          "walletAddress": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty" // For Solana
        }
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>

<Note>
  If specifying a recipient by wallet address, ensure the address is valid for the chain your collection is on, which
  may differ from the chain the payment is performed on.
</Note>

### Physical Product Recipients

<Snippet file="physical-address-format.mdx" />

When purchasing physical products, providing a physical address is required. If you don't provide it in the initial order, you can update the order it later:

<Tabs>
  <Tab title="Create Order">
    ```json {5-13, 20} theme={null}
    POST /api/2022-06-09/orders
    {
      "recipient": {
        "email": "buyer@example.com", // Email address of the recipient
        "physicalAddress": {
          "name": "John Doe",
          "line1": "123 Main St",
          "line2": "Apt 4B", // optional
          "city": "San Francisco",
          "state": "CA",
          "postalCode": "94105",
          "country": "US"
        }
      },
      "locale": "en-US",
      "payment": {
        "method": "ethereum-sepolia",
        "currency": "eth",
        "payerAddress": "0x1234abcd...",
        "receiptEmail": "buyer@example.com" // Required for physical products
      },
      "lineItems": [
        {
          "collectionLocator": "crossmint:cosdahdasda",
          "callData": {
            "totalPrice": "0.0001",
            "quantity": 1
          }
        }
      ]
    }
    ```
  </Tab>

  <Tab title="Edit Order">
    ```json {4-12} theme={null}
    PATCH /api/2022-06-09/orders/{orderId}
    {
      "recipient": {
        "physicalAddress": {
          "name": "John Doe",
          "line1": "123 Main St",
          "line2": "Apt 4B", // optional
          "city": "San Francisco",
          "state": "CA",
          "postalCode": "94105",
          "country": "US"
        }
      }
    }
    ```
  </Tab>
</Tabs>

<Note>
  If you create an order with a physical product without specifying a `physicalAddress`, the quote cannot proceed
  until a physical address is provided. After providing the physical address, the order status will update and include
  the necessary `payment.preparation` parameters to proceed with payment. See the full list of statuses on the
  <a href="/payments/headless/guides/status-codes" target="_blank">Status Codes</a> page and learn more about payment preparation in the
  <a href="/payments/headless/guides/order-lifecycle/crypto-payment-phase" target="_blank">payment phase documentation</a>.
</Note>
