Skip to content

Instantly share code, notes, and snippets.

@GSmes
Last active September 8, 2016 22:21
Show Gist options
  • Save GSmes/1bcccac76d0ceeac041462c21f28a6de to your computer and use it in GitHub Desktop.
Save GSmes/1bcccac76d0ceeac041462c21f28a6de to your computer and use it in GitHub Desktop.

Business Intelligence Endpoints

Person A

  • GET /api/v1/items/:id/best_day
  • returns the date with the most sales for the given item using the invoice date. If there are multiple days with equal number of sales, return the most recent day.
  • GET /api/v1/items/most_revenue?quantity=x
  • returns the top x items ranked by total revenue generated.
  • GET /api/v1/items/most_items?quantity=x
  • returns the top x item instances ranked by total number sold.
  • GET /api/v1/customers/:id/favorite_merchant
  • returns a merchant where the customer has conducted the most successful transactions.
  • GET /api/v1/merchants/most_items?quantity=x
  • returns the top x merchants ranked by total number of items sold.

Person B

  • GET /api/v1/merchants/:id/revenue
  • returns the total revenue for that merchant across all transactions.
  • GET /api/v1/merchants/:id/revenue?date=x
  • returns the total revenue for that merchant for a specific invoice date x.
  • GET /api/v1/merchants/:id/customers_with_pending_invoices
  • returns a collection of customers which have pending (unpaid) invoices.
  • GET /api/v1/merchants/:id/favorite_customer
  • returns the customer who has conducted the most total number of successful transactions.
  • GET /api/v1/merchants/revenue?date=x
  • returns the total revenue for date x across all merchants.
  • GET /api/v1/merchants/most_revenue?quantity=x
  • returns the top x merchants ranked by total revenue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment