> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.weight-scale.poweriq.energy/llms.txt.
> For full documentation content, see https://docs.weight-scale.poweriq.energy/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.weight-scale.poweriq.energy/_mcp/server.

# Stop Session

POST https://api.poweriq.energy/v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop
Content-Type: application/json

Reference: https://docs.weight-scale.poweriq.energy/weight-scale-external/stop-session

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: WeightScaleExternal
  version: 1.0.0
paths:
  /v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop:
    post:
      operationId: stop-session
      summary: Stop Session
      tags:
        - ''
      parameters:
        - name: X-API-Key
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Stop Session_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: string
servers:
  - url: https://api.poweriq.energy
components:
  schemas:
    V1ExternalWeightScaleSessions78Ecd09D2A814F7F8A043E2Badbc23A6StopPostResponsesContentApplicationJsonSchemaParty:
      type: object
      properties:
        id:
          type: string
          format: uuid
        gst:
          type: string
        name:
          type: string
        address:
          type: string
      required:
        - id
        - gst
        - name
        - address
      title: >-
        V1ExternalWeightScaleSessions78Ecd09D2A814F7F8A043E2Badbc23A6StopPostResponsesContentApplicationJsonSchemaParty
    V1ExternalWeightScaleSessions78Ecd09D2A814F7F8A043E2Badbc23A6StopPostResponsesContentApplicationJsonSchemaScale:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        device_id:
          type: string
          format: uuid
        warehouse_id:
          type: string
          format: uuid
        warehouse_name:
          type: string
      required:
        - id
        - name
        - device_id
        - warehouse_id
        - warehouse_name
      title: >-
        V1ExternalWeightScaleSessions78Ecd09D2A814F7F8A043E2Badbc23A6StopPostResponsesContentApplicationJsonSchemaScale
    V1ExternalWeightScaleSessions78Ecd09D2A814F7F8A043E2Badbc23A6StopPostResponsesContentApplicationJsonSchemaMetaData:
      type: object
      properties:
        total_bags:
          type: integer
        total_weight:
          type: integer
      required:
        - total_bags
        - total_weight
      title: >-
        V1ExternalWeightScaleSessions78Ecd09D2A814F7F8A043E2Badbc23A6StopPostResponsesContentApplicationJsonSchemaMetaData
    Stop Session_Response_200:
      type: object
      properties:
        id:
          type: string
          format: uuid
        serial_no:
          type: integer
        party:
          $ref: >-
            #/components/schemas/V1ExternalWeightScaleSessions78Ecd09D2A814F7F8A043E2Badbc23A6StopPostResponsesContentApplicationJsonSchemaParty
        scale:
          $ref: >-
            #/components/schemas/V1ExternalWeightScaleSessions78Ecd09D2A814F7F8A043E2Badbc23A6StopPostResponsesContentApplicationJsonSchemaScale
        vehicle_no:
          type: string
        remark:
          type: string
        crop:
          type: string
        lot_no:
          type: string
        date:
          type: string
          format: date-time
        status:
          type: string
        meta_data:
          $ref: >-
            #/components/schemas/V1ExternalWeightScaleSessions78Ecd09D2A814F7F8A043E2Badbc23A6StopPostResponsesContentApplicationJsonSchemaMetaData
        bags:
          type: integer
        total_weight:
          type: integer
        warehouse_id:
          type: string
          format: uuid
        started_at:
          type: string
          format: date-time
        ended_at:
          type: string
          format: date-time
        live_reading:
          description: Any type
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        readings:
          type: array
          items:
            description: Any type
      required:
        - id
        - serial_no
        - party
        - scale
        - vehicle_no
        - remark
        - crop
        - lot_no
        - date
        - status
        - meta_data
        - bags
        - total_weight
        - warehouse_id
        - started_at
        - ended_at
        - created_at
        - updated_at
        - readings
      title: Stop Session_Response_200

```

## SDK Code Examples

```python Stop Session_example
import requests

url = "https://api.poweriq.energy/v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop"

payload = "{
    
    \"organization_id\": \"c2d09c46-361a-4eff-afe3-01ccdce22fc5\" //default
}"
headers = {
    "X-API-Key": "<key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Stop Session_example
const url = 'https://api.poweriq.energy/v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<key>', 'Content-Type': 'application/json'},
  body: '"{\n    \n    \"organization_id\": \"c2d09c46-361a-4eff-afe3-01ccdce22fc5\" //default\n}"'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Stop Session_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.poweriq.energy/v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop"

	payload := strings.NewReader("\"{\\n    \\n    \\\"organization_id\\\": \\\"c2d09c46-361a-4eff-afe3-01ccdce22fc5\\\" //default\\n}\"")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-Key", "<key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Stop Session_example
require 'uri'
require 'net/http'

url = URI("https://api.poweriq.energy/v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<key>'
request["Content-Type"] = 'application/json'
request.body = "\"{\\n    \\n    \\\"organization_id\\\": \\\"c2d09c46-361a-4eff-afe3-01ccdce22fc5\\\" //default\\n}\""

response = http.request(request)
puts response.read_body
```

```java Stop Session_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.poweriq.energy/v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop")
  .header("X-API-Key", "<key>")
  .header("Content-Type", "application/json")
  .body("\"{\\n    \\n    \\\"organization_id\\\": \\\"c2d09c46-361a-4eff-afe3-01ccdce22fc5\\\" //default\\n}\"")
  .asString();
```

```php Stop Session_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.poweriq.energy/v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop', [
  'body' => '"{\\n    \\n    \\"organization_id\\": \\"c2d09c46-361a-4eff-afe3-01ccdce22fc5\\" //default\\n}"',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<key>',
  ],
]);

echo $response->getBody();
```

```csharp Stop Session_example
using RestSharp;

var client = new RestClient("https://api.poweriq.energy/v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "\"{\\n    \\n    \\\"organization_id\\\": \\\"c2d09c46-361a-4eff-afe3-01ccdce22fc5\\\" //default\\n}\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Stop Session_example
import Foundation

let headers = [
  "X-API-Key": "<key>",
  "Content-Type": "application/json"
]
let parameters = "{
    
    \"organization_id\": \"c2d09c46-361a-4eff-afe3-01ccdce22fc5\" //default
}" as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.poweriq.energy/v1/external/weight-scale/sessions/78ecd09d-2a81-4f7f-8a04-3e2badbc23a6/stop")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```