MardiPay
|Docs
Devnet Developer Preview

Accept stablecoin payments on Solana. with one simple API.

Create a hosted checkout for USDC payments on Solana Devnet. No SDK required.

Get API key →

MardiPay is currently available on Solana Devnet using Devnet USDC.

curl -X POST https://mardipay.in/api/v1/payment_intents \
  -H "Authorization: Bearer mp_test_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "5.00",
    "currency": "USDC",
    "description": "MardiPay Cap",
    "image_url": "https://example.com/cap.png"
  }'

Get started

Everything you need to create your first payment.

1

Get an API key

Create a free Devnet API key from your MardiPay dashboard.

Get API key →
2

Create a payment

Create a Payment Intent using the API and receive a hosted checkout URL.

3

Send customers to checkout

Redirect your customer to the checkout URL returned by MardiPay.

How MardiPay works

The entire payment lifecycle in one simple synchronous loop.

Step 1Your Server
↓
Step 2POST /v1/payment_intents
↓
Step 3checkout_url
↓
Step 4Hosted Checkout
↓
Step 5USDC on Solana
↓
Step 6GET Status
Your server creates an intent, redirects the user, and polls the payment intent ID (or checks status when the customer returns) to confirm USDC settlement on Solana Devnet.
Guide

Quickstart

Complete your first end-to-end USDC payment in under two minutes.

1Obtain your Devnet API key

Go to your Merchant Dashboard under the API Keys tab. Click Generate Key to get your test key formatted as mp_test_xxx.

2Create a Payment Intent

Send a POST request with the amount and optional item details:

curl -X POST https://mardipay.in/api/v1/payment_intents \
  -H "Authorization: Bearer mp_test_xxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order_123" \
  -d '{
    "amount": "5.00",
    "currency": "USDC",
    "description": "MardiPay Cap",
    "image_url": "https://example.com/cap.png",
    "metadata": {
      "order_id": "order_123"
    }
  }'

3Redirect customer to checkout_url

The API response contains a hosted URL formatted as https://mardipay.in/checkout/pi_xxx. Send your buyer to this page to complete payment via Solana Pay QR or MardiPay Sol ID.

4Verify payment confirmation

Check the payment status by polling the intent endpoint:

curl https://mardipay.in/api/v1/payment_intents/pi_123 \
  -H "Authorization: Bearer mp_test_xxx"
POST

/api/v1/payment_intents

Create a payment intent and receive a hosted checkout URL.

AuthenticationAuthorization: Bearer mp_test_xxx

Request Body

FieldTypeDescription
amount *StringThe exact amount to charge in USDC (e.g. "5.00" or "25.00").
currency *StringCurrently "USDC".
descriptionStringOptional product name or payment description displayed on the hosted checkout.
image_urlStringOptional image URL rendered on the hosted checkout page.
metadataObjectOptional key-value object (max 4KB) for custom order references (e.g. {"order_id": "123"}).
Request Payload
curl -X POST https://mardipay.in/api/v1/payment_intents \
  -H "Authorization: Bearer mp_test_xxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order_123" \
  -d '{
    "amount": "5.00",
    "currency": "USDC",
    "description": "MardiPay Cap",
    "image_url": "https://example.com/cap.png",
    "metadata": {
      "order_id": "order_123"
    }
  }'
Response (201 Created)
{
  "id": "pi_k39f9a2",
  "object": "payment_intent",
  "amount": "5.00",
  "currency": "USDC",
  "status": "created",
  "checkout_url": "https://mardipay.in/checkout/pi_k39f9a2",
  "payment_reference": "7dK9...Wp2",
  "description": "MardiPay Cap",
  "image_url": "https://example.com/cap.png",
  "metadata": {
    "order_id": "order_123"
  },
  "created_at": 1790000000000,
  "expires_at": 1790000300000
}
GET

/api/v1/payment_intents/:id

Retrieve the current status of a payment.

Example Request
curl https://mardipay.in/api/v1/payment_intents/pi_123 \
  -H "Authorization: Bearer mp_test_xxx"
Example Response (200 OK)
{
  "id": "pi_123",
  "object": "payment_intent",
  "amount": "5.00",
  "currency": "USDC",
  "status": "confirmed",
  "checkout_url": "https://mardipay.in/checkout/pi_123",
  "tx_signature": "5abc...421",
  "payer": "7xyz...891",
  "created_at": 1790000000000,
  "confirmed_at": 1790000020000
}

Payment Statuses

StatusMeaning
createdPayment intent created; waiting for customer to visit checkout.
processingPayer initiated approval or transaction is broadcasting on Solana.
confirmedUSDC transfer verified onchain on Solana Devnet. Payment succeeded.
expiredThe 5-minute checkout countdown expired before payment was verified.
failedTransaction failed on Solana.
cancelledThe customer cancelled the checkout session.
Branding

Customize Checkout

MardiPay hosted checkout is completely dynamic. The developer controls the item name, amount, product image, and metadata directly through the Payment Intent request.

Payment Intent Payload
{
  "amount": "25.00",
  "currency": "USDC",
  "description": "Premium Hoodie",
  "image_url": "https://example.com/hoodie.png",
  "metadata": {
    "order_id": "ORDER-123",
    "size": "L"
  }
}
How it maps to the checkout:
  • description becomes the product title.
  • amount is formatted prominently in USDC.
  • image_url is rendered as the product avatar.
  • metadata is preserved on the payment record.
Hosted Checkout Result
M
Acme Store
Verified Merchant
Devnet
Amount to Pay
$25.00USDC
Premium Hoodie
Order #ORDER-123
$25.00
Pay with MardiPay

Idempotency

Use an idempotency key to safely retry requests without creating duplicate payments.

HeaderIdempotency-Key: <unique_order_identifier>

If a network error or server timeout occurs during payment intent creation, safely resend the same request with the exact same Idempotency-Key.

MardiPay recognizes the key, skips duplicate intent creation, and immediately returns the previously created Payment Intent and checkout URL.

API Errors

All error responses use standard HTTP status codes and a consistent JSON format:

{
  "error": {
    "type": "invalid_request",
    "code": "invalid_amount",
    "message": "Amount must be greater than 0."
  }
}

Error Codes

CodeHTTP StatusDescription
invalid_request400Malformed JSON payload or missing required parameter.
invalid_amount400Amount is missing or not a positive number string.
invalid_currency400Unsupported token currency. Only USDC is valid on Devnet.
invalid_api_key401API key is missing, inactive, or revoked.
payment_intent_not_found404No payment intent exists with the provided ID.
rate_limit_exceeded429Request rate exceeded 60 requests per minute limit.
internal_error500Unexpected server error while processing the request.

Security & Rate Limiting

Authentication & Key Storage

All requests require a Bearer key. MardiPay cryptographically hashes keys with SHA-256 upon generation and only displays the raw key once. Store your key securely in server environment variables.

Rate Limits & Payload Guards

Public API endpoints enforce a rate limit of 60 requests per minute per key/IP. Payloads are strictly capped at 64KB. Requests exceeding limits receive HTTP 429.

Start building with MardiPay.

Create a free Devnet key and accept your first Solana USDC payment today.