Library › Coding AI › Small business owners
Build a shipping label request with converted units
Practice: Keeping the AI to your sources. About 5 minutes.
About this exercise
Build the JSON body for order CK-10431's label in exactly the doc's shape. The API wants grams and centimeters: the box weighs 2 lb (907 g) and measures 10 x 8 x 6 in (25.4 x 20.3 x 15.2 cm). The customer paid for express. The studio moved on Nov 1, so the from address is 88 Cedar Row, Unit 4, Bend, OR 97701, not the one saved in the doc example. One code block with only the JSON, then under 30 words outside the code.
Common mistakes when you ask AI for this
- Not giving the units. The AI copies 2 lb and 10 x 8 x 6 straight in, so the label is priced wrong or rejected. Try: Add: "The API wants grams and cm: 907 g, 25.4 x 20.3 x 15.2."
- Not mentioning the move. The AI copies the old from address saved in the doc. Try: Add: "From address is now 88 Cedar Row, Unit 4, Bend, OR 97701."
- Not insisting on the doc's shape. The AI adds the gift note or order number, which this API rejects. Try: Add: "Exactly the doc's fields, nothing extra. Service express."
- Getting a menu of options. The AI likes to offer two or three versions of the payload, so you're left to pick and test them yourself. Try: Add: "Give one payload only, in one code block, no alternatives."
- Getting a tutorial. By default the AI explains every part of the code at length, which you then have to scroll past. Try: Add: "After the code, one line under 8 words. Nothing else."
What a strong prompt includes
- Gives the converted units
- Uses the new address
- Sticks to the doc's shape
- Sets the service
- Asks for one answer only
Related exercises
- Accept a job offer and confirm the exact terms (Writing AI · Job seekers)
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)
- Add input checks to your number guessing game (Coding AI · High school students)
- Add input validation to a Java method with exact messages (Coding AI · Software developers)