Reference

Endpoints

Auth, customers, items, sales, purchasing, payments and receipts.

Every path below is relative to the base URL https://gulfpay-production.up.railway.app/api/v1. Unless marked Public, an endpoint requires a Authorization: Bearer <token> header and honours the X-Company-Id scope. A :idsegment is the resource's identifier. This is a representative reference of the most-used resources — the product exposes many more modules on the same conventions.

Looking for the complete list?

This page is a curated, hand-written reference of the most-used resources. For the exhaustive, always-current catalogue of every endpoint, browse the API catalog at api.grivaone.com — or import the machine-readable OpenAPI spec.

Shared document actions

Most sales and purchase documents also share housekeeping actions: PATCH /:id/status, PATCH /:id/lock, PATCH /:id/discount, PATCH /:id/charges and POST /:id/duplicate. Only the distinctive routes per resource are listed below to keep the reference readable.

Authentication

See Authentication for the full login flow.

POST/auth/loginPublic

Exchange email + password for tokens (or a pre-auth OTP challenge).

POST/auth/verify-otpBearer

Complete a two-factor login using the pre-auth token as the bearer.

POST/auth/resend-otpBearer

Resend the one-time code for a pending OTP challenge.

POST/auth/refreshPublic

Mint a new access token from a refresh token (token is not rotated).

POST/auth/logoutPublic

Revoke the refresh token / clear the session cookie.

GET/auth/meBearer

Return the current authenticated user.

POST/auth/change-passwordBearer

Change the password and revoke every other session.

GET/auth/sessionsBearer

List the caller’s active sessions (current flagged).

DELETE/auth/sessions/:idBearer

Revoke one of the caller’s sessions.

POST/auth/sessions/revoke-othersBearer

Revoke every session except the current one.

Customers

GET/customersBearer

List customers (paginated, searchable, sortable).

GET/customers/check-duplicateBearer

Check whether a customer name / identifier already exists.

GET/customers/:idBearer

Retrieve a single customer.

GET/customers/:id/financialsBearer

Retrieve a customer’s outstanding balance and financial summary.

POST/customersBearer

Create a customer.

PATCH/customers/:idBearer

Update a customer.

DELETE/customers/:idBearer

Delete a customer.

Items

GET/itemsBearer

List items / products (paginated, searchable, sortable).

GET/items/check-duplicateBearer

Check whether an item code / name already exists.

GET/items/:idBearer

Retrieve a single item.

POST/itemsBearer

Create an item.

PATCH/items/:idBearer

Update an item.

DELETE/items/:idBearer

Delete an item.

POST/items/:id/imageBearer

Upload an item image (base64 body).

GET/items/:id/imagePublic

Fetch an item image (public so it can be embedded).

DELETE/items/:id/imageBearer

Remove an item image.

Vendors

GET/vendorsBearer

List vendors / suppliers.

GET/vendors/check-duplicateBearer

Check whether a vendor already exists.

GET/vendors/:idBearer

Retrieve a single vendor.

POST/vendorsBearer

Create a vendor.

PATCH/vendors/:idBearer

Update a vendor.

DELETE/vendors/:idBearer

Delete a vendor.

Sales documents

The sales cycle flows from quotation through to a paid invoice:

QuotationSales OrderDelivery NoteSales InvoiceReceipt

Quotations

GET/quotationsBearer

List quotations.

GET/quotations/:idBearer

Retrieve a quotation.

POST/quotationsBearer

Create a quotation.

PATCH/quotations/:idBearer

Update a quotation.

PATCH/quotations/:id/statusBearer

Change a quotation’s status.

POST/quotations/:id/convert-to-sales-orderBearer

Convert a quotation into a sales order.

POST/quotations/:id/convert-to-sales-invoiceBearer

Convert a quotation into a sales invoice.

POST/quotations/:id/convert-to-delivery-noteBearer

Convert a quotation into a delivery note.

DELETE/quotations/:idBearer

Delete a quotation.

Sales orders

GET/sales-ordersBearer

List sales orders.

GET/sales-orders/:idBearer

Retrieve a sales order.

POST/sales-ordersBearer

Create a sales order.

PATCH/sales-orders/:idBearer

Update a sales order.

PATCH/sales-orders/:id/statusBearer

Change a sales order’s status.

POST/sales-orders/:id/convert-to-sales-invoiceBearer

Convert a sales order into a sales invoice.

POST/sales-orders/:id/convert-to-delivery-noteBearer

Convert a sales order into a delivery note.

DELETE/sales-orders/:idBearer

Delete a sales order.

Delivery notes

GET/delivery-notesBearer

List delivery notes.

GET/delivery-notes/:idBearer

Retrieve a delivery note.

POST/delivery-notesBearer

Create a delivery note (moves stock out).

PATCH/delivery-notes/:idBearer

