Skip to main content
GET
/
v1
/
sales
Get all sales
curl --request GET \
  --url https://dev.flextell.ai/api/v1/sales \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Tenant: <x-tenant>'
{
  "data": [
    {
      "id": 123,
      "tenant_id": 123,
      "user_id": 123,
      "customer_id": 123,
      "appointment_id": 123,
      "currency_id": 123,
      "exchange_rate": 123,
      "notes": "<string>",
      "status": "<string>",
      "total_price": 123,
      "remaining_balance": 123,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "deleted_at": "2023-11-07T05:31:56Z",
      "customer": {
        "id": 123,
        "first_name": "<string>",
        "last_name": "<string>",
        "phone_number": "<string>",
        "email": "<string>"
      },
      "user": {
        "id": 123,
        "name": "<string>"
      },
      "currency": {
        "id": 123,
        "code": "<string>",
        "symbol": "<string>",
        "name": "<string>"
      },
      "items": [
        {
          "id": 123,
          "sale_id": 123,
          "staff_id": 123,
          "order": 123,
          "itemable_type": "<string>",
          "itemable_id": 123,
          "warehouse_id": 123,
          "quantity": 123,
          "tax_rate": 123,
          "unit_price": 123,
          "cost_price": 123,
          "discount_amount": 123,
          "discount_percentage": 123,
          "sub_total": 123,
          "total_discount": 123,
          "total_tax": 123,
          "total_price": 123,
          "staff": {
            "id": 123,
            "name": "<string>"
          },
          "itemable": {
            "id": "<string>",
            "name": "<string>"
          }
        }
      ]
    }
  ],
  "links": {
    "first": "<string>",
    "last": "<string>",
    "prev": "<string>",
    "next": "<string>"
  },
  "meta": {
    "current_page": 2,
    "from": 2,
    "last_page": 2,
    "links": [
      {
        "url": "<string>",
        "label": "<string>",
        "active": true
      }
    ],
    "path": "<string>",
    "per_page": 1,
    "to": 2,
    "total": 1
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

X-Tenant
number
required

Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.

Query Parameters

search
string | null

The search query.

Maximum string length: 255
per_page
integer | null

The number of items per page.

Required range: 1 <= x <= 100
page
integer | null

The page number.

Required range: x >= 1
sort_by
enum<string> | null

The field to sort by.

Available options:
created_at,
updated_at,
status
sort_order
enum<string> | null

The sort direction (asc or desc).

Available options:
asc,
desc
customer_id
integer | null

Filter by customer ID.

user_id
integer | null

Filter by user ID.

status
enum<string> | null

Filter by status.

Available options:
draft,
completed,
cancelled,
invoiced,
pending
created_at_from
string<date-time> | null

Filter records created on or after this date.

created_at_to
string<date-time> | null

Filter records created on or before this date.

trashed
boolean | null

Include only soft-deleted records.

Response

Paginated set of SaleResource

data
SaleResource · object[]
required
meta
object
required