{"info":{"name":"RAXIO API · 0.1","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json","description":"Explore customer links, deposits, withdrawals and event notifications. Set baseUrl and local credential variables, then run the main journey in order. Keep runId unchanged to retry the same intent; clear it to start another journey. Event delivery uses the configured callback destination."},"variable":[{"key":"baseUrl","value":"https://sandbox-api.raxiocards.com"},{"key":"merchantId","value":""},{"key":"raxioApiKey","value":""},{"key":"raxioApiSecret","value":"","type":"secret"},{"key":"runId","value":""},{"key":"depositOperationId","value":""},{"key":"withdrawalOperationId","value":""},{"key":"externalOperationId","value":""},{"key":"eventId","value":""},{"key":"deliveryAttempt","value":"1"}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["const resolvedUrl = new URL(pm.variables.replaceIn(pm.request.url.toString()));","if (resolvedUrl.pathname.startsWith('/v1/')) {","  const key = pm.variables.get('raxioApiKey');","  const secret = pm.variables.get('raxioApiSecret');","  if (!key || !secret) throw new Error('Set local raxioApiKey and raxioApiSecret variables first.');","  if (!pm.collectionVariables.get('runId')) pm.collectionVariables.set('runId', crypto.randomUUID());","  const body = pm.request.body?.mode === 'raw' ? pm.variables.replaceIn(pm.request.body.raw || '') : '';","  if (pm.request.body?.mode === 'raw') pm.request.body.update({ mode: 'raw', raw: body });","  const timestamp = String(Date.now());","  const nonce = crypto.randomUUID();","  const bytes = new TextEncoder();","  const hex = value => Array.from(new Uint8Array(value), b => b.toString(16).padStart(2, '0')).join('');","  const hash = hex(await crypto.subtle.digest('SHA-256', bytes.encode(body)));","  const canonical = [timestamp, pm.request.method.toUpperCase(), resolvedUrl.pathname + resolvedUrl.search, nonce, hash].join('.');","  const signingKey = await crypto.subtle.importKey('raw', bytes.encode(secret), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign']);","  const signature = hex(await crypto.subtle.sign('HMAC', signingKey, bytes.encode(canonical)));","  for (const [name, value] of Object.entries({ 'X-Raxio-Key': key, 'X-Raxio-Timestamp': timestamp, 'X-Raxio-Nonce': nonce, 'X-Raxio-Signature': signature })) pm.request.headers.upsert({ key: name, value });","}"]}}],"item":[{"name":"1 · Main wallet journey","item":[{"name":"Health","request":{"method":"GET","header":[],"url":{"raw":"{{baseUrl}}/health","host":["{{baseUrl}}"],"path":["health"]}}},{"name":"Link customer","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"{{runId}}-link"}],"url":{"raw":"{{baseUrl}}/v1/casino/customer-links","host":["{{baseUrl}}"],"path":["v1","casino","customer-links"]},"body":{"mode":"raw","raw":"{\n  \"merchantId\": \"{{merchantId}}\",\n  \"customerId\": \"player-001\",\n  \"raxioCustomerId\": \"test_player_001\"\n}","options":{"raw":{"language":"json"}}}}},{"name":"Create internal deposit","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"{{runId}}-deposit"}],"url":{"raw":"{{baseUrl}}/v1/casino/deposit-intents","host":["{{baseUrl}}"],"path":["v1","casino","deposit-intents"]},"body":{"mode":"raw","raw":"{\n  \"merchantId\": \"{{merchantId}}\",\n  \"customerId\": \"player-001\",\n  \"externalTransactionId\": \"{{runId}}-deposit\",\n  \"amount\": \"100.00\",\n  \"currency\": \"USD\",\n  \"source\": \"RAXIO_BALANCE\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"test","script":{"type":"text/javascript","exec":["if (pm.response.code === 202) pm.collectionVariables.set('depositOperationId', pm.response.json().data.operationId);"]}}]},{"name":"Read deposit state","request":{"method":"GET","header":[],"url":{"raw":"{{baseUrl}}/v1/casino/operations/{{depositOperationId}}","host":["{{baseUrl}}"],"path":["v1","casino","operations","{{depositOperationId}}"]}}},{"name":"Settle internal deposit","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"{{runId}}-deposit-settle"}],"url":{"raw":"{{baseUrl}}/v1/sandbox/operations/{{depositOperationId}}/simulate","host":["{{baseUrl}}"],"path":["v1","sandbox","operations","{{depositOperationId}}","simulate"]},"body":{"mode":"raw","raw":"{\n  \"outcome\": \"SETTLED\"\n}","options":{"raw":{"language":"json"}}}}},{"name":"Request withdrawal","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"{{runId}}-withdrawal"}],"url":{"raw":"{{baseUrl}}/v1/casino/withdrawals","host":["{{baseUrl}}"],"path":["v1","casino","withdrawals"]},"body":{"mode":"raw","raw":"{\n  \"merchantId\": \"{{merchantId}}\",\n  \"customerId\": \"player-001\",\n  \"externalTransactionId\": \"{{runId}}-withdrawal\",\n  \"amount\": \"50.00\",\n  \"currency\": \"USD\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"test","script":{"type":"text/javascript","exec":["if (pm.response.code === 202) pm.collectionVariables.set('withdrawalOperationId', pm.response.json().data.operationId);"]}}]},{"name":"Settle withdrawal","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"{{runId}}-withdrawal-settle"}],"url":{"raw":"{{baseUrl}}/v1/sandbox/operations/{{withdrawalOperationId}}/simulate","host":["{{baseUrl}}"],"path":["v1","sandbox","operations","{{withdrawalOperationId}}","simulate"]},"body":{"mode":"raw","raw":"{\n  \"outcome\": \"SETTLED\"\n}","options":{"raw":{"language":"json"}}}}},{"name":"Read signed withdrawal receipt","request":{"method":"GET","header":[],"url":{"raw":"{{baseUrl}}/v1/casino/operations/{{withdrawalOperationId}}/proof","host":["{{baseUrl}}"],"path":["v1","casino","operations","{{withdrawalOperationId}}","proof"]}}},{"name":"Read public signing keys","request":{"method":"GET","header":[],"url":{"raw":"{{baseUrl}}/.well-known/raxio-signing-keys.json","host":["{{baseUrl}}"],"path":[".well-known","raxio-signing-keys.json"]}}},{"name":"Inspect balances","request":{"method":"GET","header":[],"url":{"raw":"{{baseUrl}}/v1/sandbox/balances","host":["{{baseUrl}}"],"path":["v1","sandbox","balances"]}}},{"name":"Inspect events","request":{"method":"GET","header":[],"url":{"raw":"{{baseUrl}}/v1/sandbox/events","host":["{{baseUrl}}"],"path":["v1","sandbox","events"]}},"event":[{"listen":"test","script":{"type":"text/javascript","exec":["if (pm.response.code === 200) { const items = pm.response.json().data.items; if (items.length) pm.collectionVariables.set('eventId', items[items.length - 1].eventId); }"]}}]}]},{"name":"2 · External deposit simulation","item":[{"name":"Create external deposit","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"{{runId}}-external"}],"url":{"raw":"{{baseUrl}}/v1/casino/deposit-intents","host":["{{baseUrl}}"],"path":["v1","casino","deposit-intents"]},"body":{"mode":"raw","raw":"{\n  \"merchantId\": \"{{merchantId}}\",\n  \"customerId\": \"player-001\",\n  \"externalTransactionId\": \"{{runId}}-external\",\n  \"amount\": \"100.00\",\n  \"currency\": \"USD\",\n  \"source\": \"EXTERNAL_CRYPTO\"\n}","options":{"raw":{"language":"json"}}}},"event":[{"listen":"test","script":{"type":"text/javascript","exec":["if (pm.response.code === 202) pm.collectionVariables.set('externalOperationId', pm.response.json().data.operationId);"]}}]},{"name":"Confirm test transaction","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"{{runId}}-external-settle"}],"url":{"raw":"{{baseUrl}}/v1/sandbox/operations/{{externalOperationId}}/simulate","host":["{{baseUrl}}"],"path":["v1","sandbox","operations","{{externalOperationId}}","simulate"]},"body":{"mode":"raw","raw":"{\n  \"outcome\": \"SETTLED\",\n  \"txHash\": \"test_tx_{{runId}}\"\n}","options":{"raw":{"language":"json"}}}}}]},{"name":"3 · Optional callback delivery","item":[{"name":"Deliver selected event","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Idempotency-Key","value":"{{runId}}-deliver-{{deliveryAttempt}}"}],"url":{"raw":"{{baseUrl}}/v1/sandbox/events/{{eventId}}/deliver","host":["{{baseUrl}}"],"path":["v1","sandbox","events","{{eventId}}","deliver"]},"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}}}}]}]}