# Create Invoice by Crypto

**Request:**

```http
POST /2.0/merchant/create-invoice-by-crypto
```

**Request Body:**

```json
{
    "cryptoAmount": "100020722776701016039", // Required: Cryptocurrency amount in wei (uint)
    "assetId": "uuid", // Required: Predefined asset ID for payment
    "productTitle": "Test Product", // Optional: Product title
    "extraData": "Optional data" // Optional: Additional invoice parameters
}
```

**Response (200 OK):**

```json
{
    "id": "UUID", // Invoice ID
    "usdAmount": "100.00", // Invoice amount in USD
    "status": "pending", // Invoice status
    "paymentPageLink": "https://pp.omypayments.com/?id=UUID", // Link to the payment page
    "productTitle": "Test Product", // Product title
    "extraData": null, // Additional invoice information
    "cryptoAmount": "0", // Amount in cryptocurrency
    "crypto": { // Crypto data
        "id": "uuid", // Crypto UUID
        "title": "Tether USD", // Crypto title
        "symbol": "USDT" // Crypto symbol
        "contractAddress": "0x0000000000000000000000000000000000000000" // Crypto contract address
        "decimals": 6 // Crypto decimals
        "logoURI": "https://..." // Crypto logo URI
    },
    "network": { // Network data
        "id": "UUID", // Network UUID
        "chainId": "56", // Network chain ID
        "symbol": "BSC", // Network symbol
        "name": "BNB Chain", // Network title
        "networkType": "evm" // Network type
    },
    "address": "0x0000000000000000000000000000000000000000", // Payment address
    "expiredAt": "2025-01-01 00:00:00" // Invoice expiration datetime (UTC+0)
}
```

**Error Responses:**

* **400 Bad Request (Validation Error):**

  ```json
  {
      "success": false,
      "message": "Validation error",
      "errors": [
          {
              "field": "cryptoAmount",
              "messages": ["Invalid value format"]
          }
      ]
  }
  ```
* **500 Internal Server Error:**

  ```json
  {
      "success": false,
      "message": "Internal Server Error",
      "statusCode": 500
  }
  ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omypayments.com/api/api-endpoints/create-invoice-by-crypto.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
