API & SDK Documentation

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 Header
Authorization: Bearer YOUR_API_KEY

Getting your API key

  1. Click “Get API Key” on the Developers page
  2. Sign up (or sign in) with your email and password
  3. Generate a new API key, then copy it immediately
  4. 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.

Installation
npm install @robopurse/pos-sdk
Initialize the SDK
import { 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.sessions

Start and manage POS sessions

sdk.qr

Parse and validate customer QR codes

sdk.transactions

Submit transaction data for receipt issuance

sdk.receipts

Retrieve platform-issued receipts

sdk.merchant

Manage profile, branding, and logo

sdk.verification

Verify receipt authenticity

Submit a Transaction
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"
Retrieve a Receipt
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

MethodEndpointDescription
POST/integrations/receiptsSubmit transaction data for receipt issuance
GET/integrations/receipts/:idRetrieve a receipt by ID
GET/integrations/submissions/:id/receiptGet receipt by submission ID
GET/integrations/sessions/:id/receiptsList receipts for a session
POST/integrations/receipts/verifyVerify receipt authenticity
GET/integrations/merchant/profileGet merchant profile
PUT/integrations/merchant/profileUpdate merchant profile
POST/integrations/merchant/logoUpload merchant logo
GET/integrations/merchant/brandingGet branding configuration
POST/integrations/merchant/brandingUpdate branding configuration
Example: Submit Transaction (cURL)
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

400

Bad Request

Invalid or missing parameters in the request body.

401

Unauthorized

Missing or invalid API key.

403

Forbidden

API key lacks permission for the requested resource.

404

Not Found

Receipt or resource does not exist.

409

Conflict

Duplicate idempotency key — transaction already submitted.

429

Rate Limited

Too many requests. Back off and retry with exponential delay.