API Usage Overview
WARNING
Each routes should be used with prefix /api/v1
This document outlines the Guest, Admin, and Notary/PPAT APIs to facilitate menu, order, billing, payment, and stock management processes. The overview ensures clarity on each API's purpose and usage.
Authentication
Sign In:
- POST
/auth/signin
Authenticates a user with email or phone and password, returning an access token on successful login.
Guest Registration
Sign Up:
- POST
/auth/signup
Registers a new user, initiating the account creation and email confirmation process.
Confirm Registration:
- GET
/auth/signup/confirmConfirms the user's registration using a verification code sent via email.
Check Registration Status:
- GET
/auth/signup/status
Checks the current status of the user's registration, verifying if the account has been confirmed.
Resend Confirmation Code:
- POST
/auth/signup/resend
Resends the confirmation code for completing the registration process.
Cancel Registration:
- POST
/auth/signup/cancel
Cancels the registration, allowing the user to modify their registration details if necessary.
Guest API
Get Account:
- GET
/guest/account
Returns account guest status and information including guest profile.
Edit Account:
- PUT
/guest/account
Returns account guest information - PATCH
/guest/account
Returns account guest information
Edit Identity:
- PUT
/guest/identity
Edit guest identity information by syncing identity data to received valid request. - PATCH
/guest/identity
Edit guest identity information for each attribute received in valid request. - POST
/guest/document/ktp
Uploads guest's KTP document. Replacing previous document if any.
Documents:
- GET
/guest/document
Returns Guest's documents
Order API
The API open to ADMIN and GUEST.
Get Order:
- GET
/order
Allows Admin to view incoming orders and their own orders for Guest.
Get Form Data:
- GET
/order/form
Returns initial form data such as subject list for later order creation.
Create Order:
- POST
/order
Allows Admin and Guest to create order. This API called not only when the order was submitted, but also when user saved it to draft.
Create Order:
- POST
/order/:id/subject
Allows Admin and Guest to create order. This API called not only when the order was submitted, but also when user saved it to draft.
Edit Order:
Guest can only edit order when order status in DRAFT and REJECTED
- PUT
/order/:id
Allows Admin or Guest to edit order by syncing the order data to received valid request. - PATCH
/order/:id
Allows Admin or Guest to edit order each attributes found in the received valid request.
Delete Order:
Requries ADMIN access.
- POST
/office/invitation/create
Allows Admin to delete order. Recomend to edit order status to CLOSED instead delete.
Task API
Scoreboard:
- GET
/tasks/invitation/create
Allows Admin and Office Member to view progress overview.
Office API
INFO
The following API can only be accessed by ADMIN user with some exception.
These routes are used to manage office configuration such as service, invite office members.
Create Invitation:
- POST
/office/invitation/create
Allows Admin to create invitation link includes user roles and email.
Create Office Member:
- POST
/office/invitation/create
Allows Admin to create invitation link includes user roles and email.
Delete Office Member:
- POST
/office/invitation/create
Allows Admin to create invitation link includes user roles and email.
Get Service List:
INFO
This API didn't need ADMIN access since this list is open.
- GET
/office/service
Return list of services. - GET
/office/service/:id
Return service details.
Create Service:
- POST
/office/service/:id
Allows Admin to create new service including the service fee and task.
Edit Service:
- PUT
/office/service/:id
Allows Admin to edit service by sync the service data to received request. - PATCH
/office/service/:id
Allows Admin to edit service attribute values from received attribute in valid request.
Close Service:
- PATCH
/office/service/:id
Allows Admin to hide service from the public.
Delete Service:
- DELETE
/office/service/:id
Allows Admin to soft delete (hides) service from the list permanently. The reason it's not removed from database is because of previous orders reference to this service. If no orders found, it will removed permanently.
Invitation
Open Invitation:
- GET
/invitation/open
Checks if invitation exists and redirect to invitation page, if not, redirect to 404 page.
Accept Invitation:
- POST
/invitation/accept
Accepts user input from app and generates access token if successful.