> ## Documentation Index
> Fetch the complete documentation index at: https://chariow.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Sale

> Retrieve details of a specific sale

Retrieves comprehensive information about a specific sale by its public ID, including customer details, product information, payment details, applied discounts, marketing campaign, shipping information, and customer rating.

## Path Parameters

<ParamField path="saleId" type="string" required>
  The unique sale public identifier (e.g., `sal_abc123xyz`)
</ParamField>

## Response

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Unique sale identifier (e.g., `sal_abc123xyz`)
    </ResponseField>

    <ResponseField name="status" type="string">
      Sale status (`awaiting_payment`, `completed`, `failed`, `abandoned`, `settled`)
    </ResponseField>

    <ResponseField name="channel" type="object">
      Sales channel information

      <Expandable title="channel object">
        <ResponseField name="value" type="string">
          Channel value (`store`, `affiliate`, `discover`, `widget`, `api`)
        </ResponseField>

        <ResponseField name="label" type="string">
          Human-readable label
        </ResponseField>

        <ResponseField name="description" type="string">
          Channel description
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="amount" type="object">
      Final amount charged

      <Expandable title="amount object">
        <ResponseField name="value" type="integer">
          Amount value (e.g., 99 for \$99.00)
        </ResponseField>

        <ResponseField name="formatted" type="string">
          Formatted amount with currency symbol
        </ResponseField>

        <ResponseField name="short" type="string">
          Short formatted amount
        </ResponseField>

        <ResponseField name="currency" type="string">
          Three-letter ISO currency code
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="original_amount" type="object">
      Original amount before discount
    </ResponseField>

    <ResponseField name="discount_amount" type="object">
      Discount amount applied
    </ResponseField>

    <ResponseField name="settlement" type="object">
      Settlement details

      <Expandable title="settlement object">
        <ResponseField name="amount" type="object">
          Amount to be settled to merchant
        </ResponseField>

        <ResponseField name="due_at" type="string">
          ISO 8601 timestamp when settlement is due
        </ResponseField>

        <ResponseField name="done_at" type="string">
          ISO 8601 timestamp when settlement was completed
        </ResponseField>

        <ResponseField name="service_fee" type="object">
          Platform service fee amount
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="download" type="object">
      Download statistics

      <Expandable title="download object">
        <ResponseField name="total" type="integer">
          Total number of downloads
        </ResponseField>

        <ResponseField name="last_at" type="string">
          ISO 8601 timestamp of last download
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="payment" type="object">
      Payment details

      <Expandable title="payment object">
        <ResponseField name="status" type="string">
          Payment status (`initiated`, `pending`, `cancelled`, `failed`, `success`)
        </ResponseField>

        <ResponseField name="transaction_id" type="string">
          Payment gateway transaction ID
        </ResponseField>

        <ResponseField name="gateway" type="string">
          Payment gateway used
        </ResponseField>

        <ResponseField name="method" type="object">
          Payment method details (card, mobile money, etc.)
        </ResponseField>

        <ResponseField name="amount" type="object">
          Amount paid in payment currency
        </ResponseField>

        <ResponseField name="fee" type="object">
          Payment processing fee
        </ResponseField>

        <ResponseField name="fee_rate" type="string">
          Payment fee rate as percentage
        </ResponseField>

        <ResponseField name="interchange" type="object">
          Interchange markup details
        </ResponseField>

        <ResponseField name="exchange_rate" type="object">
          Exchange rate if multi-currency
        </ResponseField>

        <ResponseField name="failure_error" type="object">
          Payment failure error details (if failed)
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="shipping" type="object">
      Shipping address (if provided)

      <Expandable title="shipping object">
        <ResponseField name="address" type="string">
          Street address
        </ResponseField>

        <ResponseField name="city" type="string">
          City name
        </ResponseField>

        <ResponseField name="state" type="string">
          State or province
        </ResponseField>

        <ResponseField name="country" type="object">
          Country details with code and name
        </ResponseField>

        <ResponseField name="zip" type="string">
          Postal/ZIP code
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="context" type="object">
      Purchase context information

      <Expandable title="context object">
        <ResponseField name="user_agent" type="string">
          Browser user agent
        </ResponseField>

        <ResponseField name="ip_address" type="string">
          Customer IP address
        </ResponseField>

        <ResponseField name="country" type="object">
          Country detected from IP
        </ResponseField>

        <ResponseField name="device_type" type="string">
          Device type (`desktop`, `mobile`, `tablet`)
        </ResponseField>

        <ResponseField name="locale" type="string">
          Customer locale
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="custom_fields_values" type="object">
      Custom field values provided during checkout
    </ResponseField>

    <ResponseField name="campaign" type="object">
      Marketing campaign (if tracked)
    </ResponseField>

    <ResponseField name="rating" type="object">
      Customer rating (if provided)
    </ResponseField>

    <ResponseField name="store" type="object">
      Store information
    </ResponseField>

    <ResponseField name="product" type="object">
      Product information
    </ResponseField>

    <ResponseField name="customer" type="object">
      Customer information
    </ResponseField>

    <ResponseField name="discount" type="object">
      Applied discount (if any)
    </ResponseField>

    <ResponseField name="is_reconciled" type="boolean">
      Whether sale has been reconciled
    </ResponseField>

    <ResponseField name="last_reconciled_at" type="string">
      ISO 8601 timestamp of last reconciliation
    </ResponseField>

    <ResponseField name="failed_at" type="string">
      ISO 8601 timestamp when sale failed
    </ResponseField>

    <ResponseField name="awaiting_payment_at" type="string">
      ISO 8601 timestamp when sale entered awaiting payment status
    </ResponseField>

    <ResponseField name="abandoned_at" type="string">
      ISO 8601 timestamp when sale was abandoned
    </ResponseField>

    <ResponseField name="completed_at" type="string">
      ISO 8601 timestamp when sale was completed
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp when sale was created
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      ISO 8601 timestamp when sale was last updated
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.chariow.com/v1/sales/sal_abc123xyz" \
    -H "Authorization: Bearer sk_live_your_api_key"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.chariow.com/v1/sales/sal_abc123xyz', {
    headers: {
      'Authorization': 'Bearer sk_live_your_api_key'
    }
  });
  const { data } = await response.json();
  console.log(data); // Sale object
  ```

  ```php PHP theme={null}
  $ch = curl_init('https://api.chariow.com/v1/sales/sal_abc123xyz');
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Authorization: Bearer sk_live_your_api_key'
  ]);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $response = curl_exec($ch);
  $data = json_decode($response, true);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.chariow.com/v1/sales/sal_abc123xyz',
      headers={'Authorization': 'Bearer sk_live_your_api_key'}
  )

  sale = response.json()['data']
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "message": "success",
    "data": {
      "id": "sal_abc123xyz",
      "status": "completed",
      "channel": {
        "value": "store",
        "label": "Store",
        "description": "Sale made through the store checkout"
      },
      "amount": {
        "value": 79.20,
        "formatted": "$79.20",
        "short": "79",
        "currency": "USD"
      },
      "original_amount": {
        "value": 99,
        "formatted": "$99.00",
        "short": "99",
        "currency": "USD"
      },
      "discount_amount": {
        "value": 19.80,
        "formatted": "$19.80",
        "short": "20",
        "currency": "USD"
      },
      "settlement": {
        "amount": {
          "value": 75.24,
          "formatted": "$75.24",
          "short": "75",
          "currency": "USD"
        },
        "due_at": "2025-02-01T00:00:00+00:00",
        "done_at": "2025-02-01T10:15:00+00:00",
        "service_fee": {
          "value": 3.96,
          "formatted": "$3.96",
          "short": "4",
          "currency": "USD"
        }
      },
      "download": {
        "total": 3,
        "last_at": "2025-01-20T14:30:00+00:00"
      },
      "payment": {
        "status": "success",
        "transaction_id": "txn_moneroo_xyz789",
        "gateway": "moneroo",
        "method": {
          "id": "card",
          "name": "Credit/Debit Card",
          "type": "card"
        },
        "amount": {
          "value": 79.20,
          "formatted": "$79.20",
          "short": "79",
          "currency": "USD"
        },
        "fee": {
          "value": 2.37,
          "formatted": "$2.37",
          "short": "2",
          "currency": "USD"
        },
        "fee_rate": "3.00%",
        "interchange": {
          "rate": "0.50%",
          "fee": {
            "value": 0.40,
            "formatted": "$0.40",
            "short": "0",
            "currency": "USD"
          }
        },
        "exchange_rate": {
          "value": 1.0,
          "formatted": "$1.00",
          "short": "1",
          "currency": "USD"
        },
        "failure_error": null
      },
      "shipping": {
        "address": "123 Main Street",
        "city": "New York",
        "state": "NY",
        "country": {
          "code": "US",
          "name": "United States"
        },
        "zip": "10001"
      },
      "context": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
        "ip_address": "203.0.113.42",
        "country": {
          "code": "US",
          "name": "United States"
        },
        "device_type": "desktop",
        "locale": "en_US"
      },
      "custom_fields_values": {
        "company_name": "Acme Corp",
        "vat_number": "GB123456789"
      },
      "campaign": {
        "id": "cmp_def456",
        "name": "Black Friday Campaign",
        "tracking_code": "BF2025"
      },
      "rating": {
        "id": "rat_ghi789",
        "value": 5,
        "comment": "Excellent product!",
        "created_at": "2025-01-18T09:00:00+00:00"
      },
      "store": {
        "id": "str_xyz789",
        "name": "My Digital Store",
        "slug": "my-digital-store"
      },
      "product": {
        "id": "prd_jkl012",
        "name": "Advanced Laravel Course",
        "slug": "advanced-laravel-course",
        "type": "course"
      },
      "customer": {
        "id": "cus_mno345",
        "email": "customer@example.com",
        "name": "John Doe",
        "first_name": "John",
        "last_name": "Doe"
      },
      "discount": {
        "id": "dis_pqr678",
        "code": "SAVE20",
        "type": "percentage",
        "value": 20
      },
      "is_reconciled": true,
      "last_reconciled_at": "2025-01-16T08:00:00+00:00",
      "failed_at": null,
      "awaiting_payment_at": "2025-01-15T10:30:00+00:00",
      "abandoned_at": null,
      "completed_at": "2025-01-15T10:32:00+00:00",
      "created_at": "2025-01-15T10:30:00+00:00",
      "updated_at": "2025-01-15T10:32:00+00:00"
    },
    "errors": []
  }
  ```

  ```json Not Found (404) theme={null}
  {
    "message": "Sale not found",
    "data": [],
    "errors": []
  }
  ```
</ResponseExample>
