Wholesale Household โ Agent API
ACP 2026-04-17 agent surface. Use the API below; do not drive the browser UI.
Endpoints
GET https://shop.emoscale.ai/wholesale/product_feed
POST https://shop.emoscale.ai/wholesale/checkout_sessions
GET https://shop.emoscale.ai/wholesale/checkout_sessions/{{id}}
POST https://shop.emoscale.ai/wholesale/checkout_sessions/{{id}}/complete
POST https://api.emoscale.ai/agentic_commerce/delegate_payment (signed)
GET https://shop.emoscale.ai/wholesale/.well-known/ucp/manifest.jsonHeaders (every request)
api-version: 2026-04-17 authorization: Bearer acp_demo_token idempotency-key: <unique per POST> x-merchant-id: merchant_wholesale # delegate_payment ALSO requires: Signature: <base64url HMAC-SHA256(canonical_json(body), "acp_demo_signing_secret")> Timestamp: <RFC3339 now>
Flow
- GET the product feed โ pick a product id
- POST a checkout_session with line_items + fulfillment_details โ get totals
- POST delegate_payment (signed) โ get a vt_ token scoped to the cart
- POST complete with the token โ order created
Money
Amounts are integer satang (100 = เธฟ1). Currency is lowercase thb. VAT 7% applied at checkout.
Test cards
4242424242424242โ happy path4000000000000101โ insufficient funds4000000000000002โ always decline4000000000003220โ 3DS challenge (resume with authentication_result)
End-to-end script (copy & run)
This is the documented way for an agent to buy. The bearer acp_demo_token and secret acp_demo_signing_secret are public demo credentials โ use them as-is.
#!/bin/bash
set -e
B="https://shop.emoscale.ai/wholesale"
G="https://api.emoscale.ai/agentic_commerce"
M="merchant_wholesale"
H=( -H "api-version: 2026-04-17" -H "authorization: Bearer acp_demo_token" -H "x-merchant-id: $M" -H "content-type: application/json" )
# 1. Create a checkout_session for 4x Jasmine Rice
SID=$(curl -s "{B[@]}" -X POST "$B/checkout_sessions" \
-H "idempotency-key: $(uuidgen)" \
-d '{"line_items":[{"id":"ws_rice","quantity":4}],"fulfillment_details":{"name":"Demo","address":{"line_one":"693 Soi Ladpra 71","city":"Bangkok","state":"Bangkok","country":"TH","postal_code":"10310"},"phone_number":"025555555"}}' | jq -r .id)
TOTAL=$(curl -s "{H[@]}" "$B/checkout_sessions/$SID" | jq -r '.totals[]|select(.type=="total").amount')
# 2. Mint a scoped vault token (signed)
BODY=$(jq -n --arg sid "$SID" --argjson total "$TOTAL" --arg m "$M" '{payment_method:{type:"card",card_number_type:"fpan",number:"4242424242424242",exp_month:"11",exp_year:"2026",name:"x",cvc:"123",checks_performed:["avs","cvv"],iin:"424242",display_card_funding_type:"credit",display_brand:"visa",display_last4:"4242",metadata:{card_origin:"manual_entry"},virtual:false},allowance:{reason:"one_time",max_amount:$total,currency:"thb",checkout_session_id:$sid,merchant_id:$m,expires_at:(now+60|todate)},risk_signals:[{type:"card_testing",score:5,action:"authorized"}],metadata:{}}')
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
SIG=$(printf "%s.%s" "$TS" "$(echo $BODY|jq -cS .)" | openssl dgst -sha256 -hmac "acp_demo_signing_secret" -binary | base64 | tr '+/' '-_' | tr -d '=')
VT=$(curl -s -X POST "$G/delegate_payment" "{H[@]}" -H "idempotency-key: $(uuidgen)" -H "Signature: $SIG" -H "Timestamp: $TS" -d "$BODY" | jq -r .id)
# 3. Complete the checkout
curl -s -X POST "$B/checkout_sessions/$SID/complete" "{H[@]}" -H "idempotency-key: $(uuidgen)" \
-d "{"payment_data":{"handler_id":"emometa_card","instrument":{"type":"card","credential":{"type":"spt","token":"$VT"}}}}" | jq .statusOther stores: TrailBase Outdoors ยท Pawsome Supply