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

# 5. Create Shipment (Value-Based)

POST https://api.impala-courier.com/api/public/shipments#postApiPublicShipments2
Content-Type: application/json

Creates a shipment priced by declared value/item tier instead of weight. Use `pricingItemIds` from **Get Pricing Items** instead of a `weight` field.

**Body parameters** (differences from weight-based)
| Field | Type | Required | Description |
|---|---|---|---|
| pricingType | string | Yes | Must be `value_based` |
| pricingItemIds | array of numbers | Yes | IDs from Get Pricing Items, replaces `weight` |

All other fields (sender/receiver info, serviceType, declaredValue, amount, description, ecommerceOrderId, shopId) are the same as the weight-based endpoint.

Reference: https://docs.impala-courier.com/impala-courier-e-commerce-api/5-create-shipment-value-based

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/public/shipments#postApiPublicShipments2:
    post:
      operationId: 5-create-shipment-value-based
      summary: 5. Create Shipment (Value-Based)
      description: >-
        Creates a shipment priced by declared value/item tier instead of weight.
        Use `pricingItemIds` from **Get Pricing Items** instead of a `weight`
        field.


        **Body parameters** (differences from weight-based)

        | Field | Type | Required | Description |

        |---|---|---|---|

        | pricingType | string | Yes | Must be `value_based` |

        | pricingItemIds | array of numbers | Yes | IDs from Get Pricing Items,
        replaces `weight` |


        All other fields (sender/receiver info, serviceType, declaredValue,
        amount, description, ecommerceOrderId, shopId) are the same as the
        weight-based endpoint.
      tags:
        - ''
      parameters:
        - name: X-API-Key
          in: header
          required: true
          schema:
            type: string
        - name: X-API-Key
          in: header
          description: Your shop's API key
          required: false
          schema:
            type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/5. Create Shipment
                  (Value-Based)_Response_201
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                shopId:
                  type: string
                senderCity:
                  type: string
                senderName:
                  type: string
                description:
                  type: string
                pricingType:
                  type: string
                senderPhone:
                  type: string
                serviceType:
                  type: string
                receiverCity:
                  type: string
                receiverName:
                  type: string
                declaredValue:
                  type: integer
                receiverPhone:
                  type: string
                pricingItemIds:
                  type: array
                  items:
                    type: integer
                ecommerceOrderId:
                  type: string
              required:
                - amount
                - shopId
                - senderCity
                - senderName
                - description
                - pricingType
                - senderPhone
                - serviceType
                - receiverCity
                - receiverName
                - declaredValue
                - receiverPhone
                - pricingItemIds
                - ecommerceOrderId
servers:
  - url: https://api.impala-courier.com
    description: https://api.impala-courier.com
components:
  schemas:
    ApiPublicShipmentsPostApiPublicShipments2PostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        amount:
          type: integer
        status:
          type: string
        trackingNumber:
          type: string
        ecommerceOrderId:
          type: string
      required:
        - amount
        - status
        - trackingNumber
        - ecommerceOrderId
      title: >-
        ApiPublicShipmentsPostApiPublicShipments2PostResponsesContentApplicationJsonSchemaData
    5. Create Shipment (Value-Based)_Response_201:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/ApiPublicShipmentsPostApiPublicShipments2PostResponsesContentApplicationJsonSchemaData
        success:
          type: boolean
      required:
        - data
        - success
      title: 5. Create Shipment (Value-Based)_Response_201
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

```

## Examples



**Request**

```json
{
  "amount": 15000,
  "shopId": "{{shopCode}}",
  "senderCity": "Blantyre",
  "senderName": "John Doe",
  "description": "Order #12346 - Electronics",
  "pricingType": "value_based",
  "senderPhone": "+265991234567",
  "serviceType": "express",
  "receiverCity": "Lilongwe",
  "receiverName": "Jane Smith",
  "declaredValue": 50000,
  "receiverPhone": "+265987654321",
  "pricingItemIds": [
    1,
    2
  ],
  "ecommerceOrderId": "SHOP-12346"
}
```

**Response**

```json
{
  "data": {
    "amount": 15000,
    "status": "pending_pickup",
    "trackingNumber": "IMP987654321098",
    "ecommerceOrderId": "SHOP-12346"
  },
  "success": true
}
```

**SDK Code**

```python 5. Create Shipment (Value-Based)_example
import requests

url = "https://api.impala-courier.com/api/public/shipments#postApiPublicShipments2"

payload = {
    "amount": 15000,
    "shopId": "{{shopCode}}",
    "senderCity": "Blantyre",
    "senderName": "John Doe",
    "description": "Order #12346 - Electronics",
    "pricingType": "value_based",
    "senderPhone": "+265991234567",
    "serviceType": "express",
    "receiverCity": "Lilongwe",
    "receiverName": "Jane Smith",
    "declaredValue": 50000,
    "receiverPhone": "+265987654321",
    "pricingItemIds": [1, 2],
    "ecommerceOrderId": "SHOP-12346"
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 5. Create Shipment (Value-Based)_example
const url = 'https://api.impala-courier.com/api/public/shipments#postApiPublicShipments2';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"amount":15000,"shopId":"{{shopCode}}","senderCity":"Blantyre","senderName":"John Doe","description":"Order #12346 - Electronics","pricingType":"value_based","senderPhone":"+265991234567","serviceType":"express","receiverCity":"Lilongwe","receiverName":"Jane Smith","declaredValue":50000,"receiverPhone":"+265987654321","pricingItemIds":[1,2],"ecommerceOrderId":"SHOP-12346"}'
};

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

