Skip to content

Instantly share code, notes, and snippets.

@lsaville
Created April 5, 2017 14:25
Show Gist options
  • Save lsaville/c4b38db5a62cda038f03a641632d37e7 to your computer and use it in GitHub Desktop.
Save lsaville/c4b38db5a62cda038f03a641632d37e7 to your computer and use it in GitHub Desktop.

Record Endpoints

  • GET /api/v1/merchants
  • GET /api/v1/merchants/:id
  • GET /api/v1/merchants/find?parameters
    • id: Search based on primary key
    • name: Search based on the name attribute
    • created_at: Search based on the created_at timestamp
    • updated_at: Search based on the updated_at timestamp
  • GET /api/v1/merchants/find_all?parameters
    • Same parameters as above.
  • GET api/v1/merchants/random

Relationship Endpoints

Merchants
  • GET /api/v1/merchants/:id/items
  • GET /api/v1/merchants/:id/invoices
Invoices
  • GET /api/v1/invoices/:id/transactions
  • GET /api/v1/invoices/:id/invoice_items
  • GET /api/v1/invoices/:id/items
  • GET /api/v1/invoices/:id/customer
  • GET /api/v1/invoices/:id/merchant
Invoice Items
  • GET /api/v1/invoice_items/:id/invoice
  • GET /api/v1/invoice_items/:id/item
Items
  • GET /api/v1/items/:id/invoice_items
  • GET /api/v1/items/:id/merchant
Transactions
  • GET /api/v1/transactions/:id/invoice
Customers
  • GET /api/v1/customers/:id/invoices
  • GET /api/v1/customers/:id/transactions

Business Intelligence Endpoints

All Merchants
  • GET /api/v1/merchants/most_revenue?quantity=x
  • GET /api/v1/merchants/most_items?quantity=x
  • GET /api/v1/merchants/revenue?date=x
Single Merchant
  • GET /api/v1/merchants/:id/revenue
  • GET /api/v1/merchants/:id/revenue?date=x
  • GET /api/v1/merchants/:id/favorite_customer
  • GET /api/v1/merchants/:id/customers_with_pending_invoices
Items
  • GET /api/v1/items/most_revenue?quantity=x
  • GET /api/v1/items/most_items?quantity=x
  • GET /api/v1/items/:id/best_day
Customers
  • GET /api/v1/customers/:id/favorite_merchant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment