Skip to main content
POST
/
api
/
v1
/
payments
/
{gateway}
/
create
Create payment with DRP
curl --request POST \
  --url https://api.digitalreceiptprotocol.org/api/v1/payments/{gateway}/create \
  --header 'Content-Type: application/json' \
  --data '
{
  "version": "1.0",
  "receiptId": "rcpt_payment_001",
  "merchantId": "mer_001",
  "merchantName": "Test Merchant",
  "merchantStreet": "123 Main St",
  "merchantCity": "San Francisco",
  "merchantState": "CA",
  "merchantPostalCode": "94105",
  "merchantCountry": "US",
  "transactionId": "txn_001",
  "transactionDate": "2024-12-18T00:00:00Z",
  "transactionTimezone": "UTC",
  "paymentMethod": "card",
  "currency": "USD",
  "subtotal": 2000,
  "taxAmount": 0,
  "totalAmount": 2000,
  "items": [
    {
      "lineItemId": "li_001",
      "name": "Widget",
      "quantity": 1,
      "unitPrice": 1000,
      "totalPrice": 1000
    }
  ],
  "recipientHashedPan": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",
  "amount": 1000,
  "cardNonce": "cnon:card-nonce-ok"
}
'
{
  "success": true,
  "data": {
    "paymentId": "<string>",
    "clientSecret": "<string>",
    "orderId": "<string>",
    "drpMetadata": {}
  }
}

Path Parameters

gateway
enum<string>
required

Payment gateway provider

Available options:
stripe,
square

Body

application/json

Unified payment request structure for all gateways. Uses flattened receipt fields at root level (same as EncryptReceiptRequest).

version
string
default:1.0
required
receiptId
string
default:550e8400-e29b-41d4-a716-446655440003
required
merchantId
string
default:550e8400-e29b-41d4-a716-446655440004
required
merchantName
string
default:KitchenMart
required
transactionId
string
default:550e8400-e29b-41d4-a716-446655440005
required
transactionDate
string<date-time>
default:2025-12-18T10:30:00Z
required
currency
string
default:usd
required

ISO currency code (defaults to usd)

recipientHashedPan
string
required

Hashed PAN of the recipient

Example:

"5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"

amount
integer
default:11959
required

Amount in cents (required for Stripe, derived from items for Square)

merchantStreet
string
default:456 Commerce Ave
merchantCity
string
default:San Francisco
merchantState
string
default:CA
merchantPostalCode
string
default:94103
merchantCountry
string
default:US
merchantTaxId
string
default:98-7654321
merchantContactEmail
string
transactionTimezone
string
default:America/Los_Angeles
paymentMethod
string
default:card
cardLast4
string
default:4242
cardBrand
string
default:visa
subtotal
integer
default:2000
taxAmount
integer
default:0
totalAmount
integer
default:2000
items
object[]
mockItems
boolean
default:true

If true and items are empty, generates mock line items

cardNonce
string
default:cnon:card-nonce-ok

Card nonce for Square payments (optional)

Response

Payment created successfully

success
boolean
Example:

true

data
object