Use the Buy API to turn purchase intent into sourced offers, Purchase Orders, checkout handoff, Bills, and accounting readiness checks.
Last updated: June 20, 2026
/v2/buy namespace.The first beta focuses on:Authorization: Bearer <api_key>.Idempotency-Key on write operations such as request creation, offer selection, Purchase Order creation, checkout preparation, order confirmation, and Bill creation.curl -X POST "https://api.sanka.com/v2/buy/requests" \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: buy-request-001" \
-d '{
"title": "Restock shipping labels",
"source": "manual",
"currency": "USD",
"business_purpose": "Warehouse replenishment",
"lines": [
{
"description": "Thermal shipping labels, 4 x 6 inch",
"quantity": 10,
"unit": "roll"
}
]
}'
POST /v2/buy/intents when an AI agent or app starts from natural language and needs Sanka to structure the draft request before creation.curl -X POST "https://api.sanka.com/v2/buy/requests/<request_id>/source" \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: buy-source-001" \
-d '{
"provider": "shopify_global_catalog"
}'
GET /v2/buy/requests/<request_id>GET /v2/buy/requests/<request_id>/sourcing-runsGET /v2/buy/sourcing-runs/<sourcing_run_id>curl -X POST "https://api.sanka.com/v2/buy/requests/<request_id>/select-offer" \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: buy-select-001" \
-d '{
"line_id": "<request_line_id>",
"offer_snapshot_id": "<offer_snapshot_id>"
}'
POST /v2/buy/requests/<request_id>/submit when the selected lines are ready for approval or purchasing.curl -X POST "https://api.sanka.com/v2/buy/requests/<request_id>/create-purchase-order" \
-H "Authorization: Bearer <api_key>" \
-H "Idempotency-Key: buy-po-001"
curl -X POST "https://api.sanka.com/v2/buy/merchant-purchases/<merchant_purchase_id>/prepare-checkout" \
-H "Authorization: Bearer <api_key>" \
-H "Idempotency-Key: buy-checkout-001"
curl -X POST "https://api.sanka.com/v2/buy/merchant-purchases/<merchant_purchase_id>/confirm-order" \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: buy-order-001" \
-d '{
"external_order_id": "SHOP-10042"
}'
curl -X POST "https://api.sanka.com/v2/buy/merchant-purchases/<merchant_purchase_id>/create-bill" \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: buy-bill-001" \
-d '{
"evidence_files": [
{
"file_id": "<uploaded_file_id>",
"evidence_type": "receipt"
}
]
}'
curl -X POST "https://api.sanka.com/v2/buy/merchant-purchases/<merchant_purchase_id>/accounting-preview" \
-H "Authorization: Bearer <api_key>"