Update a delivery note.

PATCH/delivery-notes/:id/statusBearer

Change a delivery note’s status.

POST/delivery-notes/:id/convert-to-sales-invoiceBearer

Convert a delivery note into a sales invoice.

DELETE/delivery-notes/:idBearer

Delete a delivery note.

Sales invoices

GET/sales-invoicesBearer

List sales invoices.

GET/sales-invoices/:idBearer

Retrieve a sales invoice.

POST/sales-invoicesBearer

Create a sales invoice.

PATCH/sales-invoices/:idBearer

Update a sales invoice.

PATCH/sales-invoices/:id/statusBearer

Change an invoice’s status.

POST/sales-invoices/:id/record-paymentBearer

Record a payment against the invoice.

POST/sales-invoices/:id/zatca-qrBearer

Generate the ZATCA e-invoicing QR for the invoice.

DELETE/sales-invoices/:idBearer

Delete a sales invoice.

Sales returns

GET/sales-returnsBearer

List sales returns / credit notes.

POST/sales-returnsBearer

Create a sales return.

POST/sales-returns/from-invoice/:invoiceIdBearer

Create a sales return from an existing invoice.

POST/sales-returns/:id/process-refundBearer

Process the refund for an approved return.

DELETE/sales-returns/:idBearer

Delete a sales return.

Creating a document posts a JSON body with header fields and line items:

curl · POST /quotations
curl -X POST https://gulfpay-production.up.railway.app/api/v1/quotations \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "X-Company-Id: cmp_123" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 3b9a1c7e-2d54-4a11-8e0f-6c2b9d4a1f88" \
  -d '{
    "customerId": "cus_123",
    "date": "2026-09-06",
    "lines": [
      { "itemId": "itm_1", "quantity": 10, "unitPrice": 25.00, "taxRate": 15 }
    ]
  }'

Purchase documents

The purchase cycle mirrors the sales cycle:

Purchase OrderGoods ReceiptPurchase InvoicePayment

Purchase orders

GET/purchase-ordersBearer

List purchase orders.

GET/purchase-orders/:idBearer

Retrieve a purchase order.

POST/purchase-ordersBearer

Create a purchase order.

PATCH/purchase-orders/:idBearer

Update a purchase order.

POST/purchase-orders/:id/convert-to-goods-receiptBearer

Convert a purchase order into a goods receipt.

POST/purchase-orders/:id/convert-to-purchase-invoiceBearer

Convert a purchase order into a purchase invoice.

DELETE/purchase-orders/:idBearer

Delete a purchase order.

Goods receipts

GET/goods-receiptsBearer

List goods receipts (GRNs).

GET/goods-receipts/:idBearer

Retrieve a goods receipt.

POST/goods-receiptsBearer

Create a goods receipt (moves stock in).

PATCH/goods-receipts/:idBearer

Update a goods receipt.

POST/goods-receipts/:id/convert-to-purchase-invoiceBearer

Convert a goods receipt into a purchase invoice.

DELETE/goods-receipts/:idBearer

Delete a goods receipt.

Purchase invoices

GET/purchase-invoicesBearer

List purchase invoices / bills.

GET/purchase-invoices/:idBearer

Retrieve a purchase invoice.

POST/purchase-invoicesBearer

Create a purchase invoice.

PATCH/purchase-invoices/:idBearer

Update a purchase invoice.

POST/purchase-invoices/:id/record-paymentBearer

Record a payment against the bill.

DELETE/purchase-invoices/:idBearer

Delete a purchase invoice.

Purchase returns

GET/purchase-returnsBearer

List purchase returns / debit notes.

POST/purchase-returnsBearer

Create a purchase return.

POST/purchase-returns/from-invoice/:invoiceIdBearer

Create a purchase return from an existing bill.

POST/purchase-returns/:id/process-refundBearer

Process the refund for an approved return.

DELETE/purchase-returns/:idBearer

Delete a purchase return.

Receipts & payments

Receipts record money received from customers; payments record money paid to vendors. Both can be allocated across one or more open documents.

Receipts (money in)

GET/receiptsBearer

List customer receipts (money in).

GET/receipts/customer-outstandingBearer

List customers with outstanding balances to receive against.

GET/receipts/:idBearer

Retrieve a receipt.

POST/receiptsBearer

Create a receipt and allocate it to invoices.

PATCH/receipts/:idBearer

Update a receipt.

DELETE/receipts/:idBearer

Delete a receipt.

Payments (money out)

GET/paymentsBearer

List vendor payments (money out).

GET/payments/vendor-outstandingBearer

List vendors with outstanding balances to pay against.

GET/payments/:idBearer

Retrieve a payment.

POST/paymentsBearer

Create a payment and allocate it to bills.

PATCH/payments/:idBearer

Update a payment.

DELETE/payments/:idBearer

Delete a payment.