```go 5. Create Shipment (Value-Based)_example
package main

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

func main() {

	url := "https://api.impala-courier.com/api/public/shipments#postApiPublicShipments2"

	payload := strings.NewReader("{\n  \"amount\": 15000,\n  \"shopId\": \"{{shopCode}}\",\n  \"senderCity\": \"Blantyre\",\n  \"senderName\": \"John Doe\",\n  \"description\": \"Order #12346 - Electronics\",\n  \"pricingType\": \"value_based\",\n  \"senderPhone\": \"+265991234567\",\n  \"serviceType\": \"express\",\n  \"receiverCity\": \"Lilongwe\",\n  \"receiverName\": \"Jane Smith\",\n  \"declaredValue\": 50000,\n  \"receiverPhone\": \"+265987654321\",\n  \"pricingItemIds\": [\n    1,\n    2\n  ],\n  \"ecommerceOrderId\": \"SHOP-12346\"\n}")

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

	req.Header.Add("X-API-Key", "<apiKey>")
	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 5. Create Shipment (Value-Based)_example
require 'uri'
require 'net/http'

url = URI("https://api.impala-courier.com/api/public/shipments#postApiPublicShipments2")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": 15000,\n  \"shopId\": \"{{shopCode}}\",\n  \"senderCity\": \"Blantyre\",\n  \"senderName\": \"John Doe\",\n  \"description\": \"Order #12346 - Electronics\",\n  \"pricingType\": \"value_based\",\n  \"senderPhone\": \"+265991234567\",\n  \"serviceType\": \"express\",\n  \"receiverCity\": \"Lilongwe\",\n  \"receiverName\": \"Jane Smith\",\n  \"declaredValue\": 50000,\n  \"receiverPhone\": \"+265987654321\",\n  \"pricingItemIds\": [\n    1,\n    2\n  ],\n  \"ecommerceOrderId\": \"SHOP-12346\"\n}"

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

```java 5. Create Shipment (Value-Based)_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.impala-courier.com/api/public/shipments#postApiPublicShipments2")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": 15000,\n  \"shopId\": \"{{shopCode}}\",\n  \"senderCity\": \"Blantyre\",\n  \"senderName\": \"John Doe\",\n  \"description\": \"Order #12346 - Electronics\",\n  \"pricingType\": \"value_based\",\n  \"senderPhone\": \"+265991234567\",\n  \"serviceType\": \"express\",\n  \"receiverCity\": \"Lilongwe\",\n  \"receiverName\": \"Jane Smith\",\n  \"declaredValue\": 50000,\n  \"receiverPhone\": \"+265987654321\",\n  \"pricingItemIds\": [\n    1,\n    2\n  ],\n  \"ecommerceOrderId\": \"SHOP-12346\"\n}")
  .asString();
```

```php 5. Create Shipment (Value-Based)_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.impala-courier.com/api/public/shipments#postApiPublicShipments2', [
  'body' => '{
  "amount": 15000,
  "shopId": "{{shopCode}}",
  "senderCity": "Blantyre",
  "senderName": "John Doe",
  "description": "Order #12346 - Electronics",
  "pricingType": "value_based",
  "senderPhone": "+265991234567",
  "serviceType": "express",
  "receiverCity": "Lilongwe",
  "receiverName": "Jane Smith",
  "declaredValue": 50000,
  "receiverPhone": "+265987654321",
  "pricingItemIds": [
    1,
    2
  ],
  "ecommerceOrderId": "SHOP-12346"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp 5. Create Shipment (Value-Based)_example
using RestSharp;

var client = new RestClient("https://api.impala-courier.com/api/public/shipments#postApiPublicShipments2");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": 15000,\n  \"shopId\": \"{{shopCode}}\",\n  \"senderCity\": \"Blantyre\",\n  \"senderName\": \"John Doe\",\n  \"description\": \"Order #12346 - Electronics\",\n  \"pricingType\": \"value_based\",\n  \"senderPhone\": \"+265991234567\",\n  \"serviceType\": \"express\",\n  \"receiverCity\": \"Lilongwe\",\n  \"receiverName\": \"Jane Smith\",\n  \"declaredValue\": 50000,\n  \"receiverPhone\": \"+265987654321\",\n  \"pricingItemIds\": [\n    1,\n    2\n  ],\n  \"ecommerceOrderId\": \"SHOP-12346\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 5. Create Shipment (Value-Based)_example
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": 15000,
  "shopId": "{{shopCode}}",
  "senderCity": "Blantyre",
  "senderName": "John Doe",
  "description": "Order #12346 - Electronics",
  "pricingType": "value_based",
  "senderPhone": "+265991234567",
  "serviceType": "express",
  "receiverCity": "Lilongwe",
  "receiverName": "Jane Smith",
  "declaredValue": 50000,
  "receiverPhone": "+265987654321",
  "pricingItemIds": [1, 2],
  "ecommerceOrderId": "SHOP-12346"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.impala-courier.com/api/public/shipments#postApiPublicShipments2")! 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()
```