API & SDK Reference
Everything you need to integrate with the RoboPurse platform. Use the JavaScript SDK for rapid integration or the REST API for full control.
Authentication
All API requests require a Bearer token. Include your API key in the Authorization header.
Authorization: Bearer YOUR_API_KEYGetting your API key
- Click “Get API Key” on the Developers page
- Sign up (or sign in) with your email and password
- Generate a new API key, then copy it immediately
- For security, API keys are shown only once (later you’ll only see key labels/status)
JavaScript SDK
The official TypeScript SDK for Node.js, browsers, and React Native.
npm install @robopurse/pos-sdkimport { RoboPurseSDK } from '@robopurse/pos-sdk';
const sdk = new RoboPurseSDK({
apiKey: 'YOUR_API_KEY',
merchantContext: { // optional
externalMerchantId: 'store-01',
merchantName: 'Acme Coffee',
locationId: 'loc-main',
terminalId: 'pos-1',
},
});SDK Modules
sdk.sessionsStart and manage POS sessions
sdk.qrParse and validate customer QR codes
sdk.transactionsSubmit transaction data for receipt issuance
sdk.receiptsRetrieve platform-issued receipts
sdk.merchantManage profile, branding, and logo
sdk.verificationVerify receipt authenticity
const result = await sdk.transactions.submit({
customerEmail: 'jane@example.com',
paymentMethod: 'card',
items: [
{ productName: 'Espresso', quantity: 2, unitPrice: 3.95 },
{ productName: 'Muffin', quantity: 1, unitPrice: 4.50, discount: 0.50 },
],
tax: 1.48,
});
console.log(result.submissionId); // "sub_abc123"
console.log(result.status); // "accepted"const receipt = await sdk.receipts.get('rcp_abc123');
console.log(receipt.total, receipt.items);
// Get by submission ID
const receipt2 = await sdk.receipts.getBySubmission('sub_abc123');
// List all receipts for a session
const receipts = await sdk.receipts.listBySession('sess_abc123');REST API
Base URL: https://robopurse.com
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /integrations/receipts | Submit transaction data for receipt issuance |
| GET | /integrations/receipts/:id | Retrieve a receipt by ID |
| GET | /integrations/submissions/:id/receipt | Get receipt by submission ID |
| GET | /integrations/sessions/:id/receipts | List receipts for a session |
| POST | /integrations/receipts/verify | Verify receipt authenticity |
| GET | /integrations/merchant/profile | Get merchant profile |
| PUT | /integrations/merchant/profile | Update merchant profile |
| POST | /integrations/merchant/logo | Upload merchant logo |
| GET | /integrations/merchant/branding | Get branding configuration |
| POST | /integrations/merchant/branding | Update branding configuration |
curl -X POST https://robopurse.com/integrations/receipts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"receipt_number": "INV-2024-0042",
"type": "sale",
"format": "digital",
"customer_email": "jane@example.com",
"payment_method": "card",
"payment_status": "completed",
"items": [
{ "product_name": "Espresso", "quantity": 2, "unit_price": 3.95 }
],
"tax": 0.79,
"total": 8.69
}'Error Codes
Bad Request
Invalid or missing parameters in the request body.
Unauthorized
Missing or invalid API key.
Forbidden
API key lacks permission for the requested resource.
Not Found
Receipt or resource does not exist.
Conflict
Duplicate idempotency key — transaction already submitted.
Rate Limited
Too many requests. Back off and retry with exponential delay.