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

# Submit Signature

> Submit EIP-712 signatures for intent-based transfer routes.

Submits EIP-712 signatures for intent-based routes like Aori. Required when a quote includes `SIGNATURE` user steps.

***

## Reference

### When to use

| Route type       | When to call                                                           |
| ---------------- | ---------------------------------------------------------------------- |
| **AORI\_V1**     | **Required**. Intent-based routes need off-chain signature submission. |
| **Other routes** | Not applicable. Use on-chain transactions only.                        |

### Request body

| Parameter    | Type            | Required | Description                           |
| ------------ | --------------- | -------- | ------------------------------------- |
| `quoteId`    | string          | Yes      | Quote ID from the `/quotes` response  |
| `signatures` | string or array | Yes      | EIP-712 signature(s) as hex string(s) |

### Response

Returns an empty object on success.

```json wrap theme={null}
{}
```

## Code examples

<Tabs>
  <Tab title="cURL">
    ```bash wrap theme={null}
    curl -X POST "https://transfer.layerzero-api.com/v1/submit-signature" \
      -H "Content-Type: application/json" \
      -H "x-api-key: YOUR_API_KEY" \
      -d '{
        "quoteId": "QUOTE_ID",
        "signatures": ["0x1234567890abcdef..."]
      }'
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript wrap theme={null}
    const response = await fetch('https://transfer.layerzero-api.com/v1/submit-signature', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'x-api-key': 'YOUR_API_KEY',
      },
      body: JSON.stringify({
        quoteId: 'QUOTE_ID',
        signatures: ['0x1234567890abcdef...'],
      }),
    });

    if (!response.ok) {
      throw new Error(`Signature submission failed: ${response.statusText}`);
    }

    console.log('Signature submitted successfully');
    ```
  </Tab>

  <Tab title="Python">
    ```python wrap theme={null}
    import requests

    response = requests.post(
      "https://transfer.layerzero-api.com/v1/submit-signature",
      headers={"x-api-key": "YOUR_API_KEY"},
      json={
        "quoteId": "QUOTE_ID",
        "signatures": ["0x1234567890abcdef..."],
      },
    )

    if not response.ok:
      raise Exception(f"Signature submission failed: {response.status_code}")

    print("Signature submitted successfully")
    ```
  </Tab>
</Tabs>

## Signing EIP-712 messages

When a quote includes a `SIGNATURE` user step, sign the EIP-712 typed data and submit it:

### Step 1: Extract typed data

```typescript wrap theme={null}
const signatureStep = quote.userSteps.find((step) => step.type === 'SIGNATURE');
const {domain, types, message} = signatureStep.signature.typedData;
```

### Step 2: Convert BigInt fields

<Warning>
  **BigInt conversion required:** The API returns numeric message fields as strings for JSON compatibility. Convert these to `BigInt` before signing.
</Warning>

```typescript wrap theme={null}
const normalizedMessage = {
  ...message,
  inputAmount: BigInt(message.inputAmount),
  outputAmount: BigInt(message.outputAmount),
  startTime: BigInt(message.startTime),
  endTime: BigInt(message.endTime),
};
```

### Step 3: Sign typed data

<Tabs>
  <Tab title="viem">
    ```typescript wrap theme={null}
    import {type WalletClient} from 'viem';

    const signature = await walletClient.signTypedData({
      domain,
      types,
      primaryType: Object.keys(types).find((key) => key !== 'EIP712Domain'),
      message: normalizedMessage,
    });
    ```
  </Tab>

  <Tab title="ethers">
    ```typescript wrap theme={null}
    import {ethers} from 'ethers';

    const signature = await signer._signTypedData(domain, types, normalizedMessage);
    ```
  </Tab>
</Tabs>

### Step 4: Submit signature

```typescript wrap theme={null}
await fetch('https://transfer.layerzero-api.com/v1/submit-signature', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY',
  },
  body: JSON.stringify({
    quoteId: quote.id,
    signatures: [signature],
  }),
});
```

## Complete example

```typescript wrap theme={null}
async function executeAoriRoute(quote: Quote, walletClient: WalletClient) {
  for (const step of quote.userSteps) {
    if (step.type === 'SIGNATURE') {
      const {domain, types, message} = step.signature.typedData;

      // Convert numeric fields to BigInt
      const normalizedMessage = {
        ...message,
        inputAmount: BigInt(message.inputAmount),
        outputAmount: BigInt(message.outputAmount),
        startTime: BigInt(message.startTime),
        endTime: BigInt(message.endTime),
      };

      // Sign EIP-712 message
      const signature = await walletClient.signTypedData({
        domain,
        types,
        primaryType: Object.keys(types).find((k) => k !== 'EIP712Domain'),
        message: normalizedMessage,
      });

      // Submit signature to API
      await fetch('https://transfer.layerzero-api.com/v1/submit-signature', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'x-api-key': 'YOUR_API_KEY',
        },
        body: JSON.stringify({
          quoteId: quote.id,
          signatures: [signature],
        }),
      });
    }
  }
}
```

## Errors

| HTTP Status | Description                   |
| ----------- | ----------------------------- |
| `400`       | Invalid signature or quote ID |
| `404`       | Quote not found               |

## Related endpoints

* [Quotes](./quotes) — Request transfer quotes (includes `SIGNATURE` steps for Aori routes)
* [Status](./status) — Track transfer progress after signature submission


## OpenAPI

````yaml POST /submit-signature
openapi: 3.0.3
info:
  title: Value Transfer API
  version: 1.0.0
  description: Unified API for cross-chain value transfers across 150+ blockchains
servers:
  - url: https://transfer.layerzero-api.com/v1
security: []
paths:
  /submit-signature:
    post:
      tags:
        - Transfer
      summary: Submit EIP-712 signatures
      description: >-
        Submit signed EIP-712 messages for intent-based transfers (for example,
        Aori routes). Required when a quote includes SIGNATURE user steps.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - quoteId
                - signatures
              properties:
                quoteId:
                  type: string
                  description: The quote ID from the /quotes response
                  example: quote_abc123
                signatures:
                  type: array
                  description: Array of signature hex strings
                  items:
                    type: string
                  example:
                    - 0x...
      responses:
        '200':
          description: Signature submitted successfully
          content:
            application/json:
              schema:
                type: object
                example: {}
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for authenticating requests. Required for /quotes,
        /build-user-steps, /submit-signature, and /status endpoints.

````