Files
terminalShop-old/scripts/ops/buy-label.sh
marcusDenslow f6eed76456
Some checks failed
Deploy / deploy (push) Has been cancelled
feat(notify): post Slack message when an order is paid
2026-05-15 08:54:23 +02:00

13 lines
417 B
Bash
Executable File

#!/usr/bin/env bash
# Buy a shipping label via the admin endpoint.
# Usage: scripts/ops/buy-label.sh <order_id>
set -euo pipefail
ORDER_ID="${1:?usage: $0 <order_id>}"
: "${ADMIN_KEY:?ADMIN_KEY not set; source scripts/ops/env.sh first}"
: "${BASE_URL:=https://api.sshops.uk}"
curl -sS -X POST "$BASE_URL/api/v1/orders/$ORDER_ID/label" \
-H "X-Admin-Key: $ADMIN_KEY" \
-H "Content-Type: application/json" | jq .