{
  "openapi": "3.0.0",
  "info": {
    "title": "Server to server API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.moonpay.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "description": "Your secret API key, passed as `Authorization: Api-Key <secret key>`, for example `Authorization: Api-Key sk_test_key`. Secret keys are prefixed with `sk_test_` (sandbox) or `sk_live_` (production) and must only be used server-side. Never expose them in client code. Find your keys on the [API keys page](https://dashboard.moonpay.com/developers/api-keys) of the dashboard. See [Authentication](/api-reference/widget/using-the-api#authentication)."
      }
    },
    "schemas": {
      "BuyTransaction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the transaction.",
            "example": "defb7c52-7bd3-422b-9052-374df50cc51a"
          },
          "createdAt": {
            "type": "string",
            "description": "Time at which the object was created. Returned as an ISO 8601 string.",
            "example": "2024-02-17T18:24:45.206Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Time at which the object was last updated. Returned as an ISO 8601 string.",
            "example": "2024-02-17T18:24:45.206Z"
          },
          "quoteExpiresAt": {
            "type": "string",
            "nullable": true,
            "description": "Time at which the buy quote expires. Returned as an ISO 8601 string.",
            "example": "2024-02-17T18:54:45.206Z"
          },
          "baseCurrencyAmount": {
            "type": "number",
            "description": "A positive number representing how much the customer wants to spend. The minimum amount is 20.",
            "example": 45.5
          },
          "quoteCurrencyAmount": {
            "type": "number",
            "description": "A positive number representing the amount of cryptocurrency the customer will receive. Set when the purchase of cryptocurrency has been executed.",
            "example": 0.0154
          },
          "feeAmount": {
            "type": "number",
            "description": "A positive number representing the fee for the transaction. It is added to baseCurrencyAmount, extraFeeAmount and networkFeeAmount when the customer's card is charged.",
            "example": 1.7
          },
          "extraFeeAmount": {
            "type": "number",
            "description": "A positive number representing your extra fee for the transaction. It is added to baseCurrencyAmount and feeAmount when the customer's card is charged.",
            "example": 0.43
          },
          "paymentMethod": {
            "$ref": "#/components/schemas/PaymentMethods"
          },
          "networkFeeAmount": {
            "type": "number",
            "description": "A positive number representing the network fee for the transaction. It is added to baseCurrencyAmount, feeAmount and extraFeeAmount when the customer's card is charged.",
            "example": 2.37
          },
          "areFeesIncluded": {
            "type": "boolean",
            "description": "A boolean indicating whether baseCurrencyAmount includes or excludes the feeAmount, extraFeeAmount and networkFeeAmount.",
            "example": true
          },
          "status": {
            "type": "string",
            "description": "The transaction's status.\nPossible values are `waitingPayment` (pending bank transfers where MoonPay is not in receipt), `pending` (transaction is in progress), `waitingAuthorization` (waiting for card approval, i.e. 3DS, bank side security), `failed` or `completed`.\n",
            "example": "completed",
            "enum": [
              "waitingPayment",
              "pending",
              "waitingAuthorization",
              "failed",
              "completed"
            ]
          },
          "failureReason": {
            "type": "string",
            "nullable": true,
            "description": "The transaction's failure reason. Set when transaction's status is failed.",
            "example": null
          },
          "walletAddress": {
            "type": "string",
            "description": "The cryptocurrency wallet address the purchased funds will be sent to.",
            "example": "0xc216eD2D6c295579718dbd4a797845CdA70B3C36"
          },
          "walletAddressTag": {
            "type": "string",
            "nullable": true,
            "description": "The secondary cryptocurrency wallet address identifier for coins such as EOS, XRP and XMR.",
            "example": null
          },
          "cryptoTransactionId": {
            "type": "string",
            "nullable": true,
            "description": "The cryptocurrency transaction identifier representing the transfer to the customer's wallet. Set when the withdrawal has been executed.",
            "example": "0x6751c8fce2e0fb5d57bb4801b31b35a7160fa362e0c5703d44cfd508317ee2f8"
          },
          "redirectUrl": {
            "type": "string",
            "nullable": true,
            "description": "The URL provided to you, when required, to which to redirect the customer as part of a redirect authentication flow.",
            "example": "https://api.moonpay.com/secure/url?transactionId=defb7c52-7bd3-422b-9052-374df50cc51a"
          },
          "returnUrl": {
            "type": "string",
            "description": "The URL the customer is returned to after they authenticate or cancel their payment on the payment method's app or site. If you are using our widget implementation, this is always our transaction tracker page, which provides the customer with real-time information about their transaction.",
            "example": "https://buy.moonpay.com/transaction_receipt?transactionId=defb7c52-7bd3-422b-9052-374df50cc51a"
          },
          "widgetRedirectUrl": {
            "type": "string",
            "nullable": true,
            "description": "An optional URL used in a widget implementation. It is passed to us by you in the query parameters, and we include it as a link on the transaction tracker page.",
            "example": null
          },
          "eurRate": {
            "type": "number",
            "description": "The exchange rate between the transaction's base currency and Euro at the time of the transaction.",
            "example": 0.92432
          },
          "usdRate": {
            "type": "number",
            "description": "The exchange rate between the transaction's base currency and US Dollar at the time of the transaction.",
            "example": 1
          },
          "gbpRate": {
            "type": "number",
            "description": "The exchange rate between the transaction's base currency and British Pound at the time of the transaction.",
            "example": 0.79016
          },
          "currencyId": {
            "type": "string",
            "example": "8d305f63-1fd7-4e01-a220-8445e591aec4",
            "description": "The identifier of the cryptocurrency the customer wants to purchase."
          },
          "currency": {
            "$ref": "#/components/schemas/CryptoCurrency"
          },
          "baseCurrencyId": {
            "type": "string",
            "example": "edd81f1f-f735-4692-b410-6def107f17d2",
            "description": "The identifier of the fiat currency the customer wants to use for the transaction."
          },
          "baseCurrency": {
            "$ref": "#/components/schemas/FiatCurrency"
          },
          "customerId": {
            "type": "string",
            "description": "The identifier of the customer the transaction is associated with.",
            "example": "77cc1309-0058-4177-b170-8e9657fe12eb"
          },
          "cardId": {
            "type": "string",
            "nullable": true,
            "description": "For token or card transactions, the identifier of the payment card used for this transaction.",
            "example": "0a7e23d8-6a52-44c7-b189-91b37bd13796"
          },
          "bankAccountId": {
            "type": "string",
            "nullable": true,
            "description": "For bank transfer transactions, the identifier of the bank account used for this transaction.",
            "example": null
          },
          "externalCustomerId": {
            "type": "string",
            "nullable": true,
            "description": "An identifier associated with the customer, provided by you."
          },
          "externalTransactionId": {
            "type": "string",
            "nullable": true,
            "description": "An identifier associated with the transaction, provided by you."
          },
          "country": {
            "type": "string",
            "description": "The customer's country. Returned as an ISO 3166-1 alpha-3 code.",
            "example": "GBR"
          },
          "state": {
            "type": "string",
            "nullable": true,
            "description": "The customer's state, if the customer is from the USA. Returned as a two-letter code.",
            "example": null
          }
        }
      },
      "PaymentMethods": {
        "type": "string",
        "example": "credit_debit_card",
        "enum": [
          "ach_bank_transfer",
          "credit_debit_card",
          "paypal",
          "gbp_bank_transfer",
          "gbp_open_banking_payment",
          "pix_instant_payment",
          "sepa_bank_transfer"
        ],
        "description": "The transaction's payment method."
      },
      "CryptoCurrency": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the currency.",
            "example": "aaefa32f-161b-42c8-8115-debcbf3d6a2d"
          },
          "createdAt": {
            "type": "string",
            "description": "Time at which the object was created. Returned as an ISO 8601 string.",
            "example": "2019-05-17T18:24:45.206Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Time at which the object was last updated. Returned as an ISO 8601 string.",
            "example": "2019-05-17T18:24:45.206Z"
          },
          "type": {
            "type": "string",
            "enum": ["crypto"],
            "description": "Always `crypto`",
            "example": "crypto"
          },
          "name": {
            "type": "string",
            "description": "The currency's name.",
            "example": "USD Coin (ERC-20)"
          },
          "code": {
            "type": "string",
            "description": "The currency's code.",
            "example": "usdc"
          },
          "precision": {
            "type": "number",
            "description": "The currency's precision (number of digits after decimal point).",
            "example": 2
          },
          "minBuyAmount": {
            "type": "number",
            "nullable": true,
            "description": "Represents the minimum amount of cryptocurrency you can buy.",
            "example": 30
          },
          "maxBuyAmount": {
            "type": "number",
            "nullable": true,
            "description": "Represents the maximum amount of cryptocurrency you can buy.",
            "example": 1000
          },
          "minSellAmount": {
            "type": "number",
            "nullable": true,
            "description": "The minimum amount of cryptocurrency you can sell.",
            "example": 15
          },
          "maxSellAmount": {
            "type": "number",
            "nullable": true,
            "description": "The maximum amount of cryptocurrency you can sell.",
            "example": 100000
          },
          "addressRegex": {
            "type": "string",
            "description": "A regular expression which you can test against your end user's wallet addresses.",
            "example": "^(0x)[0-9A-Fa-f]{40}$"
          },
          "testnetAddressRegex": {
            "type": "string",
            "description": "A regular expression which you can test against your end user's testnet wallet addresses.",
            "example": "^(0x)[0-9A-Fa-f]{40}$"
          },
          "supportsAddressTag": {
            "type": "boolean",
            "description": "Whether the currency supports address tags.",
            "example": false
          },
          "addressTagRegex": {
            "type": "string",
            "nullable": true,
            "description": "A regular expression which you can test against a wallet address tag. Defined only if the currency supports address tags.",
            "example": null
          },
          "supportsTestMode": {
            "type": "boolean",
            "description": "Whether the currency supports test mode.",
            "example": true
          },
          "isSuspended": {
            "type": "boolean",
            "description": "Whether purchases for this currency are suspended. If the currency is suspended, exchange rates may not be available and it is not possible to create a transaction with this currency.",
            "example": false
          },
          "isSupportedInUs": {
            "type": "boolean",
            "description": "Whether purchases for this currency are supported in the US.",
            "example": true
          },
          "isSellSupported": {
            "type": "boolean",
            "description": "Whether sales for this currency are supported.",
            "example": true
          },
          "notAllowedUSStates": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "AL",
                "AK",
                "AZ",
                "AR",
                "AS",
                "CA",
                "CO",
                "CT",
                "DC",
                "DE",
                "FL",
                "GA",
                "GU",
                "HI",
                "ID",
                "IL",
                "IN",
                "IA",
                "KS",
                "KY",
                "LA",
                "MA",
                "MD",
                "ME",
                "MI",
                "MN",
                "MO",
                "MP",
                "MS",
                "MT",
                "NE",
                "NH",
                "NV",
                "NH",
                "NJ",
                "NM",
                "NY",
                "NC",
                "ND",
                "OH",
                "OK",
                "OR",
                "PA",
                "PR",
                "RI",
                "SC",
                "SD",
                "TN",
                "TX",
                "TT",
                "UT",
                "VT",
                "VA",
                "VI",
                "WA",
                "WV",
                "WI",
                "WY"
              ]
            },
            "description": "A list with all the US states for this currency that are not supported.",
            "example": ["LA", "VI"]
          },
          "notAllowedCountries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "A list with all the ISO 3166-1 alpha-2 country codes for this currency that are not supported.",
            "example": ["CA"]
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata for the currency.",
            "properties": {
              "contractAddress": {
                "type": "string",
                "nullable": true,
                "description": "Unique contract address where the token smart contract is hosted.",
                "example": "0x0000000000000000000000000000000000000000"
              },
              "chainId": {
                "type": "string",
                "nullable": true,
                "description": "ID used to identify different EVM compatible chains.",
                "example": "1"
              },
              "networkCode": {
                "type": "string",
                "description": "Name of the cryptocurrency",
                "example": "ethereum"
              }
            }
          }
        }
      },
      "FiatCurrency": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the currency.",
            "example": "6f424585-8936-4eb1-b01e-443fb306d1f5"
          },
          "createdAt": {
            "type": "string",
            "description": "Time at which the object was created. Returned as an ISO 8601 string.",
            "example": "2019-05-17T18:24:45.206Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Time at which the object was last updated. Returned as an ISO 8601 string.",
            "example": "2019-05-17T18:24:45.206Z"
          },
          "type": {
            "type": "string",
            "enum": ["fiat"],
            "description": "Always `fiat`",
            "example": "fiat"
          },
          "name": {
            "type": "string",
            "description": "The currency's name.",
            "example": "Pound Sterling"
          },
          "code": {
            "type": "string",
            "description": "The currency's code.",
            "example": "gbp"
          },
          "precision": {
            "type": "number",
            "description": "The currency's precision (number of digits after decimal point).",
            "example": 2
          },
          "minBuyAmount": {
            "type": "number",
            "nullable": true,
            "description": "Represents the minimum transaction buy amount when using this currency as a base currency.",
            "example": 30
          },
          "maxBuyAmount": {
            "type": "number",
            "nullable": true,
            "description": "Represents the maximum transaction buy amount when using this currency as a base currency.",
            "example": 9000
          },
          "isSellSupported": {
            "type": "boolean",
            "description": "Whether sales for this currency are supported.",
            "example": true
          }
        }
      },
      "SellTransaction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "9020fd02-42ac-497f-8b5f-41fdf4dd0b1d",
            "description": "Unique identifier for the object."
          },
          "createdAt": {
            "type": "string",
            "example": "2024-02-23T00:58:26.577Z",
            "description": "Time at which the object was created. Returned as an ISO 8601 string."
          },
          "updatedAt": {
            "type": "string",
            "example": "2024-02-23T00:58:26.577Z",
            "description": "Time at which the object was last updated. Returned as an ISO 8601 string."
          },
          "quoteExpiresAt": {
            "type": "string",
            "nullable": true,
            "description": "Time at which the sell quote expires. Returned as an ISO 8601 string.",
            "example": "2024-02-23T01:28:26.577Z"
          },
          "baseCurrencyAmount": {
            "type": "number",
            "example": 0.575,
            "description": "A positive number representing how much the customer wants to sell."
          },
          "quoteCurrencyAmount": {
            "type": "number",
            "example": 1521.11,
            "description": "A positive number representing the amount of cryptocurrency the customer will receive. Set when the purchase of cryptocurrency has been executed."
          },
          "feeAmount": {
            "type": "number",
            "example": 15.36,
            "description": "A positive number representing the fee for the transaction."
          },
          "extraFeeAmount": {
            "type": "number",
            "example": 0,
            "description": "A positive number representing your extra fee for the transaction."
          },
          "status": {
            "type": "string",
            "example": "completed",
            "description": "The transaction's status.",
            "enum": ["waitingForDeposit", "pending", "failed", "completed"]
          },
          "failureReason": {
            "type": "string",
            "nullable": true,
            "description": "The transaction's failure reason. Set when transaction's status is failed.",
            "example": null
          },
          "refundWalletAddress": {
            "type": "string",
            "description": "A wallet address at which the customer can receive cryptocurrency. In case we cannot process the sale of the customer's cryptocurrency, we will return the cryptocurrency to this wallet address. Might be empty",
            "example": ""
          },
          "depositHash": {
            "type": "string",
            "nullable": true,
            "description": "The cryptocurrency transaction identifier representing the transfer from the customer's wallet to MoonPay's wallet. Set when the deposit has been executed and received.",
            "example": "0x0e13c1c9d8b542a1888e63e6d5871a2199893a0f2851c9353120b7e18fce1802"
          },
          "widgetRedirectUrl": {
            "type": "string",
            "nullable": true,
            "description": "An optional URL used in a widget implementation. It is passed to us by you in the query parameters, and we include it as a link on the transaction tracker page.",
            "example": null
          },
          "payoutMethod": {
            "type": "string",
            "example": "credit_debit_card",
            "description": "The transaction's payout method.",
            "enum": [
              "ach_bank_transfer",
              "credit_debit_card",
              "paypal",
              "gbp_bank_transfer",
              "sepa_bank_transfer"
            ]
          },
          "eurRate": {
            "type": "number",
            "description": "The exchange rate between the transaction's base currency and Euro at the time of the transaction.",
            "example": 1
          },
          "usdRate": {
            "type": "number",
            "description": "The exchange rate between the transaction's base currency and US Dollar at the time of the transaction.",
            "example": 1.08193
          },
          "gbpRate": {
            "type": "number",
            "description": "The exchange rate between the transaction's base currency and British Pound at the time of the transaction.",
            "example": 0.85501
          },
          "quoteCurrencyId": {
            "type": "string",
            "example": "71435a8d-211c-4664-a59e-2a5361a6c5a7",
            "description": "The identifier of the fiat the customer wants to get."
          },
          "quoteCurrency": {
            "$ref": "#/components/schemas/FiatCurrency"
          },
          "baseCurrencyId": {
            "type": "string",
            "example": "8d305f63-1fd7-4e01-a220-8445e591aec4",
            "description": "The identifier of the crypto currency the customer wants to sell."
          },
          "baseCurrency": {
            "$ref": "#/components/schemas/CryptoCurrency"
          },
          "customerId": {
            "type": "string",
            "example": "3b97352d-a9c2-4786-afe7-e7d74e0a8ad7",
            "description": "The identifier of the customer the transaction is associated with."
          },
          "bankAccountId": {
            "type": "string",
            "nullable": true,
            "example": "ee0e649f-a072-4cdb-96ce-a1ea393eac1e",
            "description": "The identifier of the bank account used for this transaction."
          },
          "externalCustomerId": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "An identifier associated with the customer, provided by you."
          },
          "externalTransactionId": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "An identifier associated with the transaction, provided by you."
          }
        }
      },
      "Customer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the customer.",
            "example": "2fcbcea3-6b62-49f1-b9d1-026d9bfd00b6"
          },
          "createdAt": {
            "type": "string",
            "description": "Time at which the object was created. Returned as an ISO 8601 string.",
            "example": "2024-02-17T18:24:45.206Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Time at which the object was last updated. Returned as an ISO 8601 string.",
            "example": "2024-02-17T18:24:45.206Z"
          },
          "liveMode": {
            "type": "boolean",
            "description": "`true` if the customer was created in live mode, `false` if created in sandbox.",
            "example": true
          },
          "defaultCurrencyId": {
            "type": "string",
            "description": "Unique identifier of the customer's default fiat currency.",
            "example": "71435a8d-211c-4664-a59e-2a5361a6c5a7"
          },
          "defaultCurrencyCode": {
            "type": "string",
            "description": "Code of the customer's default fiat currency. May be omitted if no default currency is set.",
            "example": "eur"
          },
          "externalCustomerId": {
            "type": "string",
            "nullable": true,
            "description": "An identifier associated with the customer, provided by you."
          },
          "identityCheckStatus": {
            "type": "string",
            "description": "Status of the customer's identity verification.",
            "example": "completed",
            "enum": ["no_kyc", "pending", "completed", "rejected"]
          },
          "identityCheckLevel": {
            "type": "integer",
            "description": "The customer's identity verification level. `0` if the customer has not completed an identity check.",
            "example": 1
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Standard error response. See [Errors](/api-reference/widget/errors) for the full code catalog.",
        "properties": {
          "moonPayErrorCode": {
            "type": "string",
            "description": "Stable, machine-readable error code. System codes are prefixed `1_SYS_` (general) or `4_SYS_` (request validation); domain codes are prefixed `5_`. `1_SYS_UNKNOWN` with a 4xx status indicates a legacy validation error \u2014 read `message` for the cause. See [Errors](/api-reference/widget/errors).",
            "example": "4_SYS_BAD_REQUEST"
          },
          "message": {
            "type": "string",
            "description": "Human-readable description of the error. May change over time \u2014 branch on `moonPayErrorCode` and the HTTP status, not on this text."
          },
          "type": {
            "type": "string",
            "description": "The error class name, e.g. `BadRequestError`, `UnauthorizedError`, `MoonPayApiError`."
          },
          "errors": {
            "type": "array",
            "description": "Field-level validation details, when the error was caused by invalid input. Empty or absent otherwise.",
            "items": {
              "type": "object",
              "properties": {
                "property": {
                  "type": "string",
                  "description": "The invalid field."
                },
                "message": {
                  "type": "string",
                  "description": "Why the field is invalid."
                },
                "children": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  },
                  "description": "Nested validation errors for object fields."
                }
              }
            }
          }
        },
        "required": ["moonPayErrorCode", "message", "type"]
      },
      "CustomerImportRequest": {
        "type": "object",
        "required": ["externalCustomerId", "identity"],
        "properties": {
          "externalCustomerId": {
            "type": "string",
            "example": "123",
            "description": "A unique identifier for the customer on your platform. Pass the same value to the widget as the `externalCustomerId` parameter."
          },
          "identity": {
            "type": "array",
            "description": "The identity records to import for this customer.",
            "items": {
              "$ref": "#/components/schemas/CustomerImportIdentity"
            }
          }
        }
      },
      "CustomerImportIdentity": {
        "type": "object",
        "required": ["source", "shareToken"],
        "properties": {
          "source": {
            "type": "string",
            "enum": ["sumsub"],
            "example": "sumsub",
            "description": "The KYC provider the identity record comes from."
          },
          "shareToken": {
            "type": "string",
            "example": "{{shareToken}}",
            "description": "A share token generated by the provider for MoonPay. For Sumsub, generate it with [Generate a share token](https://docs.sumsub.com/reference/generate-share-token) using `forClientId: \"Moonpay\"`. Single use, and it expires after the `ttlInSecs` you requested, so generate one per import call."
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Buy transactions",
      "description": "Look up and list Buy transactions."
    },
    {
      "name": "Customers",
      "description": "Look up customers by MoonPay or external ID, and import an existing identity verification."
    },
    {
      "name": "Sell transactions",
      "description": "Look up, list and cancel Sell transactions."
    }
  ],
  "paths": {
    "/v1/transactions": {
      "get": {
        "tags": ["Buy transactions"],
        "summary": "List Buy transactions",
        "description": "Returns an array of Buy transactions that match the criteria in the query parameters. Filtering by customerId, externalCustomerId, or externalTransactionId returns transactions of any status. Without one of those filters, the endpoint returns only pending and completed transactions. Each entry in the array is a separate transaction object. Transactions are listed from newest to oldest.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "style": "form",
            "explode": true,
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "externalTransactionId": {
                  "type": "string",
                  "example": "123",
                  "description": "An identifier associated with a transaction, provided by you."
                },
                "customerId": {
                  "type": "string",
                  "example": "123",
                  "description": "Unique identifier for a customer."
                },
                "externalCustomerId": {
                  "type": "string",
                  "example": "123",
                  "description": "An identifier associated with a customer, provided by you. `customerId` filter takes precedence over `externalCustomerId`."
                },
                "startDate": {
                  "type": "string",
                  "example": "2023-07-01",
                  "description": "The earliest date on which transactions should have been made. Format is YYYY-MM-DD."
                },
                "endDate": {
                  "type": "string",
                  "example": "2023-07-31",
                  "description": "The most recent date on which transactions should have been made. Format is YYYY-MM-DD."
                },
                "limit": {
                  "type": "integer",
                  "example": 20,
                  "description": "A positive integer representing the maximum number of transaction objects to be returned. Default is <span class=\"value\">10</span>, minimum is <span class=\"value\">1</span> and maximum is <span class=\"value\">50</span>."
                },
                "offset": {
                  "type": "integer",
                  "example": 1,
                  "description": "A positive integer representing the number of transaction objects to skip before returning the list. An offset of <span class=\"value\">1</span> means the list will start with the second-newest transaction."
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response: an array of Buy transactions, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BuyTransaction"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Bad request \u2014 a query parameter is missing or invalid. Check `message` and `errors` for details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/{customerId}": {
      "get": {
        "tags": ["Customers"],
        "summary": "Get customer",
        "description": "Returns very basic information about a customer based on their MoonPay ID. For you to be able to retrieve a customer, they must have at least one session initiated with your `Api-Key`.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "example": "123",
            "description": "A valid customer ID.",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response: the customer object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found \u2014 no resource matches the given identifier.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/ext/{customerId}": {
      "get": {
        "tags": ["Customers"],
        "summary": "Get customer by external ID",
        "description": "Returns very basic information about a customer based on their external customer ID. For you to be able to retrieve a customer, they must have at least one session initiated with your `API-Key`. Please note that this endpoint returns an array of objects because we cannot ensure the uniqueness of the external customer ID.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "example": "123",
            "description": "A valid external customer ID.",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response: an array of customer objects matching the external customer ID.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Customer"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found \u2014 no resource matches the given identifier.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v3/customers/import": {
      "post": {
        "tags": ["Customers"],
        "summary": "Import customer identity",
        "description": "Imports a customer's existing identity verification into MoonPay so their KYC can be expedited, using a share token issued by your KYC provider. Used by the [Shared KYC integration](/widget/shared-kyc). Your account must be enabled for KYC sharing before this endpoint accepts requests \u2014 contact your MoonPay representative. Pass the same `externalCustomerId` to the widget so MoonPay can match the imported identity to the customer. A successful import returns HTTP 200 with an empty body.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerImportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response: the identity was accepted for import. The body is empty."
          }
        }
      }
    },
    "/v3/sell_transactions": {
      "get": {
        "tags": ["Sell transactions"],
        "summary": "List Sell transactions",
        "description": "Returns an array of successful Sell transactions which fulfill criteria supplied in the query parameters. Each entry in the array is a separate transaction object. Transactions will be listed from newest to oldest. This call will return an error if `customerId` is not supplied in the query parameters.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "style": "form",
            "explode": true,
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "externalTransactionId": {
                  "type": "string",
                  "example": "123",
                  "description": "An identifier associated with a transaction, provided by you."
                },
                "customerId": {
                  "type": "string",
                  "example": "123",
                  "description": "Unique identifier for a customer."
                },
                "externalCustomerId": {
                  "type": "string",
                  "example": "123",
                  "description": "An identifier associated with a customer, provided by you. `customerId` filter takes precedence over `externalCustomerId`."
                },
                "startDate": {
                  "type": "string",
                  "example": "2023-07-01",
                  "description": "The earliest date on which transactions should have been made. Format is YYYY-MM-DD."
                },
                "endDate": {
                  "type": "string",
                  "example": "2023-07-31",
                  "description": "The most recent date on which transactions should have been made. Format is YYYY-MM-DD."
                },
                "limit": {
                  "type": "integer",
                  "example": 20,
                  "description": "A positive integer representing the maximum number of transaction objects to be returned. Default is <span class=\"value\">10</span>, minimum is <span class=\"value\">1</span> and maximum is <span class=\"value\">50</span>."
                },
                "offset": {
                  "type": "integer",
                  "example": 1,
                  "description": "A positive integer representing the number of transaction objects to skip before returning the list. An offset of <span class=\"value\">1</span> means the list will start with the second-newest transaction."
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response: an array of Sell transactions, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SellTransaction"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "Bad request \u2014 a query parameter is missing or invalid. Check `message` and `errors` for details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v3/sell_transactions/{transactionId}": {
      "delete": {
        "tags": ["Sell transactions"],
        "summary": "Cancel Sell transaction",
        "description": "Cancels a sell transaction. This endpoint will return HTTP status <span class=\"value\">204 No Content</span> if the sell transaction was successfully canceled. If sell transaction could not be canceled (e.g. because it has already been completed) it will return HTTP status <span class=\"value\">409 Conflict</span>.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "example": "123",
            "description": "A valid Sell transaction ID.",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successful response"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found \u2014 no resource matches the given identifier.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v3/sell_transactions/ext/{transactionId}": {
      "delete": {
        "tags": ["Sell transactions"],
        "summary": "Cancel Sell transaction by external ID",
        "description": "Cancels a sell transaction based on their external transaction ID. This endpoint will return HTTP status <span class=\"value\">204 No Content</span> if the sell transaction was successfully canceled. If sell transaction could not be canceled (e.g. because it has already been completed) it will return HTTP status <span class=\"value\">409 Conflict</span>.",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "example": "123",
            "description": "A valid Sell transaction ID.",
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successful response"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found \u2014 no resource matches the given identifier.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
