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)

  • 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.

    • 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.

A payment transaction based on the parameters.

POST 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*

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*

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

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.

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*

String

The public key of the payer's wallet.

{
    transaction: "<transaction>"
}

Last updated