ClientCasa
API

Sales

Read sales — money collected at the moment of the exchange. Read-only, because a sale is born settled through the point of sale, the composer, or a revenue connector.

An invoice is collect later; a sale is collect now. A sale is created already settled, carrying its payment, its line items and its books entries in one transaction — so this resource is read-only. Sales are created at the point of sale, in the sale composer, or by a revenue connector importing from a Stripe account you own.

A sale's line items are its posted revenue and its status is derived from refunds, so there is nothing a PATCH could safely change either. A mis-rung sale is corrected the way a till corrects one: refund it, or void it, then re-ring.

Scope: sales:read (read:sales for OAuth). There is no write scope.

total is tax-inclusive. The books record sale revenue pre-tax, so this figure will not equal a Schedule C revenue line. Both are correct and they differ — don't reconcile them. taxAmount tells you the difference.

A voided sale is not revenue. status: "voided" means the exchange was retracted and the books reversed it. Its totals are historical. Filter with ?status= when you want a specific lifecycle, and exclude voided from any revenue figure you compute.

clientId is null for a walk-up sale. That's a real answer, not missing data.

GET
/api/v1/sales
x-api-key<token>

In: header

Query Parameters

page?integer
Default1
Range1 <= value
pageSize?integer
Default25
Range1 <= value <= 100
status?string
Value in"completed" | "refunded" | "partially-refunded" | "voided"
channel?string
Value in"pos" | "manual" | "stripe" | "shopify" | "etsy" | "square-import" | "api"
clientId?string

UUID v4

Formatuuid
businessId?string

UUID v4

Formatuuid
saleDateFrom?string
Formatdate
saleDateTo?string
Formatdate

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://www.clientcasa.com/api/v1/sales"
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "saleNumber": "string",
      "businessId": "550e8400-e29b-41d4-a716-446655440000",
      "clientId": "550e8400-e29b-41d4-a716-446655440000",
      "contactId": "550e8400-e29b-41d4-a716-446655440000",
      "channel": "pos",
      "externalId": "string",
      "saleDate": "2019-08-24",
      "currency": "string",
      "status": "completed",
      "voidedAt": "2019-08-24T14:15:22Z",
      "voidReason": "string",
      "taxJurisdiction": "string",
      "taxInclusive": true,
      "subtotal": 0,
      "discountPercent": 0,
      "discountAmount": 0,
      "taxRate": 0,
      "taxAmount": 0,
      "total": 0,
      "amountRefunded": 0,
      "notes": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 1,
    "total": 0,
    "totalPages": 0,
    "hasMore": true
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}
GET
/api/v1/sales/{id}
x-api-key<token>

In: header

Path Parameters

id*string

UUID v4

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://www.clientcasa.com/api/v1/sales/550e8400-e29b-41d4-a716-446655440000"
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "saleNumber": "string",
  "businessId": "550e8400-e29b-41d4-a716-446655440000",
  "clientId": "550e8400-e29b-41d4-a716-446655440000",
  "contactId": "550e8400-e29b-41d4-a716-446655440000",
  "channel": "pos",
  "externalId": "string",
  "saleDate": "2019-08-24",
  "currency": "string",
  "status": "completed",
  "voidedAt": "2019-08-24T14:15:22Z",
  "voidReason": "string",
  "taxJurisdiction": "string",
  "taxInclusive": true,
  "subtotal": 0,
  "discountPercent": 0,
  "discountAmount": 0,
  "taxRate": 0,
  "taxAmount": 0,
  "total": 0,
  "amountRefunded": 0,
  "notes": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "code": "archived_record_read_only",
      "property1": null,
      "property2": null
    }
  }
}