Skip to main content
POST
/
api
/
v1
/
payments
/
decrypt
Decrypt receipt by payment ID
curl --request POST \
  --url https://api.digitalreceiptprotocol.org/api/v1/payments/decrypt \
  --header 'Content-Type: application/json' \
  --data '
{
  "paymentId": "pi_stripe_abc123",
  "gateway": "stripe",
  "accessTokenId": "tok_9a8b7c6d-5e4f-3a2b-1c0d-e9f8a7b6c5d4",
  "privateKey": "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDP..."
}
'
{
  "success": true,
  "data": {
    "version": "1.0",
    "receiptId": "rcpt_abc123def456",
    "merchant": {
      "merchantId": "merch_kitchenmart_001",
      "name": "KitchenMart",
      "address": {
        "street": "456 Commerce Ave",
        "city": "San Francisco",
        "state": "CA",
        "postalCode": "94103",
        "country": "US"
      }
    },
    "transaction": {
      "transactionId": "txn_550e8400e29b41d4a716",
      "datetime": "2025-12-18T10:30:00Z",
      "paymentMethod": "card",
      "cardDetails": {
        "last4": "4242",
        "brand": "visa"
      }
    },
    "items": [
      {
        "lineItemId": "item_001",
        "name": "Stainless Steel Mixing Bowl Set",
        "quantity": 1,
        "unitPrice": 2999,
        "totalPrice": 2999
      },
      {
        "lineItemId": "item_002",
        "name": "Non-Stick Frying Pan",
        "quantity": 2,
        "unitPrice": 3999,
        "totalPrice": 7998
      }
    ],
    "summary": {
      "subtotal": 10997,
      "totalTax": 962,
      "total": 11959,
      "currency": "USD"
    },
    "createdAt": "2025-12-18T10:30:00Z"
  }
}

Body

application/json
paymentId
string
required

Payment ID from the gateway (e.g., pi_... for Stripe)

gateway
enum<string>
required
Available options:
stripe,
square
accessTokenId
string
required
privateKey
string
required

Response

Receipt decrypted successfully

success
boolean
Example:

true

data
object