Order Lifecycle

Buyer visits checkout link


POST /api/v2/public/checkout/:slug/pay


Order created (status: "pending")


Payment webhook received

   ┌────┴────┐
   ▼         ▼
"paid"    "failed"


Auto-delivery triggered


Order status: "delivered"

Polling Order Status (For Buyers)

The checkout success page polls order status to confirm payment and display delivery:
GET /api/v2/public/checkout/{slug}/order/{orderId}
{
  "success": true,
  "data": {
    "id": "ord_01j2k3",
    "status": "paid",
    "buyer_email": "buyer@example.com",
    "amount": 50000,
    "currency": "UGX",
    "delivery_content": "Your download link: https://your-storage.com/xyz123",
    "content_type": "link",
    "created_at": "2024-07-15T10:00:00Z"
  }
}

Managing Orders (Dashboard API)

List All Orders

GET /api/v2/digital/orders
Authorization: Cookie session

Get a Single Order

GET /api/v2/digital/orders/{id}

Update Order Status

PUT /api/v2/digital/orders/{id}/status
Content-Type: application/json

{"status": "delivered"}

Update Delivery Content

Override the delivery content for a specific order (useful for manual fulfillment):
PUT /api/v2/digital/orders/{id}/delivery
Content-Type: application/json

{
  "delivery_content": "Your license key: XXXX-YYYY-ZZZZ-WWWW",
  "content_type": "text"
}

Content Types

TypeDeliveryExample
fileDirect file URL (hosted on cloud storage)https://cdn.example.com/ebook.pdf
linkExternal URLhttps://gumroad.com/d/abc123
textPlain text shown on success pageLicense key: XXXX-YYYY

File Upload

Upload product files directly to RohoPay’s cloud storage (Backblaze B2):
POST /api/v2/digital/upload
Content-Type: multipart/form-data

file=@/path/to/ebook.pdf
Response:
{
  "success": true,
  "data": {
    "url": "https://your-storage.com/uploads/user-123/ebook.pdf",
    "filename": "ebook.pdf",
    "size": 2048000
  }
}
Use the returned url as the delivery_content for your product.

Download Resource (Buyer)

Buyers access their purchased resource via:
GET /api/v2/digital/orders/{id}/resource
This returns the delivery content — either the file, text, or link — after verifying the order is paid.

Refund / Failed Delivery

If a buyer reports a failed delivery:
  1. Go to Dashboard → Orders and find the order
  2. Click Retry Delivery to re-trigger the auto-delivery
  3. Or use the API: PUT /api/v2/digital/orders/{id}/delivery with the correct content
  4. Update the order status to delivered manually if needed

Analytics

View revenue per link from the dashboard or API:
GET /api/v2/digital/links/{id}/revenue
Includes:
  • Total revenue (sum of paid orders)
  • Order count
  • Conversion rate (paid / total initiated)