Skip to main content
POST
/
api
/
v1
/
transactions
Store transaction with receipt
curl --request POST \
  --url https://api.digitalreceiptprotocol.org/api/v1/transactions \
  --header 'Content-Type: application/json' \
  --data '
{
  "envelope": {
    "version": "1.0",
    "receiptId": "550e8400-e29b-41d4-a716-446655440003",
    "keyId": "550e8400-e29b-41d4-a716-446655440000",
    "keyBundle": {
      "encryptedAesKey": "encrypted_aes_key_base64...",
      "keyId": "550e8400-e29b-41d4-a716-446655440000",
      "algorithm": "RSA-OAEP-256"
    },
    "ciphertext": "encrypted_receipt_ciphertext_base64...",
    "iv": "initialization_vector_base64...",
    "authTag": "auth_tag_base64...",
    "merchantId": "550e8400-e29b-41d4-a716-446655440004",
    "transactionId": "550e8400-e29b-41d4-a716-446655440005",
    "createdAt": "2025-12-15T12:35:00Z",
    "expiresAt": "2025-12-16T12:35:00Z",
    "isEscrowed": false,
    "escrowKeyId": null
  },
  "paymentGateway": "stripe",
  "metadata": {
    "stripePaymentId": "pi_1234567890",
    "customField": "custom_value"
  }
}
'
{
  "success": true,
  "data": {
    "mappingId": "550e8400-e29b-41d4-a716-446655440007",
    "transactionId": "550e8400-e29b-41d4-a716-446655440005",
    "receiptId": "550e8400-e29b-41d4-a716-446655440003",
    "paymentGateway": "stripe",
    "gatewayMetadata": {},
    "createdAt": "2025-12-15T12:35:00Z"
  }
}

Body

application/json
envelope
object
required
paymentGateway
enum<string>
required
Available options:
stripe,
square,
other
Example:

"stripe"

metadata
object

Payment gateway specific metadata

Example:
{
"stripePaymentId": "pi_1234567890",
"customField": "custom_value"
}

Response

Transaction stored successfully

success
boolean
Example:

true

data
object