cURL
curl --request POST \ --url https://api.digitalreceiptprotocol.org/api/v1/keys/grant-access \ --header 'Content-Type: application/json' \ --data ' { "userId": "usr_f8e7d6c5-b4a3-4c2d-1e0f-9a8b7c6d5e4f", "keyId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" } '
{ "success": true, "data": { "tokenId": "tok_9a8b7c6d-5e4f-3a2b-1c0d-e9f8a7b6c5d4", "userId": "usr_f8e7d6c5-b4a3-4c2d-1e0f-9a8b7c6d5e4f", "keyId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d", "purpose": "decrypt", "grantedAt": "2025-12-18T10:35:00Z", "expiresAt": "2025-12-18T10:38:00Z", "sourceIp": "192.168.1.100" } }
Issue a short-lived access token (2-3 minutes) for receipt decryption. The source IP is logged for audit purposes. Maximum 5 active tokens per user.
User ID requesting access
"550e8400-e29b-41d4-a716-446655440001"
Key ID to grant access for
"550e8400-e29b-41d4-a716-446655440000"
Access granted successfully
true
Show child attributes