Partner API
403 account_inactive error until then. Questions? Email support@tresr.com
# Set your key export TRESR_KEY="" # Browse the catalog curl -s https://creators.tresr.com/api/v1/partner/catalog/products \ -H "Authorization: Bearer $TRESR_KEY" | jq . # Create a checkout curl -s -X POST https://creators.tresr.com/api/v1/partner/checkout/create \ -H "Authorization: Bearer $TRESR_KEY" \ -H "Content-Type: application/json" \ -d '{"items":[{"variantId":"VARIANT_ID","quantity":1}]}' | jq .
// Fetch TRESR products const res = await fetch( 'https://creators.tresr.com/api/v1/partner/catalog/products', { headers: { 'Authorization': `Bearer ` } } ); const { products } = await res.json(); // Create checkout when user buys something const checkout = await fetch( 'https://creators.tresr.com/api/v1/partner/checkout/create', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ items: [{ variantId: products[0].variants[0].id, quantity: 1 }] }) } ); const { checkout: { url } } = await checkout.json(); window.location.href = url; // Send user to Shopify checkout
support@tresr.com