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

# Submit share merge

> Submit a signature to finalize the share merge.

## Path Parameters

<ParamField path="pubkey" type="string" required>
  The public key of the share merge to submit.
</ParamField>

## Body Parameters

<ParamField body="signature" type="string" required>
  Hex signature over the share merge draft **`message`** from [Start share merge](/api-reference/share-merges/start-merge): the 64-byte ed25519 signature (128 hex characters) of the transaction message, signed the same way as an [order draft](/api-reference/orders/submit-order). A leading `0x` is accepted. A full signed transaction is not accepted on this endpoint.
</ParamField>

## Response

The merge moves to `in_process` while the transaction lands. Poll [Get share merge by pubkey](/api-reference/share-merges/merge-detail) until `state` is `done` or `failed`.

<ResponseField name="data" type="object">
  Submitted share merge row.
</ResponseField>

<Expandable title="Data fields">
  <ResponseField name="pubkey" type="string">
    Share merge public key.
  </ResponseField>

  <ResponseField name="message" type="string | null">
    Program message from the draft. Sign it while the merge is `waiting_to_sign`. The value is kept after signing. `null` only when the draft could not be created (state `failed`).
  </ResponseField>

  <ResponseField name="market_condition_id" type="string">
    Market condition id.
  </ResponseField>

  <ResponseField name="state" type="string">
    Lifecycle state: (`waiting_to_sign`, `in_process`, `done`, `failed`, `expired`).
  </ResponseField>

  <ResponseField name="amount" type="string">
    Requested amount.
  </ResponseField>

  <ResponseField name="onchain_amount" type="string | null">
    Amount settled on chain. `null` unless `state` is `done`.
  </ResponseField>

  <ResponseField name="created" type="integer">
    Created timestamp (Unix seconds).
  </ResponseField>
</Expandable>

<ResponseField name="meta" type="object">
  Empty object on success for this endpoint.
</ResponseField>

<ResponseField name="error" type="object | null">
  `null` on success. Error object on failed requests.
</ResponseField>

## Errors

| Status | Slug | When |
| - | - | - |
| `400` | `invalid_request_params` | `signature` is missing, empty or longer than 128 characters. |
| `400` | `program_call_has_expired` | The draft expired before it was submitted. Start a new merge. |
| `400` | `invalid_program_call_status` | The draft can no longer be submitted. Start a new merge. |
| `404` | `share_conversion_not_found` | No share merge with this pubkey belongs to you. |
| `409` | `share_conversion_invalid_state` | The share merge is no longer `waiting_to_sign`. |

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "pubkey": "HwqEtgeDoWHLqyMQgjwj7BGWmCrZ46m6y5bALMfYcGYY",
      "message": "Program call payload to merge shares.",
      "market_condition_id": "7n9G9WfQ2V7d6hM3XK8pQ4LwR2eY6aT1uJ5cB8mN3qPz",
      "state": "in_process",
      "amount": "10.000000",
      "onchain_amount": null,
      "created": 1714303300
    },
    "meta": {},
    "error": null
  }
  ```

  ```json 400 theme={null}
  {
    "data": null,
    "meta": null,
    "error": {
      "code": -11,
      "slug": "invalid_request_params",
      "message": "Validation Error",
      "details": []
    }
  }
  ```

  ```json 401 theme={null}
  {
    "data": null,
    "meta": null,
    "error": {
      "code": -12,
      "slug": "authentication_failed",
      "message": "Invalid signature",
      "details": []
    }
  }
  ```

  ```json 403 theme={null}
  {
    "data": null,
    "meta": null,
    "error": {
      "code": -14,
      "slug": "permission_denied",
      "message": "You do not have permission to perform this action.",
      "details": []
    }
  }
  ```

  ```json 400 theme={null}
  {
    "data": null,
    "meta": null,
    "error": {
      "code": 3029,
      "slug": "program_call_has_expired",
      "message": "The program call has expired. Please request a new one.",
      "details": []
    }
  }
  ```

  ```json 404 theme={null}
  {
    "data": null,
    "meta": null,
    "error": {
      "code": 4307,
      "slug": "share_conversion_not_found",
      "message": "Share conversion not found.",
      "details": []
    }
  }
  ```

  ```json 409 theme={null}
  {
    "data": null,
    "meta": null,
    "error": {
      "code": 4308,
      "slug": "share_conversion_invalid_state",
      "message": "Share conversion must be waiting to sign.",
      "details": []
    }
  }
  ```

  ```json 429 theme={null}
  {
    "data": null,
    "meta": null,
    "error": {
      "code": -17,
      "slug": "throttled",
      "message": "Request was throttled.",
      "details": []
    }
  }
  ```

  ```json 500 theme={null}
  {
    "data": null,
    "meta": null,
    "error": {
      "code": -3,
      "slug": "internal_error",
      "message": "An internal error occurred.",
      "details": []
    }
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.