# Payment API

> Create a payment intent and check payment status for an order. Endpoint: `POST https://api-b2b.stampmitra.in/v1/payments/intents`.

API fee: ₹5 per successful call, pay-as-you-go (lower on Growth and Scale). State procurement fee and stamp duty are quoted per order. Sandbox keys are free. Prices exclude 18% GST.

- HTML docs: https://developer.stampmitra.in/docs/estamp/estamp-payment
- Product page: https://developer.stampmitra.in/products/estamp-payment
- Pricing: https://developer.stampmitra.in/pricing
- Authentication: https://developer.stampmitra.in/docs/auth

## Create a payment intent

`POST https://api-b2b.stampmitra.in/v1/payments/intents`

Required scope: `payments.write`

Create a payment intent (Razorpay-backed) for an order.

### Parameters

- `Authorization` (header, required): Bearer <api-key> (e.g. sk_test_... in sandbox, sk_live_... in production). The x-api-key header is also accepted.
- `Idempotency-Key` (header, optional): Optional idempotency key.
- `externalOrderId` (string, required): Your reference for the order being paid.
- `amountMinor` (integer, required): Amount in minor units (paise); positive integer.
- `currency` (string, required): Currency code, at least 3 characters, e.g. INR.
- `paymentConnectionId` (string, required): Id of one of your active payment connections.

### Request example

```json
{
  "externalOrderId": "ord_ext_123",
  "amountMinor": 50000,
  "currency": "INR",
  "paymentConnectionId": "pc_8d1f3a2b"
}
```

### Response example

```json
{
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "externalOrderId": "ord_ext_123",
  "coreOrderId": null,
  "amountMinor": 50000,
  "currency": "INR",
  "status": "CREATED",
  "providerIntentId": "order_Nf3k2m9QxPz1Ab",
  "createdAt": "2026-10-15T09:41:07.000Z"
}
```

## Get a payment intent

`GET https://api-b2b.stampmitra.in/v1/payments/intents/:id`

Required scope: `payments.read`

Fetch the current state of a payment intent.

### Parameters

- `Authorization` (header, required): Bearer <api-key> (e.g. sk_test_... in sandbox, sk_live_... in production). The x-api-key header is also accepted.

### Response example

```json
{
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "externalOrderId": "ord_ext_123",
  "coreOrderId": null,
  "amountMinor": 50000,
  "currency": "INR",
  "status": "CREATED",
  "providerIntentId": "order_Nf3k2m9QxPz1Ab",
  "createdAt": "2026-10-15T09:41:07.000Z"
}
```

## Get an order's payment

`GET https://api-b2b.stampmitra.in/v1/orders/:id/payment`

Required scope: `orders.read`

Fetch the payment associated with a given order.

### Parameters

- `Authorization` (header, required): Bearer <api-key> (e.g. sk_test_... in sandbox, sk_live_... in production). The x-api-key header is also accepted.
