Skip to content

szmmon/REST-api-customers-invoices

Repository files navigation

Invoice-customer REST api laravel

Api made for working with customer-invoice data, tested with postman. Front-end done with alpine.js and tailwind css.

API use case

GIF demo

API

Get all customers

  GET /api/{{VERSION}}/customers

App Screenshot

Get all customers with invoices

  GET /api/{{VERSION}}/customers?includeInvoices=true

App Screenshot

Get customer

  GET /api/{{VERSION}}/customers/{id}

App Screenshot

Parameter Type Description
id int Id of customer to fetch

Edit customer

  PUT/PATCH /api/{{VERSION}}/customers/{id}

App Screenshot

Filter customers

  GET/api/{{VERSION}}/customers?{parameter}[{comparison}]={value}

Example: Get customers where "type" is equal to "I" App Screenshot

Available comparison operators:

Operator Type Description
[eq] int/string equal
[ne] int/string not equal
[lt] int less than
[lte] int less than or equal
[gt] int greater than
[gte] int greater than or equal

Get all invoices

  GET /api/{{VERSION}}/invoices

App Screenshot

Parameter Type Description
id int Id of invoice to fetch

Get invoice

  GET /api/{{VERSION}}/invoices/{id}

App Screenshot

Edit invoice

  PUT/PATCH /api/{{VERSION}}/invoices/{id}

App Screenshot

Add invoice

  POST /api/{{VERSION}}/invoices

App Screenshot

Bulk add invoices

  POST /api/{{VERSION}}/invoices/bulk

App Screenshot

Filter invoices

  GET/api/{{VERSION}}/invoices?{parameter}[{comparison}]={value}

Example: Get invoices where "amount" is greater than or equal to 3000 App Screenshot

Available comparison operators:

Operator Type Description
[eq] int/string equal
[ne] int/string not equal
[lt] int less than
[lte] int less than or equal
[gt] int greater than
[gte] int greater than or equal

Selected features

  • Seeder for customers and invoices

  • Bulk adding invoices

  • Filtering for equality, greater than etc.

  • Including invoices for customer in one endpoint

Presentation

  • Customers viewing and filtering, data coming from api. App Screenshot

  • Creating new invoice, done with POST request to api. App Screenshot

  • Editing invoices, done with PUT and PATCH requests. App Screenshot

  • Generating pdf invoices, done with library laravel-invoices App Screenshot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages