# Pay

## The Rules

* You can only specify either **size** or **quantity**. Specifying neither or both will trigger an error. 'size' is a human readable value. ( eg. 1.2 SOL ) . 'Quantity' is the base unit, like lamports. (eg. 1200000000 lamports)&#x20;
* You can only set either **discount** or **gated**. Specifying both will trigger an error. Setting discount will imply that payers with validated tokens will receive the discount specified. Setting gated will imply the payer can only pay if they have the validated tokens.
* You can only set either **collection or** **mint.** Specifying more than one will trigger an error.&#x20;
  * **collection** will validate the payer is holding an NFT from the verified collection specified.
  * **mint** will validate the payer is holding a token with the specified mint address.&#x20;

## A payment transaction based on the parameters.

<mark style="color:green;">`POST`</mark> `https://api.mtnapi.com/pay`

#### Query Parameters

| Name                                         | Type   | Description                                                                                                                                                                     |
| -------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| size                                         | String | The size of the payment expected to be paid. ( e.g. 10 USDC would be '10' )                                                                                                     |
| quantity                                     | String | The quantity of the payment expected to be paid in base units. ( eg. 10 USDC would be '10000000' )                                                                              |
| payerToken<mark style="color:red;">\*</mark> | String | The token the payer is sending. Check here for supported tokens and their values.                                                                                               |
| receiverToken                                | String | The token the receiver is expecting.  Check here for supported tokens and their values. Specifying this will invoke a token swap.                                               |
| cluster                                      | String | Specify either the 'MAINNET' or 'DEVNET' cluster. The default value is set to 'MAINNET'.                                                                                        |
| discount                                     | String | The discount applied to the payment. Discount is specified in percentages (i.e 20% should be specified as 0.20)                                                                 |
| wallet<mark style="color:red;">\*</mark>     | String | The public key of the receiving wallet.                                                                                                                                         |
| collection                                   | String | The public key of the NFT collection you want to validate ownership.                                                                                                            |
| mint                                         | String | The public key of the token you want to validate ownership.                                                                                                                     |
| gated                                        | String | <p>Pass the value 'TRUE' for a token gated payment. The default value is FALSE. If a user does not have a valid collection or mint token, the transaction will fail.</p><p></p> |
| priceToken                                   | String | The token your payment is priced in. For example,  if you want the customer to pay $40 in sol. Check here for supported tokens and their values.                                |

#### Request Body

| Name                                      | Type   | Description                           |
| ----------------------------------------- | ------ | ------------------------------------- |
| account<mark style="color:red;">\*</mark> | String | The public key of the payer's wallet. |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    transaction: "<transaction>"
}
```

{% endtab %}
{% endtabs %}


---

# 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://mtnpay.gitbook.io/api-docs/reference/api-reference/pay.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.
