From tradera-api
Publish an item for sale on Tradera using the REST API (v4). Walks through creating a listing with title, description, pricing, category, shipping, and optional images. Use when the user wants to list/sell an item on Tradera.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tradera-api:tradera-publishThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Publishes a new item listing on Tradera via the v4 REST API.
Publishes a new item listing on Tradera via the v4 REST API.
This skill needs appId, appKey, userId, and userToken. They can be provided via environment variables (recommended) or as arguments.
Environment variables (recommended):
TRADERA_APP_ID — Tradera API application IDTRADERA_APP_KEY — Tradera API application keyTRADERA_USER_ID — Tradera user IDTRADERA_USER_TOKEN — Tradera user authentication tokenAs arguments: /tradera-publish <appId> <appKey> <userId> <userToken>
Before making any API calls, resolve credentials in this order:
[ -n "$TRADERA_APP_ID" ] && [ -n "$TRADERA_APP_KEY" ] && [ -n "$TRADERA_USER_ID" ] && [ -n "$TRADERA_USER_TOKEN" ] (do NOT echo secrets)Ask the user for the following (use AskUserQuestion or plain questions). Collect all info before making any API calls:
Required:
<br>)Optional (ask about these):
Build the JSON body and POST it:
curl -s -w "\n%{http_code}" \
-X POST \
-H "Content-Type: application/json" \
-H "X-App-Id: {appId}" \
-H "X-App-Key: {appKey}" \
-H "X-User-Id: {userId}" \
-H "X-User-Token: {userToken}" \
-d '{json_body}' \
"https://api.tradera.com/v4/listings/items"
JSON body structure (ItemRequest):
{
"title": "Item title",
"description": "Full HTML description",
"categoryId": 12345,
"startPrice": 100,
"duration": 7,
"restarts": 0,
"itemType": 1,
"buyItNowPrice": 100,
"acceptedBidderId": 1,
"autoCommit": false,
"shippingOptions": [
{
"shippingOptionId": 12,
"cost": 42,
"shippingWeight": 1.0,
"shippingWeightSpecified": true
}
],
"paymentOptionIds": [],
"itemAttributes": [],
"attributeValues": {
"terms": [],
"numbers": []
},
"shippingCondition": "",
"paymentCondition": ""
}
Field notes:
itemType: 1=Auction, 3=Fixed Price (Buy Now Only), 4=Shop Item. No type 5 — for "Auction with Buy It Now", use type 1 with a buyItNowPrice.acceptedBidderId: REQUIRED. 1=Within Sweden, 3=International, 4=Within EU. Default to 1 if not specified.duration: number of days the listing runsstartPrice, buyItNowPrice, reservePrice: integers in SEKautoCommit: set to false so we can add images before committing. Set to true if no images needed and user wants immediate publish.shippingOptions: use EITHER shippingOptionId OR shippingProviderId, NOT both. Use shippingOptionId.buyItNowPrice and reservePrice if the user wants them (non-zero)Shipping option IDs (shippingOptionId):
Payment option IDs (paymentOptionIds):
Response: QueuedRequestResponse with requestId and itemId.
Check the HTTP status. If not 200, report the error.
For each image file the user provided, base64-encode it and POST:
IMAGE_B64=$(base64 < "{image_path}" | tr -d '\n')
curl -s -w "\n%{http_code}" \
-X POST \
-H "Content-Type: application/json" \
-H "X-App-Id: {appId}" \
-H "X-App-Key: {appKey}" \
-H "X-User-Id: {userId}" \
-H "X-User-Token: {userToken}" \
-d "{\"imageData\": \"$IMAGE_B64\", \"imageFormat\": 0, \"hasMega\": true}" \
"https://api.tradera.com/v4/listings/items/{requestId}/images"
imageFormat: 0=JPEG, 1=GIF, 2=PNGcurl -s -w "\n%{http_code}" \
-X POST \
-H "X-App-Id: {appId}" \
-H "X-App-Key: {appKey}" \
-H "X-User-Id: {userId}" \
-H "X-User-Token: {userToken}" \
"https://api.tradera.com/v4/listings/items/{requestId}/commit"
Present a summary:
## Listing Published
**Title:** {title}
**Item ID:** {itemId}
**Type:** {itemType name}
**Start Price:** {startPrice} SEK
**Duration:** {duration} days
**Images:** {count} uploaded
**Link:** https://www.tradera.com/item/{categoryId}/{itemId}
If the create request (step 2) fails, do NOT proceed to image upload or commit. If an image upload fails, warn the user but continue with remaining images and still commit. If commit fails, tell the user the requestId so they can retry manually.
npx claudepluginhub tradera/ai-marketplace --plugin tradera-apiCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.