# Authentication Source: https://dev.puppetvendors.com/api-reference/authentication Authenticate with the PuppetVendors API ## Overview All API endpoints require a JWT token passed via the `x-access-token` header. You obtain this token by exchanging your API key and shop domain. ## Get a Token **apiKey** `string` *required* Your API key, found at **Settings > Information** in the PuppetVendors dashboard. **shopDomain** `string` *required* Your Shopify store domain (e.g. `my-store.myshopify.com`). ```bash theme={null} curl -X POST https://api.puppetvendors.com/v1/authenticate \ -H "Content-Type: application/json" \ -d '{ "apiKey": "YOUR_API_KEY", "shopDomain": "my-store.myshopify.com" }' ``` ### Response ```json theme={null} { "token": "eyJhbGciOiJIUzI1NiIs...", "shopDomain": "my-store.myshopify.com" } ``` ## Using the Token Include the token in all subsequent requests: ```bash theme={null} curl -X POST https://api.puppetvendors.com/v1/lineitems/update \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ ... }' ``` Tokens expire after **24 hours**. Use `POST /v1/refresh-token` with a valid token to get a new one. # Bulk Upload SKU Commissions Source: https://dev.puppetvendors.com/api-reference/endpoint/bulk-upload-commissions POST /v1/commissions/sku Upsert SKU-level commissions and cost of goods in bulk ## Overview Create or update SKU-level commission rates and cost of goods values in bulk. Each SKU is upserted — if a matching SKU already exists for your shop it is updated, otherwise a new record is created. ### Use Cases * **Bulk-set commission overrides** for hundreds of SKUs at once * **Sync cost of goods** from an ERP or inventory system * **Onboard new product lines** with pre-configured commission rates * **Periodic updates** to COGS values as supplier pricing changes ## Request Body **skus** `array` *required* Array of SKU commission records (max 500 per request). **SKU object properties** **sku** `string` *required* The SKU identifier. Must be a non-empty string (whitespace is trimmed). **commissionType** `string` (default: percentage) Commission type. Must be `"percentage"` or `"flat"`. **commissionRate** `number` (default: 0) Commission rate. For `percentage` type this is the percentage value (e.g. `14` for 14%). For `flat` type this is the flat currency amount. Must be >= 0. **costOfGoods** `number` Cost of goods per unit. Must be >= 0 when provided. ## Response **Success — all items processed:** ```json 200 theme={null} { "success": true, "received": 3, "created": 2, "updated": 1, "errors": [] } ``` **Partial failure — some items had validation errors:** ```json 200 theme={null} { "success": false, "received": 3, "created": 1, "updated": 0, "errors": [ { "index": 1, "sku": "BAD-SKU", "error": "commissionType must be 'percentage' or 'flat'" }, { "index": 2, "sku": "", "error": "sku is required" } ] } ``` **Validation error — request-level:** ```json 422 theme={null} { "error": "\"skus\" array is required" } ``` > [!NOTE] > > This endpoint uses **upsert** behavior. If a SKU already exists for your shop, the provided fields are updated. If it doesn't exist, a new SKU record is created. Duplicate SKUs within the same request are processed in order — the last entry wins. > [!WARNING] > > Commission values are applied as-is. A `commissionRate` of `14` means 14% (not 0.14). Do not divide by 100. ## Example ```bash theme={null} curl -X POST https://api.puppetvendors.com/v1/commissions/sku \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "skus": [ { "sku": "TSH-LG-BLU", "commissionType": "percentage", "commissionRate": 14, "costOfGoods": 15.50 }, { "sku": "MUG-WHT-001", "commissionType": "flat", "commissionRate": 2.00 } ] }' ``` # Create Fulfillment Source: https://dev.puppetvendors.com/api-reference/endpoint/create-fulfillment POST /v1/fulfillments Fulfill line items with tracking information ## Overview Submit line items for fulfillment with tracking details. This creates a fulfillment in Shopify and updates the line item records in PuppetVendors. ### Use Cases * **Automate fulfillment** from a third-party warehouse or 3PL system * **Bulk-fulfill orders** by scripting API calls from a shipping platform * **Connect non-Shopify fulfillment services** to your multi-vendor workflow ## Request Body **trackingNumber** `string` *required* Shipment tracking number. **shippingCarrier** `string` *required* Shipping carrier name (e.g. `"Royal Mail"`, `"UPS"`, `"FedEx"`). **trackingUrl** `string` *required* URL for tracking the shipment. **lineItemsToFulfill** `array` *required* Array of calculated line item IDs (PuppetVendors `_id` values) to fulfill. ## Response ```json 200 theme={null} { "fulfillments": [ { "type": "success", "lineItemId": "...", "message": "Fulfillment completed successfully." } ] } ``` ### Partial Failure If some items fail to fulfill, each item reports individually: ```json 200 theme={null} { "fulfillments": [ { "type": "success", "lineItemId": "abc...", "message": "Fulfillment completed successfully." }, { "type": "error", "lineItemId": "def...", "message": "Already fulfilled" } ] } ``` ## Example ```bash theme={null} curl -X POST https://api.puppetvendors.com/v1/fulfillments \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "trackingNumber": "RM123456789GB", "shippingCarrier": "Royal Mail", "trackingUrl": "https://tracking.royalmail.com/RM123456789GB", "lineItemsToFulfill": ["64a1b2c3d4e5f6...", "64a1b2c3d4e5f7..."] }' ``` # Create User Source: https://dev.puppetvendors.com/api-reference/endpoint/create-user POST /v1/users Create a vendor portal user account ## Overview Creates a new vendor portal user account and optionally sends an invitation email with login credentials. ### Use Cases * **Automate vendor onboarding** — create vendor + user account in one flow * **Provision portal access** for new team members of an existing vendor * **Bulk-invite vendors** by scripting account creation with `sendEmail: true` ## Request Body **vendorId** `string` *required* The vendor ID this user will be associated with. **email** `string` *required* User's email address. Will be converted to lowercase. **password** `string` *required* Password for the vendor portal account. **sendEmail** `boolean` Set to `true` to send an invitation email with login credentials to the user. ## Response ```json 200 theme={null} { "message": "User created successfully.", "user": { "_id": "61a2b3c4d5e6f7g8h9i0j1k2", "email": "vendor@acme.com", "type": "vendor", "vendorId": "6157faecbebcf01bf49097d9", "approved": true, "createdAt": "2024-01-15T08:00:00.000Z" } } ``` > [!WARNING] > > The password is stored as a bcrypt hash. It cannot be retrieved after creation. If `sendEmail` is `true`, the plaintext password is included in the invitation email. ## Example ```bash theme={null} curl -X POST https://api.puppetvendors.com/v1/users \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "vendorId": "6157faecbebcf01bf49097d9", "email": "vendor@acme.com", "password": "securePassword123", "sendEmail": true }' ``` # Create Vendor Source: https://dev.puppetvendors.com/api-reference/endpoint/create-vendor POST /v1/vendors Register a new vendor in your shop ## Overview Creates a new vendor with the specified commission configuration. The vendor name is stored in lowercase and must be unique within your shop. ### Use Cases * **Automate vendor onboarding** from a registration form or CRM * **Bulk-create vendors** by scripting multiple API calls * **Sync vendors** from an external marketplace or ERP system ## Request Body **vendorName** `string` *required* Name of the vendor. Will be converted to lowercase. Must be unique per shop. **commissionType** `string` *required* Commission model: `"percentage"` or `"flat"`. **commissionAmount** `number` *required* Commission value. For percentage type, this is the percentage (e.g. `10` for 10%). For flat type, this is the fixed amount per item. ## Response ```json 200 theme={null} { "message": "Vendor created successfully.", "vendor": { "_id": "6157faecbebcf01bf49097d9", "vendorName": "acme supplies", "commissionType": "percentage", "commissionAmount": 10, "shopId": "...", "createdAt": "2024-01-15T08:00:00.000Z" } } ``` ### Error: Duplicate Vendor ```json 409 theme={null} { "error": "A vendor with this name already exists.", "vendorName": "acme supplies" } ``` ## Example ```bash theme={null} curl -X POST https://api.puppetvendors.com/v1/vendors \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "vendorName": "Acme Supplies", "commissionType": "percentage", "commissionAmount": 10 }' ``` # Delete User Source: https://dev.puppetvendors.com/api-reference/endpoint/delete-user DELETE /v1/users/{userId} Permanently delete a vendor portal user account ## Overview Permanently removes a vendor portal user account. This cannot be undone. ### Use Cases * **Revoke portal access** when a vendor team member leaves * **Clean up duplicate accounts** created by mistake * **Offboard vendors** by removing all associated user accounts ## Path Parameters **userId** `string` *required* The user's unique ID. ## Response ```json 200 theme={null} { "message": "User deleted successfully.", "user": { ... } } ``` > [!WARNING] > > This is a permanent deletion, not a soft delete. The user will no longer be able to log into the vendor portal. ## Example ```bash theme={null} curl -X DELETE "https://api.puppetvendors.com/v1/users/61a2b3c4d5e6f7g8h9i0j1k2" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Delete Vendor Source: https://dev.puppetvendors.com/api-reference/endpoint/delete-vendor DELETE /v1/vendors/{vendorId} Soft-delete a vendor from your shop ## Overview Marks a vendor as hidden. The vendor record is not permanently deleted and will no longer appear in list queries. ### Use Cases * **Offboard a vendor** who is no longer active * **Deactivate vendors** programmatically from an admin tool ## Path Parameters **vendorId** `string` *required* The vendor's unique ID. ## Response ```json 200 theme={null} { "message": "Vendor deleted successfully.", "vendor": { ... } } ``` > [!WARNING] > > This is a soft delete. The vendor's historical data (orders, payouts, reports) is preserved. The vendor will be excluded from all list endpoints. ## Example ```bash theme={null} curl -X DELETE "https://api.puppetvendors.com/v1/vendors/6157faecbebcf01bf49097d9" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Get Commissions by SKU Source: https://dev.puppetvendors.com/api-reference/endpoint/get-commissions-by-sku GET /v1/commissions/sku List commission rates and cost of goods per SKU ## Overview Returns the SKU-level commission configuration and cost of goods for all SKUs registered in your shop. ### Use Cases * **Audit SKU-level overrides** to ensure correct commission rates per product * **Verify cost of goods** values before triggering recalculations * **Export COGS data** for margin analysis or financial reporting * **Sync SKU pricing** between PuppetVendors and an external ERP ## Response ```json 200 theme={null} { "skus": [ { "sku": "TSH-LG-BLU", "costOfGoods": 15.50, "commissionType": "percentage", "commissionAmount": 14 }, { "sku": "MUG-WHT-001", "costOfGoods": 3.20, "commissionType": "flat", "commissionAmount": 2.00 } ] } ``` > [!NOTE] > > SKU-level commissions override vendor-level commissions when both are configured. Cost of goods values are used in payout calculations to determine vendor earnings. ## Example ```bash theme={null} curl -X GET https://api.puppetvendors.com/v1/commissions/sku \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Get Commissions by Vendor Source: https://dev.puppetvendors.com/api-reference/endpoint/get-commissions-by-vendor GET /v1/commissions/vendor List commission rates for all vendors ## Overview Returns the commission configuration (type and rate) for every active vendor in your shop. ### Use Cases * **Audit commission rates** across all vendors in one call * **Feed commission data** into financial models or projections * **Display vendor terms** in a custom admin dashboard * **Detect commission discrepancies** by comparing expected vs. actual rates ## Response ```json 200 theme={null} { "vendors": [ { "vendorId": "6157faecbebcf01bf49097d9", "vendorName": "acme supplies", "commissionType": "percentage", "commissionAmount": 10 }, { "vendorId": "6257faecbebcf01bf49097da", "vendorName": "beta goods", "commissionType": "flat", "commissionAmount": 5.00 } ] } ``` ## Example ```bash theme={null} curl -X GET https://api.puppetvendors.com/v1/commissions/vendor \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Get Order Source: https://dev.puppetvendors.com/api-reference/endpoint/get-order GET /v1/orders/{orderId} Retrieve an order or its calculated line items ## Overview Fetch a Shopify order by its order ID. Optionally retrieve the calculated line items (with commission, payout, and cost data) instead of the raw order. ### Use Cases * **Look up order details** for customer support workflows * **Pull calculated line items** to verify commission and payout amounts * **Feed order data** into an external accounting or fulfillment system * **Build a custom order detail page** in a third-party dashboard ## Path Parameters **orderId** `string` *required* The Shopify order ID (numeric). ## Query Parameters **lineItems** `string` Set to `"true"` to return calculated line items instead of the raw order document. Calculated line items include commission, payout, cost of goods, and other financial fields. ## Response ### Raw Order (default) ```json 200 theme={null} { "orders": { "_id": "...", "orderId": 5022136860720, "orderNumber": 1042, "shopId": "...", ... } } ``` ### Calculated Line Items (`?lineItems=true`) ```json 200 theme={null} { "orders": [ { "_id": "...", "lineItemId": 12345678901234, "orderId": 5022136860720, "vendorName": "acme supplies", "sales": 279.99, "commission": 39.20, "costOfItem": 15.50, "payout": 194.13, ... } ] } ``` ## Example ```bash theme={null} # Get raw order curl -X GET "https://api.puppetvendors.com/v1/orders/5022136860720" \ -H "x-access-token: YOUR_JWT_TOKEN" # Get calculated line items curl -X GET "https://api.puppetvendors.com/v1/orders/5022136860720?lineItems=true" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Get Vendor Reports Source: https://dev.puppetvendors.com/api-reference/endpoint/get-reports GET /v1/report/{vendorId} Retrieve calculated line item reports for a vendor ## Overview Returns a paginated list of calculated line items for a specific vendor, including sales, commissions, costs, and payouts. This is the data that appears in the vendor reports view. ### Use Cases * **Generate vendor statements** for a specific date range * **Build custom vendor dashboards** with financial breakdowns * **Export report data** to CSV/Excel for accounting * **Reconcile vendor earnings** against payment records * **Feed data into a BI tool** for margin and performance analysis ## Path Parameters **vendorId** `string` *required* The vendor's unique ID. ## Query Parameters **start** `string` Start date in `YYYY-MM-DD` format. **end** `string` End date in `YYYY-MM-DD` format. **limit** `number` Results per page. Default: `100`. **offset** `number` Number of results to skip. Default: `0`. ## Response ```json 200 theme={null} { "total": 156, "nextOffset": 100, "orders": [ { "_id": "...", "orderNumber": 1042, "orderName": "#1042", "orderId": 5022136860720, "orderDate": "2024-03-15T00:00:00.000Z", "vendorName": "acme supplies", "vendorId": "6157faecbebcf01bf49097d9", "title": "Classic T-Shirt", "variant": "Large / Blue", "sku": "TSH-LG-BLU", "unitPrice": 29.99, "quantity": 2, "discount": 0, "sales": 59.98, "salesAfterDiscount": 59.98, "tax": 10.00, "costOfItem": 31.00, "commissionPlan": "14%", "commission": 8.40, "deduction": 0, "payout": 41.58, "createdAt": "2024-03-15T08:30:00.000Z", "updatedAt": "2024-03-15T08:30:00.000Z" } ] } ``` ## Example ```bash theme={null} # Vendor report for March 2024 curl -X GET "https://api.puppetvendors.com/v1/report/6157faecbebcf01bf49097d9?start=2024-03-01&end=2024-03-31&limit=50" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Get Vendor Profile Fields Source: https://dev.puppetvendors.com/api-reference/endpoint/get-shop-profile GET /v1/shop/profile List the custom profile fields available for vendors ## Overview Returns the list of custom profile field names available for vendor profiles in your shop. These are the field names accepted by the [Update Vendor Profile](/api-reference/endpoint/update-vendor-profile) endpoint. ### Use Cases * **Discover available fields** before reading or writing vendor profiles * **Build dynamic forms** that adapt to the profile configuration * **Validate vendor data** against the expected field list before submission ## Response ```json 200 theme={null} { "fields": [ "companyName", "taxId", "phone", "website", "description" ] } ``` ### No Profile Configured ```json 401 theme={null} { "error": "Shop profile is not set." } ``` ## Example ```bash theme={null} curl -X GET https://api.puppetvendors.com/v1/shop/profile \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Get User Source: https://dev.puppetvendors.com/api-reference/endpoint/get-user GET /v1/users/{userId} Retrieve a single vendor portal user ## Overview Fetch detailed information about a specific vendor portal user account. ### Use Cases * **Verify user existence** before sending a password reset * **Look up which vendor** a user belongs to * **Check account status** (approved, invitation date) ## Path Parameters **userId** `string` *required* The user's unique ID. ## Response Returns the full user document (excluding password). ```json 200 theme={null} { "_id": "61a2b3c4d5e6f7g8h9i0j1k2", "email": "vendor@acme.com", "type": "vendor", "approved": true, "shopId": "...", "vendorId": "6157faecbebcf01bf49097d9", "invitationDate": "2024-01-15T08:00:00.000Z", "createdAt": "2024-01-15T08:00:00.000Z" } ``` ## Example ```bash theme={null} curl -X GET "https://api.puppetvendors.com/v1/users/61a2b3c4d5e6f7g8h9i0j1k2" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Get Vendor Source: https://dev.puppetvendors.com/api-reference/endpoint/get-vendor GET /v1/vendors/{vendorId} Retrieve a single vendor by ID ## Overview Fetch detailed information about a specific vendor, including commission settings and profile data. ### Use Cases * **Look up vendor details** before creating a payout * **Display vendor info** in a custom dashboard or storefront widget * **Verify vendor existence** before assigning products ## Path Parameters **vendorId** `string` *required* The vendor's unique ID. ## Query Parameters **users** `string` Set to `"true"` to include associated user accounts. ## Response ```json 200 theme={null} { "vendor": [ { "_id": "6157faecbebcf01bf49097d9", "vendorName": "acme supplies", "commissionType": "percentage", "commissionAmount": 10, "createdAt": "2024-01-15T08:00:00.000Z", "profile": [] } ] } ``` ## Example ```bash theme={null} curl -X GET "https://api.puppetvendors.com/v1/vendors/6157faecbebcf01bf49097d9" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Get Vendor Address Source: https://dev.puppetvendors.com/api-reference/endpoint/get-vendor-address GET /v1/vendors/{vendorId}/address Retrieve a vendor's business address ## Overview Returns the vendor's business address stored in their profile. ### Use Cases * **Generate shipping labels** with the vendor's return address * **Display vendor locations** on a store locator map * **Pre-fill address fields** in invoicing or payout systems ## Path Parameters **vendorId** `string` *required* The vendor's unique ID. ## Response ```json 200 theme={null} { "address1": "123 Market Street", "address2": "Suite 400", "city": "London", "state": "England", "postalCode": "EC1A 1BB", "country": "United Kingdom" } ``` Returns an empty object `{}` if no address is set. ## Example ```bash theme={null} curl -X GET "https://api.puppetvendors.com/v1/vendors/6157faecbebcf01bf49097d9/address" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Get Vendor Profile Source: https://dev.puppetvendors.com/api-reference/endpoint/get-vendor-profile GET /v1/vendors/{vendorId}/profile Retrieve a vendor's custom profile fields ## Overview Returns the vendor's custom profile field values. Profile fields are defined at the shop level (see [Get Shop Profile Fields](/api-reference/endpoint/get-shop-profile)) and populated per vendor. ### Use Cases * **Display vendor details** (company name, tax ID, bank info) on a custom vendor directory * **Export vendor profiles** for compliance or onboarding audits * **Integrate profile data** into invoicing or accounting systems ## Path Parameters **vendorId** `string` *required* The vendor's unique ID. ## Response ```json 200 theme={null} [ { "field": "companyName", "value": "Acme Corp" }, { "field": "taxId", "value": "GB123456789" }, { "field": "phone", "value": "+44 20 7946 0958" } ] ``` ## Example ```bash theme={null} curl -X GET "https://api.puppetvendors.com/v1/vendors/6157faecbebcf01bf49097d9/profile" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # List Fulfillments Source: https://dev.puppetvendors.com/api-reference/endpoint/list-fulfillments GET /v1/fulfillments Retrieve fulfillment data for line items ## Overview Returns a paginated list of line items with their fulfillment status, tracking info, and shipping/billing addresses. Only items with `"paid"` financial status are included. ### Use Cases * **Monitor fulfillment progress** across all vendors * **Build a shipping dashboard** showing tracking numbers and carriers * **Identify unfulfilled orders** that need attention * **Export fulfillment data** for logistics reporting * **Track shipment statuses** (in\_transit, delivered, etc.) ## Query Parameters **vendorId** `string` Filter by vendor ID. **start** `string` Start date in `YYYY-MM-DD` format. **end** `string` End date in `YYYY-MM-DD` format. **fulfillment** `string` Filter: `"fulfilled"` or `"unfulfilled"`. **shipment** `string` Filter by shipment status (e.g. `"in_transit"`, `"delivered"`). **limit** `number` Results per page. Default: `100`. **offset** `number` Number of results to skip. Default: `0`. ## Response ```json 200 theme={null} { "total": 42, "nextOffset": null, "fulfillments": [ { "_id": "...", "orderNumber": 1042, "orderName": "#1042", "date": "2024-03-15T00:00:00.000Z", "vendorId": "...", "vendorName": "acme supplies", "lineItemName": "Classic T-Shirt - Large", "lineItemVariant": "Large / Blue", "lineItemSku": "TSH-LG-BLU", "fulfillment": { "status": "success", "trackingCompany": "Royal Mail", "trackingNumber": "RM123456789GB", "trackingUrl": "https://tracking.royalmail.com/...", "createdAt": "2024-03-16T10:00:00.000Z" }, "shippingAddress": { "first_name": "John", "last_name": "Doe", "address1": "10 Downing Street", "city": "London", "country": "United Kingdom" } } ] } ``` ## Example ```bash theme={null} # Unfulfilled items for a vendor curl -X GET "https://api.puppetvendors.com/v1/fulfillments?vendorId=6157fa...&fulfillment=unfulfilled" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # List Payouts Source: https://dev.puppetvendors.com/api-reference/endpoint/list-payouts GET /v1/payouts Retrieve payout line items with filtering ## Overview Returns a paginated list of payout line items, showing what is owed, paid, and outstanding for each order item. Supports filtering by vendor, date range, payment status, and fulfillment status. ### Use Cases * **Generate payout reports** for accounting or tax preparation * **Reconcile payments** by comparing paid vs. unpaid balances * **Build a custom payout dashboard** for merchant oversight * **Automate payment triggers** by monitoring unpaid items via API ## Query Parameters **vendorId** `string` Filter by vendor ID. **start** `string` Start date in `YYYY-MM-DD` format. **end** `string` End date in `YYYY-MM-DD` format. **status** `string` Payment status filter: `"paid"`, `"partial"`, or `"unpaid"`. **fulfillment** `string` Fulfillment status: `"fulfilled"` or `"unfulfilled"`. **limit** `number` Results per page. Default: `100`. **offset** `number` Number of results to skip. Default: `0`. ## Response ```json 200 theme={null} { "total": 85, "nextOffset": 100, "payouts": [ { "_id": "...", "orderNumber": 1042, "orderName": "#1042", "vendorId": "6157faecbebcf01bf49097d9", "vendorName": "acme supplies", "lineItemName": "Classic T-Shirt - Large", "payout": 194.13, "paid": 194.13, "balance": 0, "date": "2024-03-15T00:00:00.000Z" } ] } ``` ## Example ```bash theme={null} # Unpaid payouts for a vendor in March 2024 curl -X GET "https://api.puppetvendors.com/v1/payouts?vendorId=6157fa...&status=unpaid&start=2024-03-01&end=2024-03-31" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # List Products Source: https://dev.puppetvendors.com/api-reference/endpoint/list-products GET /v1/products Retrieve products with pagination ## Overview Returns a paginated list of products in your shop, including variants, inventory, images, and vendor assignment. ### Use Cases * **Sync your product catalog** to an external marketplace or PIM * **Build a vendor-specific product feed** by filtering with `vendorId` * **Monitor product status** (active, draft, archived) across vendors * **Export product data** for reporting or analytics ## Query Parameters **vendorId** `string` Filter products by vendor ID. **limit** `number` Number of products to return per page. Default: `100`. **offset** `number` Number of products to skip. Default: `0`. Use `nextOffset` from the response for pagination. ## Response ```json 200 theme={null} { "total": 250, "nextOffset": 100, "products": [ { "_id": "...", "title": "Classic T-Shirt", "handle": "classic-t-shirt", "productType": "Apparel", "vendor": "acme supplies", "vendorId": "6157faecbebcf01bf49097d9", "status": "active", "totalInventory": 150, "isDigital": false, "variants": [...], "images": [...], "tags": ["summer", "cotton"], "createdAt": "2024-01-10T10:00:00.000Z", "updatedAt": "2024-06-01T12:00:00.000Z" } ] } ``` > [!NOTE] > > Use `nextOffset` for cursor-based pagination. When `nextOffset` is `null`, you have reached the last page. ## Example ```bash theme={null} # List all products curl -X GET "https://api.puppetvendors.com/v1/products?limit=50" \ -H "x-access-token: YOUR_JWT_TOKEN" # List products for a specific vendor curl -X GET "https://api.puppetvendors.com/v1/products?vendorId=6157faecbebcf01bf49097d9&limit=50" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # List Users Source: https://dev.puppetvendors.com/api-reference/endpoint/list-users GET /v1/users Retrieve all vendor portal users ## Overview Returns all vendor portal user accounts registered in your shop, including which vendor each user is associated with. ### Use Cases * **Audit vendor portal access** to see who has login credentials * **Identify inactive accounts** by checking `lastLoggedIn` dates * **Sync user data** to an identity provider or HR system ## Response ```json 200 theme={null} { "users": [ { "userId": "61a2b3c4d5e6f7g8h9i0j1k2", "vendorId": "6157faecbebcf01bf49097d9", "vendorName": "acme supplies", "createdAt": "2024-01-15T08:00:00.000Z", "lastLoggedIn": "2024-06-01T14:30:00.000Z", "email": "vendor@acme.com" } ] } ``` ## Example ```bash theme={null} curl -X GET https://api.puppetvendors.com/v1/users \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # List Vendors Source: https://dev.puppetvendors.com/api-reference/endpoint/list-vendors GET /v1/vendors Retrieve all vendors registered in your shop ## Overview Returns a list of all active (non-hidden) vendors in your shop, including their commission configuration and profile data. ### Use Cases * **Sync vendor roster** to an external ERP, accounting tool, or spreadsheet * **Build a vendor directory** on your storefront * **Audit commissions** across all vendors at a glance * **Power a Zapier/Make workflow** that triggers when vendor data changes ## Query Parameters **users** `string` Set to `"true"` to include associated user accounts (email and user ID) for each vendor. ## Response ```json 200 theme={null} { "vendors": [ { "vendorId": "6157faecbebcf01bf49097d9", "vendorName": "acme supplies", "commissionType": "percentage", "commissionAmount": 10, "createdAt": "2024-01-15T08:00:00.000Z", "profile": [], "users": [ { "_id": "61a2...", "email": "vendor@acme.com" } ] } ] } ``` > [!NOTE] > > The `users` array is only included when `?users=true` is passed. Each user object contains the `_id` and `email` of approved vendor portal accounts. ## Example ```bash theme={null} curl -X GET "https://api.puppetvendors.com/v1/vendors?users=true" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` # Update Line Items Source: https://dev.puppetvendors.com/api-reference/endpoint/update-line-items POST /v1/lineitems/update Update report data and cost of goods for line items ## Overview Update financial fields on line items (report data) and cost of goods records. Supports updating specific line items by ID or bulk-updating all line items matching a SKU. The endpoint accepts two mutually exclusive modes: * **Items mode** — update specific line items by Shopify line item ID and order ID * **By SKU mode** — update all line items matching a SKU *** ## Items Mode Target specific line items by Shopify line item ID and order ID. **items** `array` *required* Array of line item update objects (max 100 per request). **Item object properties** **lineItemId** `number` *required* Shopify line item ID. **orderId** `number` *required* Shopify order ID. **fields** `object` Fields to update. See [Updatable Fields](#updatable-fields) below. Either `fields` or `recalculate` (or both) must be provided. **recalculate** `boolean` Set to `true` to trigger recalculation after updating. When combined with `fields`, the fields are written to the DB first, then recalculation is queued. ### Example ```json theme={null} { "items": [ { "lineItemId": 12345678901234, "orderId": 98765432101234, "fields": { "costOfItem": 15.50, "commission": 5.00 } } ] } ``` *** ## By SKU Mode Update all line items matching a SKU value for your shop. **bySku** `string` *required* The SKU value to match. **fields** `object` Fields to update. Required when `recalculate` is not `true`. See [Updatable Fields](#updatable-fields) below. **recalculate** `boolean` Set to `true` to trigger recalculation for all matching line items. ### Example ```json theme={null} { "bySku": "SKU-001", "fields": { "costOfItem": 15.50 } } ``` *** ## Updatable Fields Only the following fields are accepted. Unknown fields will be rejected. | Field | Type | Description | | - | - | - | | `costOfItem` | Number | Cost of goods for this line item. Also updates the SKU cost of goods record (creates one if it does not exist). | | `commission` | Number | Commission amount | | `commissionPlan` | String | Commission plan label (e.g. "14%") | | `deduction` | Number | Vendor deduction | | `payout` | Number | Vendor payout amount | | `shipping` | Number | Shipping amount | | `sales` | Number | Sales amount | | `salesAfterDiscount` | Number | Sales after discount | | `tax` | Number | Tax amount | | `tcs` | Number | TCS amount | | `taxOnCommissions` | Number | Tax on commissions | | `totalGlobalDeductions` | Number | Global deductions | | `discount` | Number | Discount amount | *** ## Recalculate Mode You can trigger the recalculation pipeline by setting `recalculate: true`. This re-runs the full commission and payout calculations using current shop settings. Recalculation is **asynchronous** — the response confirms it has been queued, not completed. You can combine `fields` with `recalculate: true` to **update fields first, then recalculate**. This is useful when you want to set a new cost of goods and immediately recalculate the payout based on that value. ```json Update and recalculate theme={null} { "items": [ { "lineItemId": 12345678901234, "orderId": 98765432101234, "fields": { "costOfItem": 15.50 }, "recalculate": true } ] } ``` ```json Recalculate only theme={null} { "items": [ { "lineItemId": 12345678901234, "orderId": 98765432101234, "recalculate": true } ] } ``` ```json Recalculate by SKU theme={null} { "bySku": "SKU-001", "recalculate": true } ``` *** ## Response ### Success Possible `status` values: `"updated"`, `"recalculate_queued"`, `"updated_and_recalculate_queued"`. ```json 200 theme={null} { "success": true, "updated": 1, "recalculateQueued": 1, "results": [ { "lineItemId": 123, "orderId": 456, "status": "updated_and_recalculate_queued" } ], "errors": [] } ``` ### Partial Failure When some items succeed and others fail, the response includes both results and errors. ```json 200 theme={null} { "success": false, "updated": 1, "recalculateQueued": 0, "results": [ { "lineItemId": 123, "orderId": 456, "status": "updated" } ], "errors": [ { "lineItemId": 999, "orderId": 888, "error": "Line item not found" } ] } ``` ### Validation Error ```json 422 theme={null} { "error": "Description of the validation error" } ``` *** ## Important Notes > [!WARNING] > > **Frozen line items** are automatically skipped and reported in the `errors` array. > [!NOTE] > > When `costOfItem` is included in fields, the **SKU cost of goods record** is automatically updated (or created if it does not exist). This ensures future recalculations use the correct COGS value. * **Shop isolation**: All updates are scoped to your authenticated shop. You cannot update line items belonging to other shops. * **Max 100 items** per request when using items mode. * **Mutually exclusive modes**: Provide either `items` or `bySku`, not both. *** ## Examples ### Update cost of goods by SKU ```bash theme={null} curl -X POST https://api.puppetvendors.com/v1/lineitems/update \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "bySku": "SKU-001", "fields": { "costOfItem": 15.50 } }' ``` ### Update specific line items ```bash theme={null} curl -X POST https://api.puppetvendors.com/v1/lineitems/update \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "items": [ { "lineItemId": 12345678901234, "orderId": 98765432101234, "fields": { "costOfItem": 15.50, "payout": 25.00 } } ] }' ``` ### Trigger recalculation by SKU ```bash theme={null} curl -X POST https://api.puppetvendors.com/v1/lineitems/update \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "bySku": "SKU-001", "recalculate": true }' ``` # Update User Source: https://dev.puppetvendors.com/api-reference/endpoint/update-user PUT /v1/users/{userId} Update a vendor portal user's email or password ## Overview Updates a vendor portal user's email address and/or password. ### Use Cases * **Reset a vendor's password** when they are locked out * **Update email addresses** after a vendor team change * **Rotate credentials** as part of a security policy ## Path Parameters **userId** `string` *required* The user's unique ID. ## Request Body **email** `string` *required* Updated email address. **password** `string` *required* Updated password. Will be bcrypt-hashed before storage. ## Response ```json 200 theme={null} { "message": "User updated successfully.", "user": { ... } } ``` ## Example ```bash theme={null} curl -X PUT "https://api.puppetvendors.com/v1/users/61a2b3c4d5e6f7g8h9i0j1k2" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "email": "new-email@acme.com", "password": "newSecurePassword456" }' ``` # Update Vendor Source: https://dev.puppetvendors.com/api-reference/endpoint/update-vendor PUT /v1/vendors/{vendorId} Modify a vendor's name or commission settings ## Overview Update a vendor's name, commission type, or commission amount. Only the fields you include in the request body will be changed. ### Use Cases * **Adjust commission rates** for seasonal promotions or renegotiated terms * **Rename a vendor** after a rebrand * **Sync vendor settings** from an external system ## Path Parameters **vendorId** `string` *required* The vendor's unique ID. ## Request Body All fields are optional. Only provided fields will be updated. **vendorName** `string` Updated vendor name. **commissionType** `string` `"percentage"` or `"flat"`. **commissionAmount** `number` Updated commission value. ## Response ```json 200 theme={null} { "message": "Vendor updated successfully.", "vendor": { ... } } ``` ## Example ```bash theme={null} curl -X PUT "https://api.puppetvendors.com/v1/vendors/6157faecbebcf01bf49097d9" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "commissionAmount": 12 }' ``` # Update Vendor Address Source: https://dev.puppetvendors.com/api-reference/endpoint/update-vendor-address PUT /v1/vendors/{vendorId}/address Set or update a vendor's business address ## Overview Sets or updates the vendor's business address. Only recognized address fields are accepted; unknown keys are ignored. ### Use Cases * **Onboard vendors** by collecting their address through an external form * **Keep addresses in sync** with an external vendor management system * **Update return addresses** for fulfillment workflows ## Path Parameters **vendorId** `string` *required* The vendor's unique ID. ## Request Body **address1** `string` Primary address line. **address2** `string` Secondary address line (suite, unit, etc.). **city** `string` City name. **state** `string` State or province. **postalCode** `string` Postal or ZIP code. **country** `string` Country name. ## Response ```json 200 theme={null} { "message": "Vendor address updated successfully.", "vendor": { ... } } ``` ## Example ```bash theme={null} curl -X PUT "https://api.puppetvendors.com/v1/vendors/6157faecbebcf01bf49097d9/address" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '{ "address1": "123 Market Street", "city": "London", "postalCode": "EC1A 1BB", "country": "United Kingdom" }' ``` # Update Vendor Profile Source: https://dev.puppetvendors.com/api-reference/endpoint/update-vendor-profile PUT /v1/vendors/{vendorId}/profile Update a vendor's custom profile fields ## Overview Update one or more custom profile fields for a vendor. Only fields defined in the shop's profile configuration are accepted. ### Use Cases * **Sync vendor profile data** from an onboarding form or CRM * **Bulk-update vendor info** (tax IDs, bank details) via script * **Allow vendors to update profiles** through a custom portal ## Path Parameters **vendorId** `string` *required* The vendor's unique ID. ## Request Body Send an array of field/value pairs. Use [Get Shop Profile Fields](/api-reference/endpoint/get-shop-profile) to see which fields are available. ```json theme={null} [ { "field": "companyName", "value": "Acme Corp" }, { "field": "taxId", "value": "GB123456789" } ] ``` **field** `string` *required* The profile field name (must match a shop-defined field). **value** `string | number | boolean` *required* The value to set. Cannot be an object. ## Response ```json 200 theme={null} { "message": "Vendor profile updated successfully.", "vendor": { ... } } ``` ## Example ```bash theme={null} curl -X PUT "https://api.puppetvendors.com/v1/vendors/6157faecbebcf01bf49097d9/profile" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_JWT_TOKEN" \ -d '[ { "field": "companyName", "value": "Acme Corp" }, { "field": "phone", "value": "+44 20 7946 0958" } ]' ``` # Authenticate Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-authenticate POST /authenticate Exchange your vendor API key for a JWT token > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Exchange your vendor API key for a short-lived JWT token. The token is scoped to your vendor account and carries the permissions granted to your API key. Tokens expire after **24 hours**. When a token expires, either re-authenticate or use [POST /refresh-token](/api-reference/v2/endpoint/vendor-refresh-token) to get a new one. ### Use Cases * **Vendor portal apps** — Secure, isolated access to your vendor data * **Custom integrations** — Sync your orders, products, and payouts with external systems * **AI agents** — Programmatic access with scoped permissions ## Request Body **apiKey** `string` *required* Your vendor API key (starts with `vk_`). Create one in the vendor portal under Settings > API Keys, or ask your merchant. **shopDomain** `string` Optional. The shop is resolved from your API key. Only send this if your key works across multiple shops — if it doesn't match, the request is rejected. ## Response ```json 200 theme={null} { "success": true, "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expiresIn": 86400, "scope": "vendor", "permissions": ["orders:read", "products:read", "products:write", "fulfillments:read"], "shopDomain": "my-store.myshopify.com", "mode": "live", "vendorId": "507f1f77bcf86cd799439012" } } ``` ### Response Fields | Field | Type | Description | | - | - | - | | `token` | string | JWT token to use in the `x-access-token` header | | `expiresIn` | number | Token lifetime in seconds (always 86400 = 24 hours) | | `scope` | string | Always `"vendor"` for vendor API keys | | `permissions` | string\[] | The specific scopes granted to your API key (e.g., `orders:read`, `products:write`). See [API Keys & Scopes](/api-reference/v2/vendor/api-keys-scopes) | | `shopDomain` | string | The Shopify store domain associated with your key | | `mode` | string | `"live"` or `"test"` — matches your API key mode | | `vendorId` | string | Your vendor account ID | ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid API key", "code": "UNAUTHORIZED" } } ``` ```json 401 theme={null} { "success": false, "error": { "message": "API key revoked", "code": "UNAUTHORIZED" } } ``` ```json 401 theme={null} { "success": false, "error": { "message": "Shop is not active", "code": "UNAUTHORIZED" } } ``` ```json 401 theme={null} { "success": false, "error": { "message": "The provided shopDomain is not available.", "code": "UNAUTHORIZED" } } ``` ```json 429 theme={null} { "success": false, "error": { "message": "Too many authentication requests", "code": "RATE_LIMITED" } } ``` ## Examples ```bash cURL theme={null} curl -X POST https://production-api.puppetvendors.com/authenticate \ -H "Content-Type: application/json" \ -d '{ "apiKey": "vk_live_x9y8z7w6v5u4..." }' ``` ```python Python theme={null} import requests response = requests.post( "https://production-api.puppetvendors.com/authenticate", json={"apiKey": "vk_live_x9y8z7w6v5u4..."} ) data = response.json()["data"] token = data["token"] permissions = data["permissions"] print(f"Token scope: {data['scope']}, permissions: {permissions}") ``` ```javascript JavaScript theme={null} const response = await fetch("https://production-api.puppetvendors.com/authenticate", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ apiKey: "vk_live_x9y8z7w6v5u4..." }) }); const { data } = await response.json(); const token = data.token; // Use token in subsequent requests: // headers: { "x-access-token": token } ``` # Create Discount Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-create-discount POST /discounts Create a new discount code as a vendor > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Create a new discount code for the authenticated vendor's products. ### Use Cases * **Launch vendor-specific promotions** * **Automate discount creation** from marketing campaigns ## Request Body **code** `string` *required* Discount code for checkout. **title** `string` *required* Internal title/description. **startsAt** `string` Start date (ISO 8601). **endsAt** `string` End date (ISO 8601). **customerGets** `object` Discount value configuration. **usageLimit** `integer` Maximum total uses. **appliesOncePerCustomer** `boolean` Limit to one use per customer. **items** `object` Item targeting configuration. ## Response ```json 201 theme={null} { "success": true, "data": { "discount": { "_id": "507f1f77bcf86cd799439011", "code": "VENDOR20", "title": "Vendor Special 20% Off", "status": "active", "createdAt": "2024-06-15T10:00:00.000Z" } } } ``` ## Example ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/discounts \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "code": "VENDOR20", "title": "Vendor Special 20% Off", "usageLimit": 50, "appliesOncePerCustomer": true }' ``` ### More Examples **20% off discount with limit** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/discounts" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "code": "SUMMER20", "title": "Summer 20% Off", "customerGets": { "value": { "type": "percentage", "value": 20 } }, "usageLimit": 100, "appliesOncePerCustomer": true, "startsAt": "2026-06-01T00:00:00Z", "endsAt": "2026-08-31T23:59:59Z" }' ``` **Fixed amount discount** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/discounts" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "code": "SAVE10", "title": "$10 Off Any Order", "customerGets": { "value": { "type": "fixed_amount", "value": 10 } } }' ``` # Create Fulfillment Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-create-fulfillment POST /fulfillments Fulfill line items with tracking information as a vendor > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Create a fulfillment for one or more line items belonging to the authenticated vendor. This creates a fulfillment in Shopify and updates the line item records in PuppetVendors. Optionally sends a shipping notification to the customer. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Automate fulfillment** from a vendor's warehouse or 3PL system * **Bulk-fulfill orders** by scripting API calls from a shipping platform * **Connect external fulfillment services** to the vendor's workflow ## Request Body **lineItemIds** `string[]` *required* Array of PuppetVendors line item IDs (`_id` values) to fulfill. At least one is required. All line items must belong to the authenticated vendor. **trackingNumber** `string` Shipment tracking number. **shippingCarrier** `string` Shipping carrier name (e.g. `"Royal Mail"`, `"UPS"`, `"FedEx"`). **trackingUrl** `string` URL for tracking the shipment. Must be a valid URL. **notifyCustomer** `boolean` (default: false) Whether to send a shipping notification email to the customer. ## Response ```json 200 theme={null} { "success": true, "data": { "success": true, "fulfillments": [ { "type": "success", "lineItemId": "507f1f77bcf86cd799439015", "message": "Fulfillment completed successfully." } ] } } ``` ### Partial Failure If some items fail to fulfill, each item reports individually: ```json 200 theme={null} { "success": true, "data": { "success": true, "fulfillments": [ { "type": "success", "lineItemId": "507f1f77bcf86cd799439015", "message": "Fulfillment completed successfully." }, { "type": "error", "lineItemId": "507f1f77bcf86cd799439016", "message": "Already fulfilled" } ] } } ``` ### Error Responses ```json 400 theme={null} { "success": false, "error": { "message": "Failed to create fulfillments", "code": "FULFILLMENT_FAILED" } } ``` ## Example ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/fulfillments \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "lineItemIds": ["507f1f77bcf86cd799439015", "507f1f77bcf86cd799439016"], "trackingNumber": "RM123456789GB", "shippingCarrier": "Royal Mail", "trackingUrl": "https://tracking.royalmail.com/RM123456789GB", "notifyCustomer": true }' ``` ### More Examples **Fulfill with tracking and notify customer** ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/fulfillments \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "lineItemIds": ["665a1b2c3d4e5f6a7b8c9d0e", "665a1b2c3d4e5f6a7b8c9d0f"], "trackingNumber": "9400111899223100012345", "shippingCarrier": "USPS", "trackingUrl": "https://tools.usps.com/go/TrackConfirmAction?tLabels=9400111899223100012345", "notifyCustomer": true }' ``` # Create Product Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-create-product POST /products Create a new product as a vendor with Shopify sync > [!NOTE] > > **V2 Alpha**: this endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview `POST /products` > [!WARNING] > > **`POST /products/create` is deprecated.** It still works and takes the same body, but every response carries `Deprecation: true` and `Link: ; rel="successor-version"`. Move to `POST /products`. Creates a product via Shopify's `productSet` mutation on behalf of the authenticated vendor, with variants, options, metafields and images in one synchronous call. Max 100 variants. Your vendor id comes from the token; don't send `vendorId`. > [!NOTE] > > **Vendor token required.** Use a token minted from a vendor key (`vk_live_…`) or a portal login. ## Request body **title** `string` *required*. Max 255 characters. **descriptionHtml** `string`. HTML description. **productType** `string`. Max 255. **status** `string`, default `DRAFT`. `ACTIVE` or `DRAFT`. Controls storefront visibility; there is no `published` field. **handle** `string`. Max 255; generated from the title if omitted. **tags** `string[]`. Max 250. **collections** `string[]`. Max 250. **options** `object[]`. Max 3; each `{ name, values[] }`. **variants** `object[]` *required*. 1 to 100 variants. Each needs `price` (decimal string, e.g. `"1.00"`). Each may also include `optionValues` (`[{ name, value }]`), `sku`, `barcode`, `inventoryQuantity`, `weight` (`{ value, unit }`). **metafields** `object[]`. `{ namespace, key, value, type? }`. **images** `object[]`. Max 250; `{ src, altText? }`. **medias** `object[]`. Max 250; downloadable files for digital products. **isDigital** `boolean`. **seo** `object` (`title` ≤255, `description` ≤320). **category**, **templateSuffix** `string`. The body is **strict**: unknown fields return `400 VALIDATION_ERROR` with a hint (`published` → `status`, `media` → `images`/`medias`, `description` → `descriptionHtml`). ## Responses | Status | Code | Meaning | Fix | | - | - | - | - | | 201 | | Created. | | | 400 | `VALIDATION_ERROR` | A field is missing, invalid or unsupported. | Read `error.details` and fix the field. | | 400 | `PRICE_REQUIRED` | A variant has no `price`. | Add `price` to every variant. | | 401 | `UNAUTHORIZED` | No or invalid token. | Authenticate again. | If your shop requires product approval, a new product comes back with `status: "pending"` and no Shopify ids. They appear after a merchant approves it. ```json 201 Created theme={null} { "success": true, "data": { "_id": "", "shopId": "", "vendorStoreProductId": null, "title": "Blue Widget", "vendor": "Vendor-78", "vendorId": "", "assignedVendors": [], "tags": [ "vendor_Vendor-78" ], "collections": [], "variants": [ { "price": "1.00", "barcode": "" } ], "options": [ { "name": "Title", "values": [ "Default Title" ] } ], "images": [], "medias": [], "shopifyMedias": [], "status": "pending", "brandName": "Vendor-78", "metafields": [], "giftCard": false, "request": "productCreate", "updatedByPV": true, "changes": [], "createdAt": "2026-10-21T10:36:55.043Z", "updatedAt": "2026-10-21T10:36:55.043Z", "totalInventory": 0, "__v": 0 } } ``` ```json 400 Missing title theme={null} { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Validation failed", "errorId": "err_1792578578483_abc1234", "details": [ { "code": "invalid_type", "expected": "string", "received": "undefined", "path": ["title"], "message": "Required" } ] } } ``` ```json 400 Unsupported field theme={null} { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Validation failed", "errorId": "err_1792578578483_abc1234", "details": [ { "code": "unrecognized_keys", "keys": ["published"], "path": [], "message": "Unsupported field(s): published (use status (ACTIVE or DRAFT))" } ] } } ``` ```http Deprecated path response headers theme={null} HTTP/1.1 400 Bad Request Deprecation: true Link: ; rel="successor-version" ``` ## Example ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/products \ -H "Content-Type: application/json" \ -H "x-access-token: $PV_VENDOR_TOKEN" \ -d '{ "title": "Widget Pro", "descriptionHtml": "

Premium widget

", "status": "DRAFT", "options": [{ "name": "Size", "values": ["Small", "Large"] }], "variants": [ { "optionValues": [{ "name": "Size", "value": "Small" }], "price": "19.99", "sku": "WP-SM" }, { "optionValues": [{ "name": "Size", "value": "Large" }], "price": "29.99", "sku": "WP-LG" } ], "images": [{ "src": "https://cdn.example.com/widget.jpg", "altText": "Widget Pro" }], "tags": ["widget"] }' ``` ```bash Digital product theme={null} curl -X POST https://production-api.puppetvendors.com/products \ -H "Content-Type: application/json" \ -H "x-access-token: $PV_VENDOR_TOKEN" \ -d '{ "title": "Photography Preset Pack", "isDigital": true, "status": "DRAFT", "variants": [{ "price": "19.99", "sku": "PRESET-STD" }] }' ``` # Create User Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-create-user POST /users Create a new user account for the vendor > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Create a new user account for the authenticated vendor. The `vendorId` is automatically derived from the vendor token, and the user type is always set to `vendor`. Optionally send an invitation email to the new user. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Invite team members** to the vendor portal * **Automate account provisioning** for new vendor staff ## Request Body **email** `string` *required* Email address for the new user. Must be a valid email format. **password** `string` *required* Password for the new user (minimum 6 characters). **vendor** `string` Vendor name label for the user. **approved** `boolean` (default: false) Whether the account is immediately active. **notifications** `boolean` Enable email notifications for the user. **sendInvite** `boolean` (default: false) Send an invitation email to the new user. **profile** `object` User profile information. **profile properties** **profile.firstName** `string` First name (max 100 characters). **profile.lastName** `string` Last name (max 100 characters). **profile.phone** `string` Phone number (max 50 characters). **permission** `object` Permission configuration object for granular access control. ## Response ```json 201 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439022", "email": "newuser@vendor.com", "type": "vendor", "approved": false, "profile": { "firstName": "New", "lastName": "User" }, "notifications": true, "permission": {}, "createdAt": "2024-06-15T12:00:00.000Z", "updatedAt": "2024-06-15T12:00:00.000Z" } } ``` ### Error Responses ```json 409 theme={null} { "success": false, "error": "A user with this email already exists" } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/users" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "email": "newuser@vendor.com", "password": "securePass123", "approved": true, "sendInvite": true, "profile": { "firstName": "New", "lastName": "User" } }' ``` # Delete Discount Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-delete-discount DELETE /discounts/{discountId} Delete a vendor discount code > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Permanently delete a discount code owned by the authenticated vendor. ## Path Parameters **discountId** `string` *required* Discount ObjectId. ## Response ```json 200 theme={null} { "success": true, "data": { "deleted": true } } ``` ## Example ```bash theme={null} curl -X DELETE https://production-api.puppetvendors.com/discounts/507f1f77bcf86cd799439011 \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # Delete User Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-delete-user DELETE /users/{userId} Delete a user account belonging to the vendor > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Delete a user account belonging to the authenticated vendor. Returns 404 if the user does not exist or does not belong to the vendor. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Remove team members** who no longer need portal access * **Clean up inactive accounts** from the vendor user list ## Path Parameters **userId** `string` *required* The user ObjectId to delete. ## Response ```json 200 theme={null} { "success": true, "data": { "deleted": true } } ``` ### Error Responses ```json 404 theme={null} { "success": false, "error": "User not found" } ``` ## Example ```bash theme={null} curl -X DELETE "https://production-api.puppetvendors.com/users/507f1f77bcf86cd799439022" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # Get Order Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-get-order GET /orders/{orderId} Retrieve a single order with vendor-scoped line items > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve detailed information for a single order, scoped to the authenticated vendor. The response includes only line items belonging to the vendor and indicates vendor scoping via the `isVendorScoped` flag. The `orderId` parameter accepts either a MongoDB ObjectId or a numeric Shopify order ID. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Order detail view** — Display full order breakdown in a vendor portal * **Payout reconciliation** — Check vendor earnings for a specific order * **Fulfillment planning** — See which vendor line items need fulfillment ## Path Parameters **orderId** `string` *required* The order's MongoDB ObjectId or numeric Shopify order ID. ## Response ```json 200 theme={null} { "success": true, "data": { "order": { "_id": "507f1f77bcf86cd799439013", "orderId": 5123456789, "orderNumber": 1042, "orderName": "#1042", "customer": { "email": "customer@example.com", "firstName": "Jane", "lastName": "Doe" }, "shippingAddress": { "address1": "123 High Street", "city": "London", "province": "England", "country": "United Kingdom", "zip": "SW1A 1AA" }, "status": "fulfilled", "createdAt": "2024-06-15T10:30:00.000Z" }, "lineItems": [ { "_id": "507f1f77bcf86cd799439015", "lineItemName": "Widget Pro - Large / Blue", "quantity": 2, "unitPrice": 139.99, "fulfillmentStatus": "fulfilled" } ], "isVendorScoped": true } } ``` ### Error Response ```json 404 theme={null} { "success": false, "error": { "message": "Order not found", "code": "NOT_FOUND" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/orders/507f1f77bcf86cd799439013" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # Get Payout Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-get-payout GET /payouts/{payoutId} Retrieve a single payout transaction with item details > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve detailed information for a single payout transaction belonging to the authenticated vendor. The response includes the transaction summary, status, payment method, and a breakdown of individual line items included in the payout. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Payout detail view** — Display a full payout breakdown in a vendor portal * **Invoice generation** — Pull payout details for creating vendor invoices * **Payment verification** — Confirm payout amounts and line item breakdown ## Path Parameters **payoutId** `string` *required* The payout transaction's MongoDB ObjectId. ## Response ```json 200 theme={null} { "success": true, "data": { "transaction": { "_id": "507f1f77bcf86cd799439050", "transactionId": "TXN-2024-001042", "status": "paid", "amount": 1250.75, "currency": "GBP", "itemCount": 12, "paymentMethod": "stripe", "processedAt": "2024-06-20T14:00:00.000Z", "createdAt": "2024-06-15T10:30:00.000Z" }, "items": [ { "_id": "507f1f77bcf86cd799439060", "orderNumber": 1042, "orderName": "#1042", "lineItemName": "Widget Pro - Large / Blue", "lineItemSku": "WP-LG-BL", "quantity": 2, "sales": 279.99, "commission": 39.20, "payout": 240.79 }, { "_id": "507f1f77bcf86cd799439061", "orderNumber": 1043, "orderName": "#1043", "lineItemName": "Widget Mini - Red", "lineItemSku": "WM-RD", "quantity": 5, "sales": 149.95, "commission": 21.00, "payout": 128.95 } ] } } ``` ### Error Response ```json 404 theme={null} { "success": false, "error": { "message": "Payout not found", "code": "NOT_FOUND" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts/507f1f77bcf86cd799439050" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # PayPal Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-get-paypal GET /integrations/paypal Retrieve the vendor's PayPal integration > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the PayPal integration configuration for payout processing. Email is returned masked. ## Response ```json 200 theme={null} { "success": true, "data": { "integration": { "type": "paypal", "connected": true, "email": "v****r@premiumcrafts.com", "updatedAt": "2024-05-01T08:00:00.000Z" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/integrations/paypal" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # Shippo Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-get-shippo GET /integrations/shippo Retrieve the vendor's Shippo shipping integration > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the Shippo integration configuration for the authenticated vendor. API keys are returned masked for security. ### Use Cases * **Check integration status** in vendor settings * **Verify Shippo connection** before fulfillment automation ## Response ```json 200 theme={null} { "success": true, "data": { "integration": { "type": "shippo", "connected": true, "apiKey": "shippo_test_****...****abc1", "updatedAt": "2024-05-01T08:00:00.000Z" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/integrations/shippo" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # ShipStation Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-get-shipstation GET /integrations/shipstation Retrieve the vendor's ShipStation integration > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the ShipStation integration configuration. API credentials are returned masked. ## Response ```json 200 theme={null} { "success": true, "data": { "integration": { "type": "shipstation", "connected": true, "apiKey": "****...****xyz9", "updatedAt": "2024-05-01T08:00:00.000Z" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/integrations/shipstation" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # Stripe Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-get-stripe GET /integrations/stripe Retrieve the vendor's Stripe Connect integration status > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the Stripe Connect integration status for the authenticated vendor. Shows whether the vendor has completed Stripe onboarding for payout processing. ## Response ```json 200 theme={null} { "success": true, "data": { "integration": { "type": "stripe", "connected": true, "accountId": "acct_1234567890", "chargesEnabled": true, "payoutsEnabled": true, "updatedAt": "2024-04-15T12:00:00.000Z" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/integrations/stripe" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # List Customers Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-list-customers GET /customers Retrieve a paginated customer directory from vendor order data > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve a paginated list of unique customers derived from the authenticated vendor's order data. Each customer record includes contact information, order count, total spent, and the date of their last order. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Build a vendor CRM** showing customer purchase history * **Identify high-value customers** by total spend or order frequency ## Query Parameters **createdAtMin** `string` Filter by first order date (minimum, ISO 8601). **createdAtMax** `string` Filter by first order date (maximum, ISO 8601). **locationId** `string` Filter by Shopify location ID. **search** `string` Search in customer email, first name, or last name. **first** `integer` Number of items to return, forward pagination (1-100). **after** `string` Cursor for forward pagination. **last** `integer` Number of items to return, backward pagination (1-100). **before** `string` Cursor for backward pagination. ## Response ```json 200 theme={null} { "success": true, "data": { "edges": [ { "node": { "email": "jane.doe@example.com", "firstName": "Jane", "lastName": "Doe", "phone": "+1-555-123-4567", "orderCount": 5, "totalSpent": 849.95, "lastOrderDate": "2024-06-10T14:30:00.000Z" }, "cursor": "eyJpZCI6IjY2NjU3ZjFhYmNkZWYwMTIzNDU2Nzg5MCJ9" } ], "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "startCursor": "eyJpZCI6IjY2NjU3ZjFhYmNkZWYwMTIzNDU2Nzg5MCJ9", "endCursor": "eyJpZCI6IjY2NjU3ZjFhYmNkZWYwMTIzNDU2Nzg5OSJ9" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/customers?search=jane&first=20" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # List Discounts Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-list-discounts GET /discounts Retrieve vendor-scoped discount codes > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve discount codes created by or assigned to the authenticated vendor. ### Use Cases * **Manage promotions** in a vendor self-service portal * **Monitor discount usage** and effectiveness ## Query Parameters **status** `string` Filter by status. One of: `active`, `expired`, `disabled`. **search** `string` Search in discount title and code. **first** `integer` Forward pagination count (1–100). **after** `string` Forward pagination cursor. **last** `integer` Backward pagination count (1–100). **before** `string` Backward pagination cursor. ## Response ```json 200 theme={null} { "success": true, "data": { "edges": [ { "node": { "_id": "507f1f77bcf86cd799439011", "code": "VENDOR20", "title": "Vendor Special 20% Off", "status": "active", "startsAt": "2024-06-01T00:00:00.000Z", "endsAt": "2024-08-31T23:59:59.000Z", "usageCount": 12, "usageLimit": 50 }, "cursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9" } ], "pageInfo": { "hasNextPage": false, "hasPreviousPage": false, "startCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9", "endCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/discounts?status=active&first=20" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` ### More Examples **Search active discounts sorted by usage** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/discounts?first=20&status=active&search=SUMMER&sortBy=usageCount&sortOrder=desc" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # List Fulfillments Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-list-fulfillments GET /fulfillments Retrieve vendor-scoped fulfillment items with cursor-based pagination > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve a paginated list of line items with their fulfillment status and tracking information, scoped to the authenticated vendor. Only line items belonging to the vendor are returned. Use this endpoint to monitor pending and completed fulfillments. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Fulfillment dashboard** — Monitor pending and completed fulfillments for the vendor * **Shipping integration** — Pull unfulfilled items for 3PL or warehouse systems * **Order management** — Track the vendor's fulfillment queue ## Query Parameters **fulfillmentStatus** `string` Filter by fulfillment status. One of: `fulfilled`, `unfulfilled`. **shipmentStatus** `string` Filter by shipment status (max 50 characters). **dateMin** `string` Filter by date (minimum, ISO 8601). Example: `2024-01-01T00:00:00Z`. **dateMax** `string` Filter by date (maximum, ISO 8601). **search** `string` Search in order name/number or line item name (max 200 characters). **first** `integer` Number of items to return, forward pagination (1-100). **after** `string` Cursor for forward pagination. **last** `integer` Number of items to return, backward pagination (1-100). **before** `string` Cursor for backward pagination. ## Response ```json 200 theme={null} { "success": true, "data": { "items": [ { "_id": "507f1f77bcf86cd799439015", "orderId": 5123456789, "orderNumber": 1042, "orderName": "#1042", "lineItemName": "Widget Pro - Large / Blue", "lineItemSku": "WP-LG-BL", "quantity": 2, "fulfillment": { "status": "fulfilled", "trackingCompany": "Royal Mail", "trackingNumber": "RM123456789GB", "trackingUrl": "https://tracking.royalmail.com/RM123456789GB", "createdAt": "2024-06-16T09:00:00.000Z" }, "shippingAddress": { "name": "Jane Doe", "address1": "123 High Street", "city": "London", "country": "United Kingdom", "zip": "SW1A 1AA" }, "date": "2024-06-15T10:30:00.000Z" } ], "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "startCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxNSJ9", "endCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAyNSJ9", "totalCount": 85 } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/fulfillments?fulfillmentStatus=unfulfilled&first=20" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` ### More Examples **Filter unfulfilled items in date range** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/fulfillments?first=20&fulfillmentStatus=unfulfilled&dateMin=2026-05-01T00:00:00Z&sortBy=date&sortOrder=asc" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` **Search by order number** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/fulfillments?first=10&search=1042" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # List Orders Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-list-orders GET /orders Retrieve vendor-scoped orders with cursor-based pagination > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve a paginated list of orders scoped to the authenticated vendor. Only orders containing line items belonging to the vendor are returned. Results include order totals, customer info, and fulfillment status for each order. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Vendor order dashboards** — Display a vendor's recent order activity * **Order sync** — Pull vendor orders into an external OMS or ERP system * **Reporting** — Build custom reports on vendor sales and fulfillment ## Query Parameters **locationId** `integer` Filter by Shopify location ID. **status** `string` Filter by financial status. One of: `pending`, `authorized`, `paid`, `partially_paid`, `refunded`, `voided`, `partially_refunded`. **createdAtMin** `string` Filter by order creation date (minimum, ISO 8601). Example: `2024-01-01T00:00:00Z`. **createdAtMax** `string` Filter by order creation date (maximum, ISO 8601). **search** `string` Search in order name/number (max 200 characters). **first** `integer` Number of items to return, forward pagination (1-100). **after** `string` Cursor for forward pagination. **last** `integer` Number of items to return, backward pagination (1-100). **before** `string` Cursor for backward pagination. ## Response ```json 200 theme={null} { "success": true, "data": { "orders": [ { "_id": "507f1f77bcf86cd799439013", "orderId": 5123456789, "orderNumber": 1042, "orderName": "#1042", "customer": { "email": "customer@example.com", "firstName": "Jane", "lastName": "Doe" }, "totalSales": 279.99, "totalPayout": 240.79, "fulfillmentStatus": "fulfilled", "createdAt": "2024-06-15T10:30:00.000Z" } ], "totalCount": 150, "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "startCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMyJ9", "endCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAyMCJ9" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/orders?first=20&status=paid" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` ### More Examples **Filter by date range and status** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/orders?first=20&startDate=2026-05-01T00:00:00Z&endDate=2026-05-31T23:59:59Z&status=pending" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` **Search orders with payout filter** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/orders?first=10&search=blue+t-shirt&vendorPayoutStatus=unpaid&sortBy=totalSales&sortOrder=desc" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # List Payouts Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-list-payouts GET /payouts Retrieve vendor-scoped payout transactions with cursor-based pagination > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve a paginated list of payout transactions for the authenticated vendor. Results include transaction status, amounts, processing dates, and item counts. Only payouts belonging to the vendor are returned. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Payout dashboard** — Display pending and completed payouts in a vendor portal * **Accounting reconciliation** — Export payout data for bookkeeping * **Payment tracking** — Monitor payout statuses and amounts ## Query Parameters **status** `string` Filter by payout status. One of: `pending`, `paid`, `failed`, `cancelled`. **dateMin** `string` Filter by date (minimum, ISO 8601). Example: `2024-01-01T00:00:00Z`. **dateMax** `string` Filter by date (maximum, ISO 8601). **first** `integer` Number of items to return, forward pagination (1-100). **after** `string` Cursor for forward pagination. **last** `integer` Number of items to return, backward pagination (1-100). **before** `string` Cursor for backward pagination. ## Response ```json 200 theme={null} { "success": true, "data": { "transactions": [ { "_id": "507f1f77bcf86cd799439050", "transactionId": "TXN-2024-001042", "status": "paid", "amount": 1250.75, "currency": "GBP", "itemCount": 12, "processedAt": "2024-06-20T14:00:00.000Z", "createdAt": "2024-06-15T10:30:00.000Z" }, { "_id": "507f1f77bcf86cd799439051", "transactionId": "TXN-2024-001038", "status": "pending", "amount": 840.50, "currency": "GBP", "itemCount": 8, "processedAt": null, "createdAt": "2024-06-18T09:15:00.000Z" } ], "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "startCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTA1MCJ9", "endCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTA1MSJ9", "totalCount": 25 } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts?status=pending&first=20" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` ### More Examples **Filter unpaid payouts** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts?first=20&status=unpaid&fulfillment=fulfilled" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` **Payouts in date range** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts?first=50&dateMin=2026-04-01T00:00:00Z&dateMax=2026-04-30T23:59:59Z" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # List Products Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-list-products GET /products Retrieve vendor-scoped products with cursor-based pagination > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve a paginated list of products belonging to the authenticated vendor. Results include product title, handle, status, variants, and images. Only products assigned to the vendor are returned. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Product catalogue** — Display a vendor's product listings in a custom portal * **Inventory management** — Pull product data for stock-level monitoring * **Product sync** — Export vendor products to external systems ## Query Parameters **status** `string` Filter by product status. One of: `active`, `draft`, `archived`. **createdAtMin** `string` Filter by creation date (minimum, ISO 8601). Example: `2024-01-01T00:00:00Z`. **createdAtMax** `string` Filter by creation date (maximum, ISO 8601). **search** `string` Search in product title or handle (max 200 characters). **first** `integer` Number of items to return, forward pagination (1-100). **after** `string` Cursor for forward pagination. **last** `integer` Number of items to return, backward pagination (1-100). **before** `string` Cursor for backward pagination. ## Response ```json 200 theme={null} { "success": true, "data": { "products": [ { "_id": "507f1f77bcf86cd799439030", "title": "Widget Pro", "handle": "widget-pro", "status": "active", "productId": 7654321098765, "variants": [ { "variantId": 43210987654321, "title": "Small", "price": "19.99", "sku": "WP-SM", "inventoryQuantity": 50 }, { "variantId": 43210987654322, "title": "Medium", "price": "24.99", "sku": "WP-MD", "inventoryQuantity": 30 } ], "images": [ { "src": "https://cdn.shopify.com/s/files/1/example/widget-pro.jpg", "alt": "Widget Pro main image" } ], "createdAt": "2024-06-10T08:00:00.000Z" } ], "totalCount": 42, "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "startCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAzMCJ9", "endCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTA0MCJ9" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/products?status=active&first=20" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` ### More Examples **Filter active products sorted by inventory** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/products?first=50&status=active&sortBy=totalInventory&sortOrder=asc" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` **Search out-of-stock products** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/products?first=20&search=summer+collection&inventoryStatus=outOfStock" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # List Users Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-list-users GET /users Retrieve a paginated list of users belonging to the vendor > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve a paginated list of user accounts belonging to the authenticated vendor. Results are automatically scoped to the vendor's own users. Supports filtering by user type, approval status, and text search. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Manage team access** in a vendor self-service portal * **Audit active accounts** and invitation status ## Query Parameters **type** `string` Filter by user type. One of: `vendor`, `merchant`, `admin`. **approved** `boolean` Filter by approval status. **search** `string` Search in user email, first name, or last name (max 200 characters). **first** `integer` Number of items to return, forward pagination (1-100). **after** `string` Cursor for forward pagination. **last** `integer` Number of items to return, backward pagination (1-100). **before** `string` Cursor for backward pagination. ## Response ```json 200 theme={null} { "success": true, "data": { "edges": [ { "node": { "_id": "507f1f77bcf86cd799439011", "email": "team@vendor.com", "type": "vendor", "approved": true, "profile": { "firstName": "Alex", "lastName": "Smith", "phone": "+1-555-987-6543" }, "notifications": true, "permission": {}, "lastLoggedIn": "2024-06-14T09:00:00.000Z", "createdAt": "2024-01-10T08:00:00.000Z", "updatedAt": "2024-06-14T09:00:00.000Z" }, "cursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9" } ], "pageInfo": { "hasNextPage": false, "hasPreviousPage": false, "startCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9", "endCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/users?approved=true&first=20" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" ``` # Refresh Token Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-refresh-token POST /refresh-token Exchange a valid vendor token for a new one with extended expiry > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Exchange a valid (non-expired) vendor JWT token for a new one with a fresh 24-hour expiry. Use this to maintain sessions without requiring re-authentication with the API key. The new token inherits the `vendor` scope from the original. ### Use Cases * **Long-running integrations** — Automatically refresh tokens before they expire * **Vendor portal sessions** — Keep your session alive without re-entering the API key ## Request No request body required. The current token is read from the `x-access-token` header. ## Response ```json 200 theme={null} { "success": true, "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expiresIn": 86400, "shopDomain": "my-store.myshopify.com" } } ``` ### Error Response ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token", "code": "UNAUTHORIZED" } } ``` ## Example ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/refresh-token \ -H "x-access-token: YOUR_VENDOR_TOKEN" ``` # Update Discount Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-update-discount PUT /discounts/{discountId} Update an existing vendor discount code > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update an existing discount code owned by the authenticated vendor. ## Path Parameters **discountId** `string` *required* Discount ObjectId. ## Request Body **title** `string` Updated title. **endsAt** `string` Updated end date (ISO 8601). **status** `string` Updated status. One of: `active`, `expired`, `disabled`. ## Response ```json 200 theme={null} { "success": true, "data": { "discount": { "_id": "507f1f77bcf86cd799439011", "code": "VENDOR20", "title": "Extended Vendor Sale", "status": "active", "updatedAt": "2024-08-01T09:00:00.000Z" } } } ``` ## Example ```bash theme={null} curl -X PUT https://production-api.puppetvendors.com/discounts/507f1f77bcf86cd799439011 \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "title": "Extended Vendor Sale", "endsAt": "2024-09-30T23:59:59.000Z" }' ``` # Update Fulfillment Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-update-fulfillment PUT /fulfillments/{fulfillmentId} Update fulfillment tracking information as a vendor > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update tracking information on an existing fulfillment belonging to the authenticated vendor. This syncs the updated tracking to Shopify and optionally re-notifies the customer. Only fulfillments for the vendor's own line items can be updated. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Correct tracking numbers** — Fix a mistyped tracking number after fulfillment * **Update carrier** — Change the shipping carrier if initially set incorrectly * **Re-notify customers** — Resend shipping notifications with corrected info ## Path Parameters **fulfillmentId** `string` *required* The line item ID (fulfillment is stored on the line item record). ## Request Body All fields are optional. Only provided fields will be updated. **trackingNumber** `string` Updated tracking number. **shippingCarrier** `string` Updated shipping carrier name. **trackingUrl** `string` Updated tracking URL. Must be a valid URL. **notifyCustomer** `boolean` Whether to send a notification email to the customer with the updated tracking. ## Response ```json 200 theme={null} { "success": true, "data": { "message": "Fulfillment updated successfully" } } ``` ### Error Response ```json 404 theme={null} { "success": false, "error": { "message": "Fulfillment not found", "code": "NOT_FOUND" } } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/fulfillments/507f1f77bcf86cd799439015" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "trackingNumber": "1Z999AA10123456784", "shippingCarrier": "UPS", "trackingUrl": "https://www.ups.com/track?tracknum=1Z999AA10123456784", "notifyCustomer": true }' ``` ### More Examples **Update tracking info after shipping** ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/fulfillments/507f1f77bcf86cd799439015" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "trackingNumber": "1Z999AA10123456784", "shippingCarrier": "UPS", "trackingUrl": "https://www.ups.com/track?tracknum=1Z999AA10123456784", "notifyCustomer": true }' ``` # PayPal Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-update-paypal PUT /integrations/paypal Configure or update the vendor's PayPal integration > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Set or update the PayPal email address used for payout processing. ## Request Body **email** `string` *required* PayPal email address (must be valid email format). ## Response ```json 200 theme={null} { "success": true, "data": { "integration": { "type": "paypal", "connected": true, "updatedAt": "2024-06-15T10:00:00.000Z" } } } ``` ## Example ```bash theme={null} curl -X PUT https://production-api.puppetvendors.com/integrations/paypal \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "email": "vendor@premiumcrafts.com" }' ``` # Shippo Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-update-shippo PUT /integrations/shippo Configure or update the vendor's Shippo integration > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Set or update the Shippo API key for shipping label generation and tracking. ## Request Body **apiKey** `string` *required* Shippo API key. ## Response ```json 200 theme={null} { "success": true, "data": { "integration": { "type": "shippo", "connected": true, "updatedAt": "2024-06-15T10:00:00.000Z" } } } ``` ## Example ```bash theme={null} curl -X PUT https://production-api.puppetvendors.com/integrations/shippo \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "apiKey": "shippo_test_abc123def456" }' ``` # ShipStation Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-update-shipstation PUT /integrations/shipstation Configure or update the vendor's ShipStation integration > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Set or update the ShipStation API credentials for order sync and shipping automation. ## Request Body **apiKey** `string` *required* ShipStation API key. **apiSecret** `string` *required* ShipStation API secret. ## Response ```json 200 theme={null} { "success": true, "data": { "integration": { "type": "shipstation", "connected": true, "updatedAt": "2024-06-15T10:00:00.000Z" } } } ``` ## Example ```bash theme={null} curl -X PUT https://production-api.puppetvendors.com/integrations/shipstation \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "apiKey": "abc123def456", "apiSecret": "secret789xyz" }' ``` # Update User Source: https://dev.puppetvendors.com/api-reference/v2/endpoint/vendor-update-user PUT /users/{userId} Update an existing user account belonging to the vendor > [!NOTE] > > **V2 Alpha** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update an existing user account belonging to the authenticated vendor. Only fields included in the request body are updated. Returns 404 if the user does not belong to the vendor. > [!NOTE] > > **Vendor Token Required** — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error. ### Use Cases * **Update team member permissions** or approval status * **Reset a user's password** from the vendor portal ## Path Parameters **userId** `string` *required* The user ObjectId to update. ## Request Body **email** `string` Updated email address. Must be a valid email format. **password** `string` Updated password (minimum 6 characters). **approved** `boolean` Whether the account is active. **notifications** `boolean` Enable or disable email notifications. **profile** `object` Updated profile information. **profile properties** **profile.firstName** `string` First name (max 100 characters). **profile.lastName** `string` Last name (max 100 characters). **profile.phone** `string` Phone number (max 50 characters). **permission** `object` Updated permission configuration object. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439022", "email": "updated@vendor.com", "type": "vendor", "approved": true, "profile": { "firstName": "Updated", "lastName": "User" }, "notifications": true, "permission": {}, "createdAt": "2024-06-15T12:00:00.000Z", "updatedAt": "2024-06-16T10:00:00.000Z" } } ``` ### Error Responses ```json 404 theme={null} { "success": false, "error": "User not found" } ``` ```json 409 theme={null} { "success": false, "error": "A user with this email already exists" } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/users/507f1f77bcf86cd799439022" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \ -d '{ "approved": true, "profile": { "firstName": "Updated", "lastName": "User" } }' ``` # Merchant Authentication Source: https://dev.puppetvendors.com/api-reference/v2/merchant/authentication Authenticate with the PuppetVendors V2 API using a merchant API key > [!NOTE] > > **V2 Preview** — This authentication flow is part of the V2 API preview. Breaking changes may occur. ## Overview All V2 Merchant API endpoints require a JWT token passed via the `x-access-token` header. You obtain the token by exchanging your merchant API key at `POST /authenticate`. Merchant API keys start with `mk_live_` (or `mk_test_` for test mode) and are created in the PuppetVendors admin under **Settings → API Access**. The full key is revealed once at creation. ## Authenticating ```bash cURL theme={null} curl -X POST https://production-api.puppetvendors.com/authenticate \ -H "Content-Type: application/json" \ -d '{ "apiKey": "mk_live_YOUR_MERCHANT_API_KEY" }' ``` ```python Python theme={null} import requests resp = requests.post( "https://production-api.puppetvendors.com/authenticate", json={"apiKey": "mk_live_YOUR_MERCHANT_API_KEY"} ) token = resp.json()["data"]["token"] ``` ```javascript JavaScript theme={null} const resp = await fetch("https://production-api.puppetvendors.com/authenticate", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ apiKey: "mk_live_YOUR_MERCHANT_API_KEY" }) }); const { data } = await resp.json(); const token = data.token; ``` ```json 200 theme={null} { "success": true, "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expiresIn": 1209600, "scope": "merchant", "shopDomain": "my-store.myshopify.com" } } ``` * `scope` is `"merchant"` for merchant tokens — vendor keys (`vk_`) authenticate at the same endpoint but return `"vendor"` scope * The key's prefix determines the token scope: `mk_` keys mint merchant-scoped tokens with a read and a write permission for each resource (for example `admin:products:read` and `admin:products:write`). See [Scope of a Merchant Key](/api-reference/v2/merchant/introduction#scope-of-a-merchant-key) for the full list ## Using the Token Include the token in all subsequent requests via the `x-access-token` header. Send the token value directly, with no `Bearer` prefix: ```bash cURL theme={null} curl -X GET "https://production-api.puppetvendors.com/vendors?page=1&limit=20" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` ```python Python theme={null} resp = requests.get( "https://production-api.puppetvendors.com/vendors", params={"page": 1, "limit": 20}, headers={"x-access-token": token} ) ``` ```javascript JavaScript theme={null} const resp = await fetch("https://production-api.puppetvendors.com/vendors?page=1&limit=20", { headers: { "x-access-token": token } }); ``` ## Token Expiry & Refresh Merchant tokens expire after **14 days** (1209600 seconds). Use `POST /refresh-token` with a valid (non-expired) token to get a new one without re-authenticating: ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/refresh-token \ -H "x-access-token: YOUR_CURRENT_TOKEN" ``` Revoking the key refuses the next request made with any token minted from it. ## Verifying a Key `POST /verify` is a side-effect-free probe: it confirms the key is valid and reachable and returns the scope, mode, and identity it carries, but does **not** issue a JWT or count as a use (`lastUsedAt` is unchanged). Any key that passes `/verify` will also pass `/authenticate`. ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/verify \ -H "Content-Type: application/json" \ -d '{ "apiKey": "mk_live_YOUR_MERCHANT_API_KEY" }' ``` ## Key Rotation & Revocation * **Rotate** a key in **Settings → API Access** — the previous key keeps working for a **24-hour grace window**, so a rotation is an overlap rather than a cutover * **Revoke** a key to immediately refuse any token minted from it ## Scope Behaviour Merchant tokens administer the whole shop: vendor management, user management, and payout adjustments across all vendors. Endpoints outside the merchant surface (orders, products, payouts, fulfillments, documents) return HTTP 403 — those stay on the V1 API token. # Generate an AI product description Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/ai-product-description openapi-merchant.json POST /products/ai/description Write a product description with AI. Uses your store's AI credits. Returns 403 `FEATURE_DISABLED` when AI descriptions are turned off. # Approve products Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/approve-products openapi-merchant.json POST /products/approve Approve up to 100 pending products in one call, as draft or active. Each product gets its own result, and the push to Shopify is queued, so read the product afterwards to see its final status. To find products waiting for review, call `GET /products?status=pending`. # Authenticate and get API token Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/authenticate openapi-merchant.json POST /authenticate Authenticate using an API key to obtain a JWT token. The key's prefix determines the token scope: - **Merchant key** (`mk_live_…` / `mk_test_…`, from Settings → API Access): returns a merchant-scoped token with full access. Named, rotatable and revocable per integration. - **Vendor key** (`vk_live_…` / `vk_test_…`, from the vendor portal): returns a vendor-scoped token limited to that vendor's data, carrying the scopes declared on the key. A rotated key keeps working until the end of its grace window, so a rotation is an overlap rather than a cutover. # Create a payout adjustment Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/create-payout-adjustment openapi-merchant.json POST /payouts/adjustments Create a manual payout adjustment (addition or deduction) for a vendor. `amount` is always positive; the stored sign is derived from `type`. `status` and `batchId` are owned by the payout engine and cannot be set by the caller. This endpoint is **not** idempotent: every accepted request creates a new adjustment, so a retried or duplicated POST creates a second one. Callers are responsible for not re-posting a request that may already have been applied. ## Purpose Add a manual addition or deduction to a vendor's next payout. ## When to use When you need to pay or charge a vendor an amount that is not from an order, such as a bonus or a fee. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 404 | `NOT_FOUND` | The resource does not exist in your store. | Check the id. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [Authenticate](/api-reference/v2/merchant/endpoint/authenticate) ## Next step [List pending payouts](/api-reference/v2/merchant/endpoint/list-pending-payouts) # Create a product Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/create-product openapi-merchant.json POST /products Create a product for the vendor in `vendorId`. It goes straight to Shopify without product approval, and vendor-side restrictions don't apply; title, price and metafield rules still do. Send the full set of metafields: any left out are deleted. # Create user (vendor-scoped) Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/create-user openapi-merchant.json POST /users Create a new user account. **Merchant scope only**. # Create a new vendor Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/create-vendor openapi-merchant.json POST /vendors Create a new vendor in the shop. **Merchant scope only**. # Delete a payout adjustment Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/delete-payout-adjustment openapi-merchant.json DELETE /payouts/adjustments/{id} Permanently delete an unpaid payout adjustment. Refused once the adjustment has been paid or deleted. ## Purpose Permanently delete an unpaid payout adjustment. ## When to use To remove an adjustment you created by mistake. Paid adjustments cannot be deleted. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 404 | `NOT_FOUND` | The resource does not exist in your store. | Check the id. | | 409 | see `error.code` | The adjustment is already paid or deleted. | Nothing to do. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [Get a payout adjustment](/api-reference/v2/merchant/endpoint/get-payout-adjustment) ## Next step [List pending payouts](/api-reference/v2/merchant/endpoint/list-pending-payouts) # Delete a product Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/delete-product openapi-merchant.json DELETE /products/{productId} Delete any product in your store. It is also removed from Shopify. # Delete user (vendor-scoped) Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/delete-user openapi-merchant.json DELETE /users/{userId} Delete a user account. **Merchant scope only**. # Delete a vendor (soft delete) Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/delete-vendor openapi-merchant.json DELETE /vendors/{vendorId} Soft delete a vendor by setting isHidden=true. The vendor data is preserved but hidden from lists. **Merchant scope only**. # Preview a payout Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/dry-run-payout openapi-merchant.json POST /payouts/make-payment/dry-run Preview what a payout would pay, with totals and any validation issues, without creating anything. Not available while Automated Payouts is on: returns 409 `AUTOMATED_PAYOUTS_ACTIVE`. The preview runs the same store checks as Create a payout, so a preview that succeeds will not be refused for a store-level reason. ## Purpose Preview a payout without paying anything. ## When to use Always, right before Create a payout. It runs the same checks, so a preview that succeeds will not fail for a store-level reason. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 404 | `NOT_FOUND` | A vendor is not in your store. `details.vendorIds` lists them. | Remove those vendors. | | 409 | `AUTOMATED_PAYOUTS_ACTIVE` | Your store pays vendors automatically. | Settings > Payouts > Automated Payouts > **Disable Automated Payouts**. Nothing was started. | | 422 | `ADJUSTMENTS_NOT_PAYABLE` | Some adjustments are not this vendor's, not unpaid, or excluded. `details` lists them. | Remove those ids, or check them with List pending items. | | 422 | `VENDOR_NOT_READY_FOR_METHOD` | A vendor is not set up for this method. `details.vendorIds` lists them. | Pick a method from List payout methods. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [List a vendor's pending items](/api-reference/v2/merchant/endpoint/list-pending-payout-items) ## Next step [Create a payout](/api-reference/v2/merchant/endpoint/make-payout-payment) # Duplicate a product Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/duplicate-product openapi-merchant.json POST /products/{productId}/duplicate Copy a product, metafields included, into a new product for the same vendor. The copy goes straight to Shopify. # Generate a barcode Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/generate-barcode openapi-merchant.json POST /products/barcode Generate a new barcode value from your store's barcode settings, unique in your catalog. Nothing is saved. Returns 403 `FEATURE_DISABLED` when barcodes are turned off. # Get a payout adjustment Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/get-payout-adjustment openapi-merchant.json GET /payouts/adjustments/{id} Retrieve a single payout adjustment by ObjectId. ## Purpose Get one payout adjustment by id. ## When to use To check an adjustment's amount and status (`UNPAID` or `PAID`). Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 404 | `NOT_FOUND` | The resource does not exist in your store. | Check the id. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [List payout adjustments](/api-reference/v2/merchant/endpoint/list-payout-adjustments) ## Next step [Update a payout adjustment](/api-reference/v2/merchant/endpoint/update-payout-adjustment) # Get a payout Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/get-payout-run openapi-merchant.json GET /payouts/make-payment/{transactionId} Get the current status of a payout and its per-vendor batches by `transactionId`. Poll every 2–5 seconds until `status` is `completed` or `failed`. Manual payouts usually finish within a few seconds. The payout includes `payoutMethod` (for example `other`) and `comment`. `batches[].markAsPaid` has `marked` only. Batch `status` is one of `pending`, `paid`, `failed`, `cancelled`. ## Purpose Get the status of a payout and its batches. ## When to use Poll every 2–5 seconds after Create a payout, Retry or Mark as paid, until `status` is `completed` or `failed`. The payout has `payoutMethod` (for example `other`) and `comment`. `batches[].markAsPaid` has `marked` only. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 404 | `NOT_FOUND` | The resource does not exist in your store. | Check the id. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [Create a payout](/api-reference/v2/merchant/endpoint/make-payout-payment) ## Next step [List payout transactions](/api-reference/v2/merchant/endpoint/list-payout-transactions) # Get a product Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/get-product openapi-merchant.json GET /products/{productId} Get any product in your store, with its variants and Shopify category. # Get product counts Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/get-product-counts openapi-merchant.json GET /products/counts Count products by status for your whole store, or for one vendor with `?vendorId=`. # Get a single user Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/get-user openapi-merchant.json GET /users/{userId} Retrieve a user by ObjectId. **Merchant scope only**. # Get a single vendor Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/get-vendor openapi-merchant.json GET /vendors/{vendorId} Retrieve a vendor by ObjectId. **Merchant scope only**. # Get vendor address Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/get-vendor-address openapi-merchant.json GET /vendors/{vendorId}/address Get vendor address fields. **Merchant scope only**. # Get vendor profile Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/get-vendor-profile openapi-merchant.json GET /vendors/{vendorId}/profile Get vendor profile fields (company name, contact info, etc.). **Merchant scope only**. # List payout adjustments Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/list-payout-adjustments openapi-merchant.json GET /payouts/adjustments Retrieve a paginated list of payout adjustments for the shop. This list uses page-based pagination (`page`, `limit`, max 100) and returns `{items, total, page, limit}`. The other payouts lists use cursors (`first`/`after`). ## Purpose List payout adjustments in your store. ## When to use To find adjustments by vendor, status or date. Uses page-based pagination (`page`, `limit`). Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) ## Next step [Get a payout adjustment](/api-reference/v2/merchant/endpoint/get-payout-adjustment) # List payout methods Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/list-payout-methods openapi-merchant.json GET /payouts/methods List your vendors with the payout methods each one can currently be paid with (Stripe, PayPal, Global Payouts, or manual). A method is available only when the vendor is set up for it and the shop has it enabled and connected. ## Purpose See which payout methods each vendor can be paid with. ## When to use Before you pick a `method` for a payout. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 404 | `NOT_FOUND` | The resource does not exist in your store. | Check the id. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) ## Next step [List pending payouts](/api-reference/v2/merchant/endpoint/list-pending-payouts) # List payout transactions Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/list-payout-transactions openapi-merchant.json GET /payouts/transactions List past payout runs with their per-vendor batches, for the whole shop or a single vendor. Each payout includes `payoutMethod` (for example `other`) and `comment`. `batches[].markAsPaid` has `marked` only. ## Purpose List past payouts with their batches. ## When to use To show payout history or reconcile. Your payout appears here once it completes. Each payout has `payoutMethod` (for example `other`) and `comment`. `batches[].markAsPaid` has `marked` only. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [Get a payout](/api-reference/v2/merchant/endpoint/get-payout-run) ## Next step [Retry a payout batch (if a batch failed)](/api-reference/v2/merchant/endpoint/retry-payout-batch) # List a vendor's pending items Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/list-pending-payout-items openapi-merchant.json GET /payouts/pending/items/{vendorId} List the unpaid line items and adjustments that make up one vendor's pending payout. ## Purpose List the unpaid line items and adjustments for one vendor. ## When to use To get the `lineItemIds` and `adjustmentIds` you will pay. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 404 | `NOT_FOUND` | The resource does not exist in your store. | Check the id. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [List pending payouts](/api-reference/v2/merchant/endpoint/list-pending-payouts) ## Next step [Preview a payout](/api-reference/v2/merchant/endpoint/dry-run-payout) # List pending payouts Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/list-pending-payouts openapi-merchant.json GET /payouts/pending List each vendor's unpaid payout total for a date window. ## Purpose See each vendor's unpaid total for a date range. ## When to use To decide which vendors to pay. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [Create a payout adjustment](/api-reference/v2/merchant/endpoint/create-payout-adjustment) ## Next step [List a vendor's pending items](/api-reference/v2/merchant/endpoint/list-pending-payout-items) # List products Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/list-products openapi-merchant.json GET /products List every vendor's products in your store, or one vendor's with `?vendorId=`. Supports the same filters, sorting and cursor pagination as the vendor API. # List users (vendor-scoped) Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/list-users openapi-merchant.json GET /users When authenticated with a **vendor** JWT, lists users belonging to that vendor. Merchant tokens use the merchant admin list endpoint on the same path. # List vendors with pagination Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/list-vendors openapi-merchant.json GET /vendors Retrieve a paginated list of vendors. **Merchant scope only** - vendor tokens cannot access this endpoint. # Create a payout Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/make-payout-payment openapi-merchant.json POST /payouts/make-payment Pay a selection of line items and adjustments for one or more vendors (up to 50), one batch per vendor using a single payout method. Runs asynchronously: returns a `transactionId` to poll. Send a unique `Idempotency-Key` so a retry does not pay twice. Not available while Automated Payouts is on: returns 409 `AUTOMATED_PAYOUTS_ACTIVE`. Idempotency: send an `Idempotency-Key` header. Same key and the same body while the run is still processing: 409 `IDEMPOTENCY_IN_PROGRESS`. Same key and the same body after the run finishes: 200 with `replay: true` and the current `status`. `status` moves from `processing` to `completed` once the background job finishes, usually 30 to 60 seconds after the first call. The replay has the same `transactionId`, `dryRun`, `vendors` and `totalPayout` as the first response, and nothing is paid twice. Read `status` from the response you get. For the latest status, call GET /payouts/make-payment/{transactionId}. Same key and a different body: 422 `IDEMPOTENCY_KEY_REUSED`. `method: "manual"` only records a payout you settle yourself; no money moves through PuppetVendors. `manualMethod` (`bankTransfer`, `paypal`, `cash`, `other`) is required with it. A manual payout's `payoutMethod` is `other`. Your `comment` is returned on the payout. Read both from GET /payouts/make-payment/{transactionId} and GET /payouts/transactions. `batches[].markAsPaid` has `marked` only. ## Purpose Pay line items and adjustments to one or more vendors. ## When to use After a successful preview. The payout runs in the background. You get a `transactionId` to poll. Send one `Idempotency-Key` per payout. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. Same key and the same body: * Still processing: `409 IDEMPOTENCY_IN_PROGRESS`. Poll `details.transactionId`. * After the run finishes: `200` with `replay: true` and the current `status`. `status` moves from `processing` to `completed` once the background job finishes, usually 30 to 60 seconds after the first call. `transactionId`, `dryRun`, `vendors` and `totalPayout` match the first response. Nothing is paid twice. Same key and a different body: `422 IDEMPOTENCY_KEY_REUSED`. Use a new key. Read `status` from the response you get. Retry code must accept either `202` or `200` and read `status` from the body. For the latest status, call [Get a payout](/api-reference/v2/merchant/endpoint/get-payout-run) (`GET /payouts/make-payment/{id}`). ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. A finished replay is `200`. The body has these fields: | Field | Meaning | | - | - | | `requestId` | Request ID; quote it to support. | | `status` | The current status. Usually `completed` by the time this `200` is returned. | | `replay` | `true` | | `transactionId` | Same as the first response. | | `dryRun` | Same as the first response. | | `vendors` | Same as the first response. | | `totalPayout` | Same as the first response. | ```json theme={null} { "success": true, "data": { "requestId": "6adc216010794278e53fed32", "status": "completed", "replay": true, "transactionId": "YSR66PQUCL", "dryRun": false, "vendors": [ { "vendorId": "6a956f90bffa472b6babe773", "vendorName": "Example Vendor", "totalAmount": 0.5, "totalLineItemsCount": 1, "issue": null } ], "totalPayout": 0.5 } } ``` ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | `Idempotency-Key` header missing or not 8–128 characters. | Send a unique key, e.g. a UUID. | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 404 | `NOT_FOUND` | A vendor is not in your store. | Remove that vendor. | | 409 | `AUTOMATED_PAYOUTS_ACTIVE` | Your store pays vendors automatically. | Settings > Payouts > Automated Payouts > **Disable Automated Payouts**. Nothing was started. | | 409 | `IDEMPOTENCY_IN_PROGRESS` | A request with this key is still processing. | Poll `details.transactionId` instead of resending. | | 409 | `PAYOUT_ITEMS_LOCKED` | Another payout is paying some of these items now. | Wait for it, then check what is still unpaid. | | 422 | `IDEMPOTENCY_KEY_REUSED` | This key was used with a different body. | Use a new key for a new request. | | 422 | `ADJUSTMENTS_NOT_PAYABLE` | Some adjustments are not this vendor's, not unpaid, or excluded. `details` lists them. | Remove those ids, or check them with List pending items. | | 422 | `VENDOR_NOT_READY_FOR_METHOD` | A vendor is not set up for this method. `details.vendorIds` lists them. | Pick a method from List payout methods. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [Preview a payout](/api-reference/v2/merchant/endpoint/dry-run-payout) ## Next step [Get a payout](/api-reference/v2/merchant/endpoint/get-payout-run) # Mark a payout batch as paid Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/mark-payout-batch-paid openapi-merchant.json POST /payouts/batches/{batchId}/mark-paid Mark a payout batch as paid when it was settled outside PuppetVendors. Runs asynchronously. Not available while Automated Payouts is on: returns 409 `AUTOMATED_PAYOUTS_ACTIVE`. Idempotency: send an `Idempotency-Key` header. Same key and the same body while the first request is still processing: 409 `IDEMPOTENCY_IN_PROGRESS`. Same key and a different body: 422 `IDEMPOTENCY_KEY_REUSED`. ## Purpose Record a batch as paid when you paid the vendor outside PuppetVendors. ## When to use When a batch failed and you settled it another way, for example by bank transfer. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | `Idempotency-Key` header missing or not 8–128 characters. | Send a unique key, e.g. a UUID. | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 404 | `NOT_FOUND` | The resource does not exist in your store. | Check the id. | | 409 | `AUTOMATED_PAYOUTS_ACTIVE` | Your store pays vendors automatically. | Settings > Payouts > Automated Payouts > **Disable Automated Payouts**. Nothing was started. | | 409 | `IDEMPOTENCY_IN_PROGRESS` | A request with this key is still processing. | Poll `details.transactionId` instead of resending. | | 422 | `IDEMPOTENCY_KEY_REUSED` | This key was used with a different body. | Use a new key for a new request. | | 422 | see `error.code` | The batch is not in a state that allows this (for example it is already paid). | Get the payout to see the batch status. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [List payout transactions](/api-reference/v2/merchant/endpoint/list-payout-transactions) ## Next step [Get a payout (poll the update)](/api-reference/v2/merchant/endpoint/get-payout-run) # Refresh API token Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/refresh-token openapi-merchant.json POST /refresh-token Exchange a valid (non-expired) token for a new one with extended expiry. Use this to maintain sessions without requiring re-authentication. **Token input**: - Header: `x-access-token: ` # Reject products Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/reject-products openapi-merchant.json POST /products/reject Reject up to 100 pending products in one call. A new product is marked rejected; a pending edit to a live product is undone, restoring the product as it is on Shopify. Fields Shopify doesn't store, such as cost of item, keep the vendor's values. The vendor isn't emailed. # Retry a payout batch Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/retry-payout-batch openapi-merchant.json POST /payouts/batches/{batchId}/retry Retry a payout batch that was rejected. Runs asynchronously; poll the transaction for the result. Not available while Automated Payouts is on: returns 409 `AUTOMATED_PAYOUTS_ACTIVE`. Idempotency: send an `Idempotency-Key` header. Same key and the same body while the first request is still processing: 409 `IDEMPOTENCY_IN_PROGRESS`. Same key and a different body: 422 `IDEMPOTENCY_KEY_REUSED`. ## Purpose Retry a failed payout batch. ## When to use When Get a payout shows a batch with `status: failed` and `canRetry: true`. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | `Idempotency-Key` header missing or not 8–128 characters. | Send a unique key, e.g. a UUID. | | 404 | `NOT_FOUND` | The resource does not exist in your store. | Check the id. | | 409 | `AUTOMATED_PAYOUTS_ACTIVE` | Your store pays vendors automatically. | Settings > Payouts > Automated Payouts > **Disable Automated Payouts**. Nothing was started. | | 409 | `IDEMPOTENCY_IN_PROGRESS` | A request with this key is still processing. | Poll `details.transactionId` instead of resending. | | 422 | `IDEMPOTENCY_KEY_REUSED` | This key was used with a different body. | Use a new key for a new request. | | 422 | see `error.code` | The batch is not in a state that allows this (for example it is already paid). | Get the payout to see the batch status. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [List payout transactions](/api-reference/v2/merchant/endpoint/list-payout-transactions) ## Next step [Get a payout (poll the retry)](/api-reference/v2/merchant/endpoint/get-payout-run) # Update a payout adjustment Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/update-payout-adjustment openapi-merchant.json PATCH /payouts/adjustments/{id} Update a payout adjustment. `amount` and `type` must be changed together, because the stored sign is derived from both; the request schema enforces that pairing. Refused once the adjustment has been paid or deleted. ## Purpose Change an unpaid payout adjustment. ## When to use To correct the amount, type or comment before the adjustment is paid. Part of the [Pay vendors with the API](/api-reference/v2/merchant/guides/pay-vendors) flow. ## Request and response The parameters, request body, code examples (curl and other languages) and a full response example are shown below this section. They are generated from the OpenAPI spec. ## Errors Every error has the shape `{"success": false, "error": {"code", "message", "errorId", "details"}}`. Branch on `error.code`. | Status | Code | Meaning | Fix | | - | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter or body field is missing or invalid. `error.details` names the field. | Fix the field and resend. | | 404 | `NOT_FOUND` | The resource does not exist in your store. | Check the id. | | 409 | see `error.code` | The adjustment is already paid or deleted. | Create a new adjustment instead. | | 401 | `UNAUTHORIZED` | Token missing, invalid or expired. | Call POST /authenticate again and resend. | | 403 | `FORBIDDEN` | The token belongs to a vendor key. | Use a merchant API key (`mk_live_…`). | ## Previous step [Get a payout adjustment](/api-reference/v2/merchant/endpoint/get-payout-adjustment) ## Next step [List pending payouts](/api-reference/v2/merchant/endpoint/list-pending-payouts) # Update a product Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/update-product openapi-merchant.json PUT /products/{productId} Update any product in your store, straight to Shopify. Send `vendorId` to move the product to another vendor. Send the full set of metafields: any left out are deleted. A live product with a vendor edit waiting for review is refused with 409 `PRODUCT_PENDING_REVIEW`; approve or reject the edit first. # Update product inventory Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/update-product-inventory openapi-merchant.json PATCH /products/{productId}/inventory Set or adjust inventory per variant and location. Each variant succeeds or fails on its own: the call returns 200 and lists any failed variants in `data.errors`. # Update product status Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/update-product-status openapi-merchant.json PATCH /products/{productId}/status Publish (`ACTIVE`) or unpublish (`DRAFT`) a product on Shopify. A pending product that has never been on Shopify is refused with 409 `PRODUCT_PENDING_CREATE`; approve it first. # Update user (vendor-scoped) Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/update-user openapi-merchant.json PUT /users/{userId} Update an existing user. **Merchant scope only**. # Update a vendor Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/update-vendor openapi-merchant.json PUT /vendors/{vendorId} Update an existing vendor. **Merchant scope only**. # Update vendor address Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/update-vendor-address openapi-merchant.json PUT /vendors/{vendorId}/address Update vendor address fields. **Merchant scope only**. # Update vendor profile Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/update-vendor-profile openapi-merchant.json PUT /vendors/{vendorId}/profile Update vendor profile fields. **Merchant scope only**. # Upload product media Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/upload-product-media openapi-merchant.json POST /products/media Upload an image, video or 3D model to use in a later create or update. Send videos and 3D models as base64, external videos (such as YouTube) as a URL, and images either way. # Verify an API key reaches the service Source: https://dev.puppetvendors.com/api-reference/v2/merchant/endpoint/verify openapi-merchant.json POST /verify Pure probe — confirms the key is valid and reachable, returns the scopes/mode/identity it carries, but does NOT issue a JWT or count as a use (lastUsedAt unchanged). Same lookup as `/authenticate`, so any key that passes here will also pass `/authenticate`. Useful when an integration wants a side-effect-free "is my key good?" check without minting a token. Accepts the same keys `/authenticate` does: a merchant `mk_` key or a vendor `vk_` key. For a merchant key the reply carries `scope: merchant` and the key's label, and no `vendorId`. A revoked key is refused with the same 401 and the same message as a key that never existed, so this cannot be used to probe which keys once existed. A key inside its rotation grace window is still valid here. # Pay vendors with the API Source: https://dev.puppetvendors.com/api-reference/v2/merchant/guides/pay-vendors Pay vendors end to end: authenticate, add an adjustment, preview, pay, poll and check the result. ## Purpose This guide pays one vendor with the API, from start to finish. Each step is one request you can copy. ## Before you start * You need a merchant API key (`mk_live_…`). * Automated Payouts must be off. If it is on, payout requests return `409 AUTOMATED_PAYOUTS_ACTIVE`. Turn it off in Settings > Payouts > Automated Payouts > **Disable Automated Payouts**. * Set these shell variables: ```bash theme={null} export PV=https://production-api.puppetvendors.com export PV_API_KEY=mk_live_your_key export VENDOR_ID=your_vendor_id ``` ## Step 1. Authenticate ```bash theme={null} TOKEN=$(curl -s -X POST $PV/authenticate \ -H "Content-Type: application/json" \ -d "{\"apiKey\": \"$PV_API_KEY\"}" | jq -r .data.token) ``` Send the token in the `x-access-token` header on every request below. Reference: [Authenticate](/api-reference/v2/merchant/endpoint/authenticate). ## Step 2. Create a payout adjustment (optional) Skip this step if you only pay order line items. ```bash theme={null} curl -s -X POST $PV/payouts/adjustments \ -H "x-access-token: $TOKEN" -H "Content-Type: application/json" \ -d "{\"vendorId\": \"$VENDOR_ID\", \"amount\": 25.50, \"type\": \"ADDITION\", \"comments\": \"March bonus\"}" ``` Save `data._id` as `ADJ_ID`. Reference: [Create a payout adjustment](/api-reference/v2/merchant/endpoint/create-payout-adjustment). ## Step 3. List pending payouts ```bash theme={null} curl -s "$PV/payouts/pending?vendorId=$VENDOR_ID&startDate=2026-01-01&endDate=2026-12-31" \ -H "x-access-token: $TOKEN" ``` Each vendor shows its unpaid total. Reference: [List pending payouts](/api-reference/v2/merchant/endpoint/list-pending-payouts). ## Step 4. List the vendor's pending items ```bash theme={null} curl -s "$PV/payouts/pending/items/$VENDOR_ID?startDate=2026-01-01&endDate=2026-12-31" \ -H "x-access-token: $TOKEN" ``` Collect the `lineItemIds` and `adjustmentIds` to pay. Reference: [List a vendor's pending items](/api-reference/v2/merchant/endpoint/list-pending-payout-items). ## Step 5. Preview the payout ```bash theme={null} curl -s -X POST $PV/payouts/make-payment/dry-run \ -H "x-access-token: $TOKEN" -H "Content-Type: application/json" \ -d "{\"vendors\": [{\"vendorId\": \"$VENDOR_ID\", \"adjustmentIds\": [\"$ADJ_ID\"]}], \"method\": \"manual\", \"manualMethod\": \"other\", \"notifyVendor\": false}" ``` ```json 200 OK theme={null} { "success": true, "data": { "dryRun": true, "vendors": [ { "vendorId": "6a956f90bffa472b6babe773", "vendorName": "Acme Goods", "totalAmount": 25.5, "totalLineItemsCount": 1, "issue": null } ], "totalPayout": 25.5 } } ``` Fix any vendor with a non-null `issue` before you pay. Reference: [Preview a payout](/api-reference/v2/merchant/endpoint/dry-run-payout). ## Step 6. Create the payout Send the same body with a new `Idempotency-Key`. * Same key, same body, while the run is still processing: `409 IDEMPOTENCY_IN_PROGRESS`. Poll `details.transactionId`. * Same key, same body, after the run finishes: `200` with `replay: true` and the current `status`. `status` moves from `processing` to `completed` once the background job finishes, usually 30 to 60 seconds after the first call. `transactionId`, `dryRun`, `vendors` and `totalPayout` match the first response. Nothing is paid twice. * Same key, different body: `422 IDEMPOTENCY_KEY_REUSED`. Use a new key. Read `status` from the response you get. For the latest status, call `GET /payouts/make-payment/{id}`. ```bash theme={null} KEY=$(uuidgen) curl -s -X POST $PV/payouts/make-payment \ -H "x-access-token: $TOKEN" -H "Content-Type: application/json" \ -H "Idempotency-Key: $KEY" \ -d "{\"vendors\": [{\"vendorId\": \"$VENDOR_ID\", \"adjustmentIds\": [\"$ADJ_ID\"]}], \"method\": \"manual\", \"manualMethod\": \"other\", \"comment\": \"March payouts\", \"notifyVendor\": false}" ``` The first response is `202 Accepted` with `data.transactionId` and `status: "processing"`. Save `transactionId` as `TXN_ID`. A replay after the run finishes looks like this: ```json 200 OK theme={null} { "success": true, "data": { "requestId": "6adc216010794278e53fed32", "status": "completed", "replay": true, "transactionId": "YSR66PQUCL", "dryRun": false, "vendors": [ { "vendorId": "6a956f90bffa472b6babe773", "vendorName": "Acme Goods", "totalAmount": 25.5, "totalLineItemsCount": 1, "issue": null } ], "totalPayout": 25.5 } } ``` Reference: [Create a payout](/api-reference/v2/merchant/endpoint/make-payout-payment). ## Step 7. Poll the payout Poll every 2–5 seconds until `status` is `completed` or `failed`. ```bash theme={null} curl -s $PV/payouts/make-payment/$TXN_ID -H "x-access-token: $TOKEN" ``` ```json 200 OK theme={null} { "success": true, "data": { "transactionId": "YSR66PQUCL", "requestId": "6adc216010794278e53fed32", "operation": "make-payment", "batchId": null, "status": "completed", "payoutMethod": "other", "comment": "March payouts", "hadIssue": false, "batches": [ { "batchId": "FB2XIEVDP0", "vendorId": "6a956f90bffa472b6babe773", "vendorName": "Acme Goods", "amount": 25.5, "status": "paid", "reason": null, "gatewayRef": null, "markAsPaid": { "marked": true } } ], "canRetry": false } } ``` Reference: [Get a payout](/api-reference/v2/merchant/endpoint/get-payout-run). ## Step 8. Check the transaction list ```bash theme={null} curl -s "$PV/payouts/transactions?limit=10" -H "x-access-token: $TOKEN" ``` Your payout is listed once, with `payoutMethod`, `comment` and its batches. `markAsPaid` has `marked` only. ```json theme={null} { "transactionId": "YSR66PQUCL", "payoutMethod": "other", "comment": "March payouts", "batches": [ { "batchId": "FB2XIEVDP0", "status": "paid", "markAsPaid": { "marked": true } } ] } ``` Reference: [List payout transactions](/api-reference/v2/merchant/endpoint/list-payout-transactions). ## Step 9. If a batch failed If a batch has `status: "failed"`, do one of these: * Retry it: [Retry a payout batch](/api-reference/v2/merchant/endpoint/retry-payout-batch). * Or, if you paid the vendor another way, record it: [Mark a batch as paid](/api-reference/v2/merchant/endpoint/mark-payout-batch-paid). Both need an `Idempotency-Key` and return a `transactionId` you poll as in step 7. ## Status values | Object | Values | | - | - | | Payout `status` | `processing`, `completed`, `failed` | | Batch `status` | `pending`, `paid`, `failed`, `cancelled` | ## Next step [Create a payout](/api-reference/v2/merchant/endpoint/make-payout-payment) has every field and error in full. # V2 Merchant API Introduction Source: https://dev.puppetvendors.com/api-reference/v2/merchant/introduction Overview of the PuppetVendors V2 Merchant API (Alpha) > [!NOTE] > > **V2 Preview** — The V2 API is actively being developed. We aim for stability but breaking changes may occasionally occur. ## Overview The PuppetVendors V2 Merchant API gives merchants programmatic, shop-wide access to administer their marketplace — creating and managing vendors, managing every vendor's products, managing users, and adjusting vendor payouts. Unlike vendor keys (`vk_`), which are restricted to a single vendor's data, a merchant key (`mk_`) operates at the shop level across all vendors. **Base URL:** `https://production-api.puppetvendors.com` > [!NOTE] > > **For AI agents and tooling:** [OpenAPI 3.1 spec](https://production-api.puppetvendors.com/resources/openapi-merchant.json) ## Getting Started 1. **Get your merchant API key** — Create one in the PuppetVendors admin under **Settings → API Access** (prefixed `mk_live_` or `mk_test_`). The key is revealed once at creation, so store it securely. 2. **Authenticate** — Exchange your key for a JWT token via `POST /authenticate` 3. **Make requests** — Pass the token in the `x-access-token` header See the [Authentication guide](/api-reference/v2/merchant/authentication) for details. ## Merchant Resources > **[Vendors](/api-reference/v2/merchant/endpoint/list-vendors)** > > Create, update, and manage vendors, their profiles, and addresses > **[Users](/api-reference/v2/merchant/endpoint/list-users)** > > Manage vendor user accounts > **[Products](/api-reference/v2/merchant/endpoint/list-products)** > > Manage every vendor's products, and approve or reject pending ones > **[Payout Adjustments](/api-reference/v2/merchant/endpoint/list-payout-adjustments)** > > Add manual additions or deductions to vendor payouts > **[Authentication](/api-reference/v2/merchant/endpoint/authenticate)** > > Mint, verify, and refresh API tokens ## Scope of a Merchant Key A merchant key carries a read and a write permission for each resource. Each endpoint page names the permission it needs: | Permission | Endpoints | | - | - | | `admin:vendors:read`, `admin:vendors:write` | `/vendors` and the vendor profile and address endpoints | | `admin:users:read`, `admin:users:write` | `/users` endpoints | | `admin:payouts:read` | Reading payouts and payout adjustments | | `admin:payouts:write` | Creating, updating and deleting payout adjustments | | `admin:products:read`, `admin:products:write` | `/products` endpoints | Merchant keys use the same `/products` paths as the vendor API and see every vendor's products. Add `?vendorId=` to narrow a request to one vendor. Orders, customers, fulfillments and documents stay on the V1 API token and are refused with HTTP 403 when called with a merchant token. ## Key Lifecycle * **Created** in **Settings → API Access**; each key is named per integration and independently rotatable and revocable * **Revealed once** — the full key is shown only at creation * **Rotation is an overlap, not a cutover** — a rotated key keeps working for a 24-hour grace window while you roll out the new one * **Revoking** a key refuses the next request made with any token minted from it ## Rate Limits The API is rate-limited to **100 requests per minute per IP address**. The limit is per IP, not per API key — if your integration runs in a shared environment (Lambda, Vercel, CI), all consumers on that IP share the 100/min budget. The API returns standard `RateLimit-*` headers on every response. On HTTP 429, implement exponential backoff before retrying. ## Need Help? Contact [support@puppetvendors.com](mailto:support@puppetvendors.com) for API access or questions. # API Keys & Scopes Source: https://dev.puppetvendors.com/api-reference/v2/vendor/api-keys-scopes Create vendor API keys and understand permission scopes ## Overview Vendor API keys let you authenticate with the PuppetVendors API programmatically. Each key is scoped to a single vendor account and can be restricted to specific permissions. ## Key Prefixes | Prefix | Mode | Description | | - | - | - | | `vk_live` | Live | Full access to real data | | `vk_test` | Test | For development and testing | ## Available Scopes Every API key must have at least one scope. Each scope grants access to a specific set of endpoints. | Scope | Access | Endpoints | | - | - | - | | `orders:read` | Read orders, counts, timeline | `GET /orders`, `GET /orders/:id`, `GET /orders/counts`, `GET /orders/:id/timeline` | | `orders:write` | Add order timeline comments | `POST /orders/:id/timeline` | | `products:read` | Read products, counts | `GET /products`, `GET /products/:id`, `GET /products/counts` | | `products:write` | Create, update, delete products, manage inventory and media | `POST /products`, `PUT /products/:id`, `DELETE /products/:id`, `PATCH /products/:id/status`, `PATCH /products/:id/inventory`, `POST /products/media` | | `fulfillments:read` | Read fulfillments, counts, stats, events | `GET /fulfillments`, `GET /fulfillments/counts`, `GET /fulfillments/stats`, `GET /fulfillments/events/:lineItemId` | | `fulfillments:write` | Create and update fulfillments, manage events | `POST /fulfillments`, `PUT /fulfillments/:id`, `POST /fulfillments/events/:lineItemId`, `POST /fulfillments/events/bulk` | | `payouts:read` | Read payouts, transactions, pending items, summaries | `GET /payouts`, `GET /payouts/:id`, `GET /payouts/summary`, `GET /payouts/transactions`, `GET /payouts/pending` | | `customers:read` | Read customer list | `GET /customers` | ## Unscoped Endpoints These endpoints work with **any valid vendor token** — no specific scope required on your API key: | Group | Endpoints | | - | - | | **Discounts** | List, create, update, delete discounts | | **Profile** | `GET/PUT /vendors/me/profile`, `GET/PUT /vendors/me/address` | | **Settings** | Account, profile settings, shipping rates, warehouses, team members | | **Integrations** | Shippo, ShipStation, PayPal, Stripe configuration | | **Documents** | Invoice, packing slip, shipping label generation | | **Shop** | Feature flags and product configuration | ## How Scopes Work When you create an API key, you choose which scopes to include. The API rejects requests that require a scope your key doesn't have with `403 Forbidden`. ### Read vs Write * **`:read` scopes** grant access to `GET` endpoints — listing, viewing, and exporting data * **`:write` scopes** grant access to `POST`, `PUT`, `PATCH`, and `DELETE` endpoints — creating, updating, and deleting data > [!WARNING] > > Write scopes do **not** automatically include read access. If you need both, add both scopes (e.g., `products:read` and `products:write`). ## Managing API Keys | Action | Endpoint | Description | | - | - | - | | List keys | `GET /settings/public-api/keys` | See all your API keys (tokens are masked) | | Create key | `POST /settings/public-api/keys` | Create a new key — **token shown once** | | Rotate key | `POST /settings/public-api/keys/:keyId/rotate` | Generate a new token, old one is invalidated | | Delete key | `DELETE /settings/public-api/keys/:keyId` | Permanently revoke a key | > [!WARNING] > > When you create or rotate a key, the plaintext token is returned **exactly once**. Store it securely — you cannot retrieve it later. ## Quick Start Example ```bash theme={null} # 1. Authenticate with your vendor API key curl -X POST https://production-api.puppetvendors.com/authenticate \ -H "Content-Type: application/json" \ -d '{"apiKey": "vk_live_abc123..."}' # Response: {"success": true, "data": {"token": "eyJ...", "expiresIn": 86400}} # 2. Use the JWT token for subsequent requests curl -X GET "https://production-api.puppetvendors.com/orders?first=10" \ -H "x-access-token: eyJ..." ``` # Vendor Authentication Source: https://dev.puppetvendors.com/api-reference/v2/vendor/authentication Authenticate with the PuppetVendors V2 API using a vendor API key > [!NOTE] > > **V2 Preview** — This authentication flow is part of the V2 API preview. Breaking changes may occur. ## Overview All V2 Vendor API endpoints require a JWT token passed via the `x-access-token` header. There are two ways to get a token: | Method | Best For | Endpoint | | - | - | - | | **API Key** | Integrations, scripts, AI agents | `POST /authenticate` | | **Portal Login** | Custom vendor portals, mobile apps | `POST /portal/auth/login` | ## Method 1: API Key Authentication (Recommended) Use this for programmatic access. Your vendor API key starts with `vk_`. ```bash cURL theme={null} curl -X POST https://production-api.puppetvendors.com/authenticate \ -H "Content-Type: application/json" \ -d '{ "apiKey": "vk_live_YOUR_VENDOR_API_KEY" }' ``` ```python Python theme={null} import requests resp = requests.post( "https://production-api.puppetvendors.com/authenticate", json={"apiKey": "vk_live_YOUR_VENDOR_API_KEY"} ) token = resp.json()["data"]["token"] ``` ```javascript JavaScript theme={null} const resp = await fetch("https://production-api.puppetvendors.com/authenticate", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ apiKey: "vk_live_YOUR_VENDOR_API_KEY" }) }); const { data } = await resp.json(); const token = data.token; ``` ```json 200 theme={null} { "success": true, "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expiresIn": 86400, "scope": "vendor", "permissions": ["orders:read", "products:read", "products:write"], "shopDomain": "my-store.myshopify.com", "mode": "live", "vendorId": "507f1f77bcf86cd799439012" } } ``` * `scope` is always `"vendor"` for vendor tokens — it's the token type * `permissions` lists the specific scopes granted to your API key (e.g., `orders:read`, `products:write`) ### Getting a Vendor API Key You can create API keys in the vendor portal under **Settings > API Keys**, or your merchant can provide one. See [API Keys & Scopes](/api-reference/v2/vendor/api-keys-scopes) for details on key permissions. ## Method 2: Portal Login Use this if you're building a custom login experience for vendors. ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/portal/auth/login \ -H "Content-Type: application/json" \ -d '{ "email": "vendor@example.com", "password": "your-password", "shopDomain": "my-store.myshopify.com" }' ``` > [!NOTE] > > Portal login is rate limited to **5 attempts per 15 minutes** per IP address. ## Using the Token Include the token in all subsequent requests via the `x-access-token` header: ```bash cURL theme={null} curl -X GET "https://production-api.puppetvendors.com/orders?first=10" \ -H "x-access-token: YOUR_JWT_TOKEN" ``` ```python Python theme={null} resp = requests.get( "https://production-api.puppetvendors.com/orders", params={"first": 10}, headers={"x-access-token": token} ) orders = resp.json()["data"]["items"] ``` ```javascript JavaScript theme={null} const resp = await fetch("https://production-api.puppetvendors.com/orders?first=10", { headers: { "x-access-token": token } }); const { data } = await resp.json(); ``` ## Token Expiry & Refresh Tokens expire after **24 hours** (86400 seconds). Use `POST /refresh-token` with a valid (non-expired) token to get a new one without re-authenticating: ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/refresh-token \ -H "x-access-token: YOUR_CURRENT_TOKEN" ``` ## Scope Behaviour Vendor-scoped tokens automatically filter all data to your vendor account. For example, calling `GET /orders` will only return orders containing your line items. Attempting to access another vendor's data returns HTTP 403. ## API Key Scopes API keys can be restricted to specific permissions. See the full [API Keys & Scopes reference](/api-reference/v2/vendor/api-keys-scopes) for a complete list of available scopes and what each one grants access to. # Add Order Timeline Note Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/add-order-timeline POST /orders/{orderId}/timeline Add a note to an order's timeline > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Add a note to the timeline of a specific order. This creates a timestamped entry visible to both the vendor and the merchant. ### Use Cases * **Internal notes** — Record shipping updates, special handling instructions, or delays * **Communication trail** — Leave a message for the merchant about the order * **Status updates** — Document progress on custom or made-to-order items ## Headers **x-access-token** `string` *required* A valid vendor JWT. Requires `orders:write` scope. ## Path Parameters **orderId** `string` *required* The `_id` of the order. ## Request Body **message** `string` *required* The note text to add to the timeline. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "664a1b2c3d4e5f6a7b8c9d10", "message": "Customer requested gift wrapping — added to package", "type": "note", "createdBy": "vendor@example.com", "createdAt": "2026-05-17T09:15:00Z" } } ``` ### Error Responses ```json 400 theme={null} { "success": false, "error": { "message": "\"message\" is required", "code": "VALIDATION_ERROR" } } ``` ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ```json 404 theme={null} { "success": false, "error": { "message": "Order not found", "code": "NOT_FOUND" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/orders/507f1f77bcf86cd799439011/timeline" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -d '{ "message": "Customer requested gift wrapping — added to package" }' ``` # AI Product Description Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/ai-description POST /products/ai/description Generate a product description using AI based on product details > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Generate an HTML product description using AI. Provide the product title and optional context (product type, tags, features, image context) to get a ready-to-use description. The merchant can also configure a custom prompt that shapes the AI output to match their brand voice. Usage is subject to the shop's AI allowance limit. If the limit is reached, you will receive a 429 response. ### Use Cases * Auto-generate descriptions for new products instead of writing from scratch * Improve or rewrite existing descriptions with richer detail * Create consistent, on-brand copy across your catalog ### Required Scope `products:write` ## Request Body **title** `string` *required* The product title. This is the primary input the AI uses to generate the description. **productType** `string` The product type or category (e.g. "T-Shirts", "Electronics"). Helps the AI tailor the description. **tags** `string[]` An array of product tags (e.g. `["organic", "cotton", "summer"]`). Provides additional context for the AI. **features** `string[]` An array of key product features (e.g. `["100% organic cotton", "Pre-shrunk", "Machine washable"]`). These are highlighted in the generated description. **imageContext** `string` A text description of the product's main image. Useful when the AI cannot see the image directly. **merchantCustomPrompt** `string` A custom instruction from the merchant that shapes the AI output (e.g. "Write in a casual, friendly tone" or "Always mention our 30-day return policy"). This is configured at the shop level and passed through automatically by the portal. ## Response ```json 200 theme={null} { "success": true, "data": { "description": "

Elevate your everyday wardrobe with our Organic Cotton Tee. Crafted from 100% certified organic cotton, this pre-shrunk tee offers a soft, breathable fit that lasts wash after wash.

  • 100% organic cotton
  • Pre-shrunk for a consistent fit
  • Machine washable

Perfect for layering or wearing on its own during the warmer months.

" } } ``` ```json 429 theme={null} { "success": false, "error": { "message": "AI usage limit reached. Please try again later.", "code": "ALLOWANCE_EXCEEDED" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/products/ai/description" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "title": "Organic Cotton Tee", "productType": "T-Shirts", "tags": ["organic", "cotton", "summer"], "features": ["100% organic cotton", "Pre-shrunk", "Machine washable"], "imageContext": "A white t-shirt on a wooden hanger against a neutral background" }' ``` ### More Examples **With features and merchant prompt** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/products/ai/description" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "title": "Organic Cotton Hoodie", "productType": "Apparel", "tags": ["organic", "sustainable"], "features": ["100% organic cotton", "Relaxed fit", "Kangaroo pocket"], "merchantCustomPrompt": "Write in a casual, friendly tone. Emphasize sustainability." }' ``` # Bulk Create Fulfillment Events Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/bulk-create-fulfillment-events POST /fulfillments/events/bulk Create multiple fulfillment events in a single request (max 100) > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Create multiple fulfillment events in a single request. Maximum **100 events per request**. Each event is processed independently — partial success is reported in the response. ## Request Body **events** `array` *required* Array of `{ lineItemId, status, happenedAt?, city?, province?, country?, zip?, message? }`. ## Response ```json 200 theme={null} { "success": true, "data": { "successCount": 98, "failedCount": 2, "results": [ { "lineItemId": "507f1f77bcf86cd799439015", "success": true }, { "lineItemId": "507f1f77bcf86cd799439016", "success": false, "message": "Line item not found" } ] } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/fulfillments/events/bulk" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "events": [ { "lineItemId": "507f1f77bcf86cd799439015", "status": "in_transit" }, { "lineItemId": "507f1f77bcf86cd799439016", "status": "delivered" } ] }' ``` ### More Examples **Track multiple items at once** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/fulfillments/events/bulk" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "events": [ { "lineItemId": "665a1b2c3d4e5f6a7b8c9d0e", "status": "in_transit", "message": "Package picked up by carrier", "location": "Los Angeles, CA" }, { "lineItemId": "665a1b2c3d4e5f6a7b8c9d0f", "status": "delivered", "message": "Left at front door", "location": "San Francisco, CA", "occurredAt": "2026-05-19T14:30:00Z" } ] }' ``` # Create Fulfillment Event Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/create-fulfillment-event POST /fulfillments/events/{lineItemId} Create a tracking event for a line item's fulfillment > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Create a tracking event for a line item's fulfillment. Vendor tokens can only add events to their own line items. The line item must already be fulfilled. ## Path Parameters **lineItemId** `string` *required* Line item ObjectId. ## Request Body **status** `string` *required* One of `in_transit`, `out_for_delivery`, `delivered`, `failed_delivery`. **happenedAt** `string` ISO 8601 timestamp; defaults to now. **city** `string` **province** `string` **country** `string` **zip** `string` **message** `string` ## Response ```json 201 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439020", "lineItemId": "507f1f77bcf86cd799439015", "status": "in_transit", "happenedAt": "2026-04-15T08:30:00Z" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/fulfillments/events/507f1f77bcf86cd799439015" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "status": "in_transit", "city": "Austin", "province": "TX", "country": "US", "message": "Package scanned at origin facility" }' ``` ### More Examples **Mark as delivered with timestamp** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/fulfillments/events/507f1f77bcf86cd799439015" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "status": "delivered", "message": "Signed by J. Smith", "occurredAt": "2026-05-19T10:15:00Z", "location": "New York, NY" }' ``` # Create Shipping Dimension Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/create-shipping-dimension POST /shipping/dimensions Create a new shipping dimension preset > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Create a new shipping dimension preset. Presets can be generic (reusable) or product-specific. These are used to pre-fill package dimensions when fetching shipping rates. ### Use Cases * Save commonly used box sizes for quick rate lookups * Define product-specific packaging dimensions * Standardize packaging across the vendor's catalogue ## Request Body **type** `string` *required* Dimension type. Must be `generic` or `productSpecific`. **productId** `string` Shopify product ID. Required when `type` is `productSpecific`. **title** `string` A human-readable name for the preset (e.g. "Small Box"). **dimensionUnit** `string` *required* Unit of measurement. Must be one of: `in`, `cm`, `mm`, `ft`, `m`, `yd`. **heightValue** `number` *required* Package height. Minimum 0. **widthValue** `number` *required* Package width. Minimum 0. **lengthValue** `number` *required* Package length. Minimum 0. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "665a1b2e3d98f0001a2b3c52", "type": "generic", "title": "Medium Box", "dimensionUnit": "in", "heightValue": 8, "widthValue": 10, "lengthValue": 12 } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/shipping/dimensions" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "type": "generic", "title": "Medium Box", "dimensionUnit": "in", "heightValue": 8, "widthValue": 10, "lengthValue": 12 }' ``` # Create Team Member Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/create-team-member POST /settings/team Invite a new team member to the vendor account > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Create a new team member for the vendor account. The team member receives login credentials and can be assigned specific API permissions. ### Use Cases * Invite warehouse staff with fulfillment-only permissions * Add a bookkeeper with read-only access to orders and payouts * Onboard new team members with scoped access ## Request Body **email** `string` *required* Email address for the team member. Must be a valid email format. **password** `string` *required* Initial password. Minimum 6 characters, maximum 100 characters. **profile** `object` Profile information. **profile.firstName** `string` First name. Maximum 100 characters. **profile.lastName** `string` Last name. Maximum 100 characters. **profile.phone** `string` Phone number. Maximum 50 characters. **apiPermissions** `string[]` Array of permission strings to grant the team member. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "665a1b2e3d98f0001a2b3c81", "email": "bob@example.com", "profile": { "firstName": "Bob", "lastName": "Smith", "phone": "+15125559876" }, "apiPermissions": [ "orders:read", "fulfillments:write" ], "createdAt": "2026-05-19T12:00:00.000Z" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/settings/team" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "email": "bob@example.com", "password": "secureP@ss123", "profile": { "firstName": "Bob", "lastName": "Smith", "phone": "+15125559876" }, "apiPermissions": ["orders:read", "fulfillments:write"] }' ``` ### More Examples **Create team member with limited permissions** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/settings/team" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -d '{ "email": "assistant@acmeco.com", "password": "temp-pass-123", "profile": { "firstName": "Alex", "lastName": "Johnson" }, "apiPermissions": ["orders:read", "products:read", "fulfillments:read"] }' ``` # Add Warehouse Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/create-warehouse POST /settings/shipping/warehouses Add a new warehouse / location to the vendor > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Add a new warehouse / location. The server assigns a new numeric `locationId` (one greater than the current max on this vendor). Vendor scope required. ## Request Body **name** `string` *required* Warehouse name (max 200 chars). **address1** `string` Street address line 1 (max 500 chars). **address2** `string` Street address line 2 (max 500 chars). **city** `string` City (max 200 chars). **province** `string` State / province (max 200 chars). **zip** `string` Postal code (max 50 chars). **country** `string` Country (max 200 chars). ## Response ```json 200 theme={null} { "success": true, "data": { "locationId": 2, "name": "Main Warehouse", "address1": "123 Main St", "city": "Austin", "province": "TX", "zip": "78701", "country": "US" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/settings/shipping/warehouses" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "name": "Main Warehouse", "address1": "123 Main St", "city": "Austin", "province": "TX", "zip": "78701", "country": "US" }' ``` ### More Examples **Create a US warehouse** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/settings/shipping/warehouses" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -d '{ "name": "East Coast Warehouse", "address1": "456 Industrial Blvd", "address2": "Unit 7B", "city": "Newark", "province": "NJ", "zip": "07102", "country": "US", "phone": "+1-555-0123", "email": "warehouse@acmeco.com", "defaultShippingAddress": true }' ``` # Delete PayPal Configuration Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/delete-paypal DELETE /integrations/paypal Remove the vendor's PayPal email > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Remove the vendor's PayPal email used for payouts. Vendor scope required. ## Response ```json 200 theme={null} { "success": true, "data": { "deleted": true } } ``` ## Example ```bash theme={null} curl -X DELETE "https://production-api.puppetvendors.com/integrations/paypal" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Delete Product Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/delete-product DELETE /products/{productId} Delete a product from Shopify and soft-delete locally > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Delete a product from Shopify and soft-delete it in the local database. Accepts a Shopify numeric ID, Shopify GID, or MongoDB ObjectId. Vendor tokens can only delete their own products. ## Path Parameters **productId** `string` *required* Product ID (Shopify numeric, GID, or MongoDB ObjectId). ## Response ```json 200 theme={null} { "success": true, "data": { "deleted": true } } ``` ## Example ```bash theme={null} curl -X DELETE "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Delete Shipping Dimension Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/delete-shipping-dimension DELETE /shipping/dimensions/{shippingDimensionsId} Delete a shipping dimension preset > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Delete a shipping dimension preset. This action is permanent and cannot be undone. ### Use Cases * Remove outdated packaging presets * Clean up product-specific dimensions after discontinuing a product ## Path Parameters **shippingDimensionsId** `string` *required* The ID of the shipping dimension preset to delete. ## Response ```json 200 theme={null} { "success": true } ``` ## Example ```bash theme={null} curl -X DELETE "https://production-api.puppetvendors.com/shipping/dimensions/665a1b2e3d98f0001a2b3c52" \ -H "x-access-token: YOUR_VENDOR_TOKEN" ``` # Delete Shippo Configuration Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/delete-shippo DELETE /integrations/shippo Remove the vendor's Shippo API key > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Remove the vendor's Shippo API key. Vendor scope required. After deletion, realtime rate calculation falls back to whatever other carrier integration (ShipStation) is configured, or to manual shipping rates. ## Response ```json 200 theme={null} { "success": true, "data": { "deleted": true } } ``` ## Example ```bash theme={null} curl -X DELETE "https://production-api.puppetvendors.com/integrations/shippo" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Delete ShipStation Configuration Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/delete-shipstation DELETE /integrations/shipstation Remove the vendor's ShipStation API credentials > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Remove the vendor's ShipStation API credentials. Vendor scope required. ## Response ```json 200 theme={null} { "success": true, "data": { "deleted": true } } ``` ## Example ```bash theme={null} curl -X DELETE "https://production-api.puppetvendors.com/integrations/shipstation" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Disconnect Stripe Account Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/delete-stripe DELETE /integrations/stripe Disconnect and delete the vendor's Stripe Connect account > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Disconnect and delete the vendor's Stripe Connect account. This removes the account from Stripe and clears the vendor's profile. Vendor scope required. > [!WARNING] > > Once disconnected, pending payouts that rely on the Stripe account will fail until a new Stripe Connect onboarding is completed. ## Response ```json 200 theme={null} { "success": true, "data": { "deleted": true } } ``` ## Example ```bash theme={null} curl -X DELETE "https://production-api.puppetvendors.com/integrations/stripe" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Delete Team Member Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/delete-team-member DELETE /settings/team/{userId} Remove a team member from the vendor account > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Remove a team member from the vendor account. The team member immediately loses access. This action cannot be undone. ### Use Cases * Off-board departing team members * Revoke access for inactive users * Remove accidentally created accounts ## Path Parameters **userId** `string` *required* The team member's user ID. ## Response ```json 200 theme={null} { "success": true } ``` ## Example ```bash theme={null} curl -X DELETE "https://production-api.puppetvendors.com/settings/team/665a1b2e3d98f0001a2b3c81" \ -H "x-access-token: YOUR_VENDOR_TOKEN" ``` # Delete Warehouse Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/delete-warehouse DELETE /settings/shipping/warehouses/{index} Remove a warehouse at the given index > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Remove a warehouse / location at the given zero-based index. Returns the remaining warehouses after deletion. Vendor scope required. ## Path Parameters **index** `integer` *required* Zero-based index of the warehouse to delete. ## Response ```json 200 theme={null} { "success": true, "data": [ { "locationId": 1, "name": "East Coast Fulfillment" } ] } ``` ## Example ```bash theme={null} curl -X DELETE "https://production-api.puppetvendors.com/settings/shipping/warehouses/0" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Duplicate Product Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/duplicate-product POST /products/{productId}/duplicate Clone an existing product into a new draft > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Clone an existing product to create a new draft copy. The duplicated product inherits the original's description, product type, vendor, tags, options, variants, images, media, and metafields. The following fields are changed automatically: * **Title** becomes "Copy of \[original title]" * **Status** is set to `draft` (or `pending` if the shop requires approval for new products) * **Inventory** is zeroed out on all variants * **SKUs** are cleared to avoid duplicates * **Handle** is regenerated by Shopify Vendor tokens can only duplicate their own products. ### Use Cases * Quickly create a similar product based on an existing one * Use a product as a template for seasonal variations * Speed up catalog expansion by cloning and editing ### Required Scope `products:write` ## Path Parameters **productId** `string` *required* The ID of the product to duplicate (Shopify numeric, GID, or MongoDB ObjectId). ## Response ```json 201 theme={null} { "success": true, "data": { "_id": "60a7b2c3d4e5f6a7b8c9d0e1", "shopifyId": "7890123456790", "graphqlProductId": "gid://shopify/Product/7890123456790", "title": "Copy of Organic Cotton Tee", "handle": "copy-of-organic-cotton-tee", "status": "draft", "productType": "T-Shirts", "vendor": "Acme Apparel", "variants": [ { "title": "S / White", "sku": "", "price": "29.99", "inventoryQuantity": 0 } ], "createdAt": "2026-05-19T10:30:00.000Z" } } ``` ```json 403 theme={null} { "success": false, "error": { "message": "Product creation not allowed", "code": "FORBIDDEN" } } ``` ```json 404 theme={null} { "success": false, "error": { "message": "Product not found", "code": "NOT_FOUND" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013/duplicate" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get Fulfillment Counts Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/fulfillment-counts GET /fulfillments/counts Get a breakdown of fulfillment counts by status > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Returns the number of line items in each fulfillment status (unfulfilled, on-hold, fulfilled, return-in-progress). Vendor tokens are automatically scoped to your own items. Optionally filter by date range. ### Use Cases * Display fulfillment status counters on your dashboard * Track how many orders are waiting to be shipped * Monitor return activity at a glance ### Required Scope `fulfillments:read` ## Query Parameters **startDate** `string` ISO 8601 lower bound on the date filter. Example: `2026-01-01T00:00:00Z`. **endDate** `string` ISO 8601 upper bound on the date filter. ## Response ```json 200 theme={null} { "success": true, "data": { "counts": { "fulfilled": 120, "unfulfilled": 15, "on-hold": 3, "return-in-progress": 2 } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/fulfillments/counts?startDate=2026-01-01T00:00:00Z&endDate=2026-05-19T23:59:59Z" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get Fulfillment Stats Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/fulfillment-stats GET /fulfillments/stats Get headline fulfillment performance statistics > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Returns headline fulfillment performance metrics: average days to fulfill, count of orders unfulfilled for 7+ days, and the percentage of orders fulfilled on time (within 7 days). Vendor tokens are automatically scoped to your own items. ### Use Cases * Display fulfillment performance KPIs on your vendor dashboard * Track whether your fulfillment speed is improving over time * Identify if you have a backlog of overdue orders ### Required Scope `fulfillments:read` ## Query Parameters **startDate** `string` ISO 8601 lower bound on the date filter. Example: `2026-01-01T00:00:00Z`. **endDate** `string` ISO 8601 upper bound on the date filter. ## Response ```json 200 theme={null} { "success": true, "data": { "stats": { "averageDaysToFulfill": 2.3, "unfulfilledFor7Days": 4, "fulfilledOnTimePercentage": 92.5 } } } ``` ### Response Fields | Field | Type | Description | | - | - | - | | `averageDaysToFulfill` | number | The average number of days between order creation and fulfillment. | | `unfulfilledFor7Days` | number | Count of orders that have been unfulfilled for 7 or more days (anchored to today). | | `fulfilledOnTimePercentage` | number | Percentage of orders fulfilled within 7 days of creation. | ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/fulfillments/stats?startDate=2026-04-01T00:00:00Z&endDate=2026-05-19T23:59:59Z" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Generate Barcode Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/generate-barcode POST /products/barcode Generate a unique barcode for a product variant > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Generate a unique barcode using the shop's barcode configuration (type, prefix, and length). The barcode is validated for uniqueness against Shopify before being returned, so you can safely assign it to a variant without collisions. This endpoint requires the barcode feature to be enabled by the merchant in shop settings. ### Use Cases * Auto-generate barcodes when creating new product variants * Replace missing barcodes on existing variants * Generate barcodes in bulk for inventory labeling ### Required Scope `products:write` ## Request Body No request body is required. The barcode format (type, prefix, length) is determined by the shop's barcode configuration. ## Response ```json 200 theme={null} { "success": true, "data": { "barcode": "PV10038472" } } ``` ```json 400 theme={null} { "success": false, "error": { "message": "Barcode generation is not enabled for this shop", "code": "FEATURE_DISABLED" } } ``` ```json 409 theme={null} { "success": false, "error": { "message": "Unable to generate a unique barcode after maximum retries", "code": "BARCODE_EXHAUSTED" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/products/barcode" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Generate Customer Invoice PDF Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/generate-customer-invoice-doc POST /documents/customer-invoice Generate a customer-facing invoice PDF (S3 URL, 48h expiry) > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Generate a customer-facing invoice PDF. Returns an S3 URL that expires in **48 hours**. Vendor tokens are scoped automatically. Merchants may omit vendor scope for a shop-level invoice, or pass `vendorId` via query param and/or body to scope to a vendor. The query parameter takes precedence when both are supplied. ## Query Parameters **vendorId** `string` Optional vendor ObjectId (merchants). Takes precedence over body `vendorId`. ## Request Body **orderId** `string` *required* Order ObjectId. **vendorId** `string` Optional vendor ObjectId (merchants). ## Response ```json 200 theme={null} { "success": true, "data": { "url": "https://puppetvendors-pdfs.s3.amazonaws.com/customer-invoices/...", "expiresAt": "2026-04-17T14:22:31Z" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/documents/customer-invoice" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "orderId": "507f1f77bcf86cd799439014" }' ``` # Generate Generic Label Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/generate-generic-label POST /shipping/generate-label Generate a generic shipping label without purchasing a carrier rate > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Generate a generic shipping label PDF without purchasing a rate from a carrier. Useful for vendors who arrange their own shipping and need a printable label for the package. ### Use Cases * Generate labels for self-shipped orders * Print labels for local delivery or courier pickup * Create labels when using a carrier not integrated with the platform ## Request Body **vendorId** `string` *required* The vendor's ID. Additional fields are passed through to the label generator (e.g. order details, addresses). The exact fields depend on the shop's label template configuration. ## Response ```json 200 theme={null} { "success": true, "data": { "labelUrl": "https://cdn.puppetvendors.com/labels/label_abc123.pdf" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/shipping/generate-label" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "vendorId": "507f1f77bcf86cd799439011" }' ``` # Generate Grouped Invoice by Vendor Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/generate-grouped-invoice POST /orders/invoice/grouped Consolidated invoice PDF for all orders from specific vendors within a date range > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Generate a consolidated invoice PDF covering all orders from specific vendors within a date range. Useful for monthly or weekly payout summaries. Vendor tokens are automatically scoped to themselves. ## Request Body **vendorIds** `array` *required* Array of vendor ObjectIds. **startDate** `string` Include orders from this date (ISO 8601). **endDate** `string` Include orders until this date (ISO 8601). ## Response ```json 200 theme={null} { "success": true, "data": { "pdfUrl": "https://cdn.puppetvendors.com/pdf/..." } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/orders/invoice/grouped" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "vendorIds": ["507f1f77bcf86cd799439011"], "startDate": "2026-03-01T00:00:00Z", "endDate": "2026-03-31T23:59:59Z" }' ``` # Generate Vendor Invoice PDF Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/generate-invoice POST /documents/invoice Generate a single-order vendor invoice PDF (S3 URL, 48h expiry) > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Generate a vendor invoice PDF for a single order. Returns an S3 URL that expires in **48 hours**. Vendor tokens are scoped automatically; merchant tokens must pass `vendorId` as a query parameter. > [!NOTE] > > For multi-order / multi-vendor invoices, use `POST /v2/orders/invoice` or `POST /v2/orders/invoice/grouped` instead. ## Query Parameters **vendorId** `string` Vendor ObjectId — required for merchant tokens. ## Request Body **orderId** `string` *required* Order ObjectId. ## Response ```json 200 theme={null} { "success": true, "data": { "url": "https://puppetvendors-pdfs.s3.amazonaws.com/invoices/...", "expiresAt": "2026-04-17T14:22:31Z" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/documents/invoice" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "orderId": "507f1f77bcf86cd799439014" }' ``` # Generate Packing Slip PDF Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/generate-packing-slip POST /documents/packing-slip Generate a single-order packing slip PDF (S3 URL, 48h expiry) > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Generate a packing slip PDF for a single order. Returns an S3 URL that expires in **48 hours**. Vendor tokens are scoped automatically; merchant tokens must pass `vendorId` as a query parameter. ## Query Parameters **vendorId** `string` Vendor ObjectId — required for merchant tokens. ## Request Body **orderId** `string` *required* Order ObjectId. ## Response ```json 200 theme={null} { "success": true, "data": { "url": "https://puppetvendors-pdfs.s3.amazonaws.com/packing-slips/...", "expiresAt": "2026-04-17T14:22:31Z" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/documents/packing-slip" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "orderId": "507f1f77bcf86cd799439014" }' ``` # Generate Shipping Label PDF Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/generate-shipping-label POST /documents/shipping-label Generate a shipping label PDF for order fulfillment (S3 URL, 48h expiry) > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Generate a shipping label PDF for order fulfillment. Returns an S3 URL that expires in **48 hours**. Vendor tokens are scoped automatically; merchant tokens must pass `vendorId` as a query parameter. ## Query Parameters **vendorId** `string` Vendor ObjectId — required for merchant tokens. ## Request Body **orderId** `string` *required* Order ObjectId. **lineItemIds** `array` Optional list of line item ObjectIds to include on the label. ## Response ```json 200 theme={null} { "success": true, "data": { "url": "https://puppetvendors-pdfs.s3.amazonaws.com/labels/...", "expiresAt": "2026-04-17T14:22:31Z" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/documents/shipping-label" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "orderId": "507f1f77bcf86cd799439014", "lineItemIds": ["507f1f77bcf86cd799439015"] }' ``` # Get Account Settings Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-account-settings GET /settings/accounts Retrieve the authenticated user's account information > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the authenticated user's account information including first name, last name, email, and last login timestamp. Vendor tokens can only access their own account. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439011", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "lastLogin": "2026-04-15T14:22:31.000Z" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/settings/accounts" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get My Vendor Address Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-my-address GET /vendors/me/address Retrieve the authenticated vendor's own address > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the authenticated vendor's own business address. Requires a vendor-scoped token. ## Response ```json 200 theme={null} { "success": true, "data": { "address1": "123 Main St", "address2": "Suite 200", "city": "Austin", "state": "TX", "postalCode": "78701", "country": "US" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/vendors/me/address" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get My Vendor Profile Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-my-profile GET /vendors/me/profile Retrieve the authenticated vendor's own profile > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the authenticated vendor's own profile. Requires a vendor-scoped token. Equivalent to `GET /v2/vendors/{vendorId}/profile` but scoped automatically to the token's vendor — no path parameter required. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439011", "vendorId": "507f1f77bcf86cd799439012", "information": { "description": "Handmade artisan products", "businessAddress": { "address1": "123 Main St", "city": "Austin", "state": "TX", "postalCode": "78701", "country": "US" } }, "socialMedia": { "instagram": "myshop" }, "contactInfo": { "email": "vendor@example.com" }, "policies": { "shippingPolicy": "Ships in 2 business days" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/vendors/me/profile" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get Order Timeline Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-order-timeline GET /orders/{orderId}/timeline Get the timeline of events and notes for a specific order > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Return the timeline of events and notes for a specific order. Timeline entries include system events (status changes, fulfillments) and user-added notes. ### Use Cases * **Order detail page** — Show a chronological activity feed for the order * **Dispute resolution** — Review the history of communications on an order * **Audit trail** — Track who did what and when on an order ## Headers **x-access-token** `string` *required* A valid vendor JWT. Requires `orders:read` scope. ## Path Parameters **orderId** `string` *required* The `_id` of the order. ## Response ```json 200 theme={null} { "success": true, "data": [ { "_id": "664a1b2c3d4e5f6a7b8c9d0e", "message": "Order received from Shopify", "type": "system", "createdBy": "system", "createdAt": "2026-05-15T10:30:00Z" }, { "_id": "664a1b2c3d4e5f6a7b8c9d0f", "message": "Shipped via UPS, tracking #1Z999AA10123456784", "type": "note", "createdBy": "vendor@example.com", "createdAt": "2026-05-16T14:00:00Z", "files": [ { "url": "https://cdn.puppetvendors.com/files/shipping-label.pdf", "name": "shipping-label.pdf" } ] } ] } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ```json 404 theme={null} { "success": false, "error": { "message": "Order not found", "code": "NOT_FOUND" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/orders/507f1f77bcf86cd799439011/timeline" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get Product Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-product GET /products/{productId} Retrieve a single product with full details including variants, images, and metafields > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the full details of a single product, including its variants, images, media, and metafields. Vendor tokens can only access their own products. Accepts a Shopify numeric ID, Shopify GID, or MongoDB ObjectId. ### Use Cases * Load all product data for an edit form * Check variant-level inventory and pricing * Read metafield values attached to a product ### Required Scope `products:read` ## Path Parameters **productId** `string` *required* The product identifier. Accepts any of these formats: * MongoDB ObjectId (e.g. `507f1f77bcf86cd799439013`) * Shopify numeric ID (e.g. `7890123456789`) * Shopify GID (e.g. `gid://shopify/Product/7890123456789`) ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439013", "shopifyId": "7890123456789", "graphqlProductId": "gid://shopify/Product/7890123456789", "title": "Organic Cotton Tee", "handle": "organic-cotton-tee", "descriptionHtml": "

A soft, breathable tee made from 100% organic cotton.

", "productType": "T-Shirts", "vendor": "Acme Apparel", "status": "active", "tags": ["organic", "cotton", "summer"], "options": [ { "name": "Size", "values": ["S", "M", "L", "XL"] }, { "name": "Color", "values": ["White", "Black", "Navy"] } ], "variants": [ { "id": "gid://shopify/ProductVariant/44012345678901", "title": "S / White", "sku": "ACME-TEE-S-WHT", "price": "29.99", "compareAtPrice": "39.99", "barcode": "194251038522", "inventoryQuantity": 42, "weight": 0.3, "weightUnit": "kg" } ], "images": [ { "src": "https://cdn.shopify.com/s/files/1/0123/4567/8901/products/tee-white.jpg", "alt": "Organic cotton tee in white" } ], "metafields": [ { "namespace": "custom", "key": "care_instructions", "value": "Machine wash cold", "type": "single_line_text_field" } ], "createdAt": "2026-03-10T08:30:00.000Z", "updatedAt": "2026-05-15T14:22:00.000Z" } } ``` ```json 404 theme={null} { "success": false, "error": { "message": "Product not found", "code": "NOT_FOUND" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get Profile Settings Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-profile-settings GET /settings/profiles Retrieve the vendor's storefront profile grouped by portal tabs > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the authenticated vendor's profile settings grouped by portal tabs: `information`, `socialMedia`, `contactInfo`, `policies`, `vacation`, and `others`. Vendor scope required. ## Response ```json 200 theme={null} { "success": true, "data": { "information": { "description": "Handmade artisan products", "businessAddress": { "address1": "123 Main St", "city": "Austin", "state": "TX", "postalCode": "78701", "country": "US" } }, "socialMedia": { "instagram": "myshop", "website": "example.com" }, "contactInfo": { "email": "vendor@example.com", "phone": "+15555550123" }, "policies": { "shippingPolicy": "Ships in 2 business days", "returnsPolicy": "30-day return policy" }, "vacation": { "enabled": false }, "others": { "hasTax": true, "vendorTaxRate": 8.25 } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/settings/profiles" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get Shipping Rates Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-shipping-rates GET /settings/shipping/rates Retrieve the vendor's shipping rate configuration > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve the vendor's shipping rate configuration including calculation method, fixed amount, and ranges (price- or weight-based). Vendor scope required. ### Methods * `order` — Fixed rate per order * `lineItem` — Fixed rate per line item * `orderRange` — Rate varies by order total * `orderWeight` — Rate varies by order weight (grams) * `realtime` — Live rates from a connected carrier (Shippo / ShipStation) ## Response ```json 200 theme={null} { "success": true, "data": { "method": "orderRange", "ranges": [ { "from": 0, "to": 75, "rate": 5 }, { "from": 75, "to": 150, "rate": 10 } ] } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/settings/shipping/rates" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get Shipping Rates for Order Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-shipping-rates-op POST /shipping/get-rates Fetch real-time shipping rates for an order's line items > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Fetch real-time shipping rates from connected carriers for a specific set of line items. Provide package dimensions, weight, and origin/destination addresses to receive available rates with pricing and estimated delivery times. ### Use Cases * Show rate options to vendors before purchasing a label * Compare carrier pricing for a shipment * Integrate shipping rate selection into custom fulfillment workflows ## Request Body **orderNumber** `string | number` *required* The Shopify order number. **vendorId** `string` *required* The vendor's ID. **lineItems** `string[]` *required* Array of line item IDs to ship. Minimum 1 item. **length** `number` Package length. Must be a positive number. **width** `number` Package width. Must be a positive number. **height** `number` Package height. Must be a positive number. **weight** `number` Package weight. Must be a positive number. **weightunit** `string` Weight unit (e.g. `lb`, `kg`, `oz`, `g`). **distanceunit** `string` Distance unit for dimensions (e.g. `in`, `cm`). **to\_address** `object` Destination address. **to\_address.street1** `string` Street address line 1. **to\_address.street2** `string` Street address line 2. **to\_address.country** `string` Country code (e.g. `US`, `GB`). **to\_address.zip** `string` Postal / ZIP code. **to\_address.city** `string` City name. **to\_address.phone** `string` Phone number. **to\_address.state** `string` State or province. **to\_address.name** `string` Recipient name. **to\_address.email** `string` Recipient email. **from\_address** `object` Origin address. Same fields as `to_address`. **from\_address.street1** `string` Street address line 1. **from\_address.street2** `string` Street address line 2. **from\_address.country** `string` Country code. **from\_address.zip** `string` Postal / ZIP code. **from\_address.city** `string` City name. **from\_address.phone** `string` Phone number. **from\_address.state** `string` State or province. **from\_address.name** `string` Sender name. **from\_address.email** `string` Sender email. ## Response ```json 200 theme={null} { "success": true, "data": { "rates": [ { "provider": "shippo", "service": "usps_priority", "serviceName": "USPS Priority Mail", "amount": 7.49, "currency": "USD", "estimatedDays": 3, "carrierCode": "usps" }, { "provider": "shippo", "service": "ups_ground", "serviceName": "UPS Ground", "amount": 9.15, "currency": "USD", "estimatedDays": 5, "carrierCode": "ups" } ] } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/shipping/get-rates" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "orderNumber": "1042", "vendorId": "507f1f77bcf86cd799439011", "lineItems": ["660a1b2e3d98f0001a2b3c01"], "length": 12, "width": 8, "height": 6, "weight": 2.5, "weightunit": "lb", "distanceunit": "in", "to_address": { "street1": "456 Oak Ave", "city": "Portland", "state": "OR", "zip": "97201", "country": "US" }, "from_address": { "street1": "123 Main St", "city": "Austin", "state": "TX", "zip": "78701", "country": "US" } }' ``` ### More Examples **International shipment rates** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/shipping/get-rates" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "orderNumber": "1055", "vendorId": "507f1f77bcf86cd799439012", "lineItems": ["665a1b2c3d4e5f6a7b8c9d0e"], "length": 12, "width": 8, "height": 6, "weight": 2.5, "weightunit": "lb", "distanceunit": "in", "from_address": { "street1": "123 Main St", "city": "New York", "state": "NY", "country": "US", "zip": "10001" }, "to_address": { "street1": "10 Downing St", "city": "London", "country": "GB", "zip": "SW1A 2AA" } }' ``` # Get User Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-user GET /users/{userId} Retrieve a single vendor portal user by ID > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview > [!WARNING] > > **Vendor API keys can't call this endpoint.** A token minted from a vendor key (`vk_live_…`) gets `403 FORBIDDEN` "API keys cannot call this endpoint", even with every scope. Use a vendor portal login session. A merchant key (`mk_live_…`) can read any user in the shop. Retrieve a single vendor portal user. Portal sessions can read users of their own vendor. Merchant-key tokens can read any user in the shop. ## Path Parameters **userId** `string` *required* User ObjectId. ## Response ```json 200 Merchant key theme={null} { "success": true, "data": { "_id": "", "vendor": null, "type": "vendor", "approved": true, "shopId": "", "vendorId": "", "email": "", "invitationDate": "2026-09-15T06:49:22.000Z", "updatedAt": "2026-09-15T06:49:22.000Z", "createdAt": "2026-09-15T06:49:22.000Z", "passwordLastChangeDate": "2026-09-15T06:49:22.386Z", "verificationCode": "", "__v": 0 } } ``` ```json 403 Vendor API key theme={null} { "success": false, "error": { "code": "FORBIDDEN", "message": "API keys cannot call this endpoint", "errorId": "err_1792578578483_abc1234" } } ``` ## Example ```bash theme={null} theme={null} curl -X GET "https://production-api.puppetvendors.com/users/507f1f77bcf86cd799439030" \ -H "x-access-token: $PV_PORTAL_SESSION_TOKEN" ``` # Get Warehouse Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/get-warehouse GET /settings/shipping/warehouses/{locationId} Retrieve a single warehouse by its locationId > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve a single warehouse / location by its numeric `locationId`. Vendor scope required. ## Path Parameters **locationId** `integer` *required* Numeric `locationId` of the warehouse. ## Response ```json 200 theme={null} { "success": true, "data": { "locationId": 0, "name": "Main Warehouse", "address1": "123 Main St", "city": "Austin", "province": "TX", "zip": "78701", "country": "US" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/settings/shipping/warehouses/0" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # List Fulfillment Events Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/list-fulfillment-events GET /fulfillments/events/{lineItemId} List all tracking events for a line item's fulfillment > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview List all tracking events for a line item's fulfillment. Vendor tokens can only access events on their own line items. ### Event Statuses `in_transit` · `out_for_delivery` · `delivered` · `failed_delivery` ## Path Parameters **lineItemId** `string` *required* Line item ObjectId. ## Response ```json 200 theme={null} { "success": true, "data": [ { "_id": "507f1f77bcf86cd799439020", "lineItemId": "507f1f77bcf86cd799439015", "status": "in_transit", "happenedAt": "2026-04-15T08:30:00Z", "city": "Austin", "province": "TX", "country": "US", "message": "Package scanned at origin facility" } ] } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/fulfillments/events/507f1f77bcf86cd799439015" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # List Available Integrations Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/list-integrations GET /integrations Return the list of integration providers supported by the vendor portal > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview > [!WARNING] > > **Portal sessions only.** Call this with a token from a vendor portal login. Tokens minted from an API key (`vk_live_…` or `mk_live_…`) get `403 FORBIDDEN`, even with every scope. Returns the list of integration providers supported by the vendor portal, grouped by category (Shipping, Payments, etc.). This is a static catalog and does not reflect whether a given integration is currently configured — use the provider-specific `GET /v2/integrations/{provider}` endpoints for that. ## Response ```json 200 theme={null} theme={null} { "success": true, "data": [ { "category": "Shipping", "integrations": [ { "key": "shippo", "label": "Shippo", "connected": false }, { "key": "shipstation", "label": "ShipStation", "connected": false } ] }, { "category": "Payments", "integrations": [ { "key": "paypal", "label": "PayPal", "connected": false }, { "key": "stripe", "label": "Stripe Connect", "connected": false } ] } ] } ``` ```json 403 Vendor API key (vk_) theme={null} { "success": false, "error": { "code": "FORBIDDEN", "message": "API keys cannot call this endpoint", "errorId": "err_1792578578483_abc1234" } } ``` ```json 403 Merchant API key (mk_) theme={null} { "success": false, "error": { "code": "FORBIDDEN", "message": "This endpoint is not available to merchant API keys. Use the v1 API token.", "errorId": "err_1792578578483_abc1234" } } ``` ## Example ```bash theme={null} theme={null} curl -X GET "https://production-api.puppetvendors.com/integrations" \ -H "x-access-token: $PV_PORTAL_SESSION_TOKEN" ``` # List Shipping Dimensions Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/list-shipping-dimensions GET /shipping/dimensions Retrieve saved shipping dimension presets > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve saved shipping dimension presets for the vendor. Dimensions can be generic (reusable across products) or product-specific. These presets pre-fill package dimensions when fetching shipping rates. ### Use Cases * List available dimension presets for a rate-fetch UI * Filter product-specific dimensions for a particular product * Audit saved dimension configurations ## Query Parameters **type** `string` Filter by dimension type. Must be `generic` or `productSpecific`. **productId** `string` Filter by Shopify product ID. Typically used with `type=productSpecific`. **title** `string` Filter by dimension preset title. ## Response ```json 200 theme={null} { "success": true, "data": [ { "_id": "665a1b2e3d98f0001a2b3c50", "type": "generic", "title": "Small Box", "dimensionUnit": "in", "heightValue": 4, "widthValue": 6, "lengthValue": 8 }, { "_id": "665a1b2e3d98f0001a2b3c51", "type": "productSpecific", "productId": "7890123456", "title": "Widget Packaging", "dimensionUnit": "cm", "heightValue": 10, "widthValue": 15, "lengthValue": 20 } ] } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/shipping/dimensions?type=generic" \ -H "x-access-token: YOUR_VENDOR_TOKEN" ``` # List Team Members Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/list-team-members GET /settings/team Retrieve team members for the vendor account > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve team members associated with the vendor account. Supports cursor-based pagination and free-text search. ### Use Cases * Display a team management UI * Search for specific team members by name or email * Audit team access and permissions ## Query Parameters **search** `string` Free-text search across name and email. Maximum 200 characters. **first** `number` Number of records to return from the start. Used with `after` for forward pagination. **after** `string` Cursor for forward pagination. Use the `endCursor` from the previous response. **last** `number` Number of records to return from the end. Used with `before` for backward pagination. **before** `string` Cursor for backward pagination. Use the `startCursor` from the previous response. ## Response ```json 200 theme={null} { "success": true, "data": { "edges": [ { "cursor": "NjY1YTFiMmUzZDk4", "node": { "_id": "665a1b2e3d98f0001a2b3c80", "email": "alice@example.com", "profile": { "firstName": "Alice", "lastName": "Johnson", "phone": "+15125551234" }, "apiPermissions": [ "orders:read", "products:write" ], "createdAt": "2026-01-15T09:00:00.000Z", "lastLogin": "2026-05-18T14:22:00.000Z" } } ], "pageInfo": { "hasNextPage": false, "hasPreviousPage": false, "startCursor": "NjY1YTFiMmUzZDk4", "endCursor": "NjY1YTFiMmUzZDk4" } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/settings/team?first=20&search=alice" \ -H "x-access-token: YOUR_VENDOR_TOKEN" ``` # List Warehouses Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/list-warehouses GET /settings/shipping/warehouses Retrieve all warehouses (locations) for the authenticated vendor > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Retrieve all warehouses / locations for the authenticated vendor. Vendor scope required. ## Response ```json 200 theme={null} { "success": true, "data": [ { "locationId": 0, "name": "Main Warehouse", "address1": "123 Main St", "city": "Austin", "province": "TX", "zip": "78701", "country": "US" }, { "locationId": 1, "name": "East Coast Fulfillment", "address1": "500 Harbor Blvd", "city": "Jersey City", "province": "NJ", "zip": "07302", "country": "US" } ] } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/settings/shipping/warehouses" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get Order Counts Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/order-counts GET /orders/counts Get a count of orders grouped by fulfillment status > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Return the number of orders in each fulfillment status for the authenticated vendor. Useful for building dashboard summary cards and status badges. ### Use Cases * **Dashboard counters** — Show "5 pending, 2 partial, 45 fulfilled" at a glance * **Alert badges** — Highlight statuses that need attention (e.g. on-hold or error) ## Headers **x-access-token** `string` *required* A valid vendor JWT. Requires `orders:read` scope. ## Response ```json 200 theme={null} { "success": true, "data": { "pending": 5, "partial": 2, "fulfilled": 45, "onHold": 1, "error": 0, "cancelled": 3 } } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ```json 403 theme={null} { "success": false, "error": { "message": "Insufficient scope", "code": "FORBIDDEN" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/orders/counts" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Get Payout Batch Detail Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/payout-batch-detail GET /payouts/batches/{batchId} Get detailed breakdown of a specific payout batch > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Return the detailed breakdown of a specific payout batch, including individual line items, amounts, and status information. Each payout transaction can contain one or more batches. ### Use Cases * **Payout detail page** — Show the full breakdown when a vendor clicks into a specific payout * **Line item audit** — Review exactly which orders and amounts are included in a batch * **Dispute investigation** — Verify payout calculations for a specific batch ## Headers **x-access-token** `string` *required* A valid vendor JWT. Requires `payouts:read` scope. ## Path Parameters **batchId** `string` *required* The `_id` of the payout batch. ## Query Parameters **vendorId** `string` Filter by vendor ID (24-character hex string). Defaults to the authenticated vendor. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439055", "status": "paid", "processedAt": "2026-05-01T12:00:00Z", "amount": 5000.00, "currency": "USD", "transactionId": "txn_1PqR2sT3uV4wX5yZ", "paymentMethod": "stripe", "itemCount": 12, "lineItems": [ { "orderId": "664a1b2c3d4e5f6a7b8c9d30", "orderName": "#1042", "productTitle": "Classic T-Shirt", "variantTitle": "Red / Medium", "sku": "TSH-RED-M", "quantity": 2, "sales": 49.98, "commission": 7.50, "payout": 42.48, "fulfilledAt": "2026-04-28T15:00:00Z" }, { "orderId": "664a1b2c3d4e5f6a7b8c9d31", "orderName": "#1043", "productTitle": "Premium Hoodie", "variantTitle": "Navy / Large", "sku": "HOD-NAV-L", "quantity": 1, "sales": 89.99, "commission": 13.50, "payout": 76.49, "fulfilledAt": "2026-04-29T10:30:00Z" } ], "createdAt": "2026-04-30T18:00:00Z" } } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ```json 404 theme={null} { "success": false, "error": { "message": "Batch not found", "code": "NOT_FOUND" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts/batches/507f1f77bcf86cd799439055" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Payout Summary Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/payout-summary GET /payouts/summary Get a high-level summary of payout totals and the next scheduled payout > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Return a high-level summary of the vendor's payout totals, including the most recent payout, the next scheduled payout, and aggregate amounts. Useful for building a payouts dashboard. ### Use Cases * **Payouts dashboard** — Show "Total received", "Pending", and "Next payout" cards * **Financial overview** — Give vendors a snapshot of their earnings at a glance * **Payout scheduling visibility** — Display when the next automated payout will run ## Headers **x-access-token** `string` *required* A valid vendor JWT. Requires `payouts:read` scope. ## Query Parameters **vendorId** `string` Filter by vendor ID (24-character hex string). Defaults to the authenticated vendor. **dateMin** `string` ISO 8601 lower bound on the date range. **dateMax** `string` ISO 8601 upper bound on the date range. ## Response ```json 200 theme={null} { "success": true, "data": { "totalReceived": 12500.00, "totalPending": 3200.00, "totalScheduled": 1500.00, "currency": "USD", "shopTimezone": "America/New_York", "previousPayout": { "amount": 5000.00, "status": "paid", "date": "2026-05-01T00:00:00Z", "latestBatchId": "507f1f77bcf86cd799439055" }, "nextPayout": { "amount": 1500.00, "status": "scheduled", "estimatedDate": "2026-06-01T00:00:00Z", "type": "automated", "startDate": "2026-05-01T00:00:00Z", "endDate": "2026-05-31T23:59:59Z" }, "itemCount": 156 } } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ```json 403 theme={null} { "success": false, "error": { "message": "Insufficient scope", "code": "FORBIDDEN" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts/summary?dateMin=2026-01-01T00:00:00Z&dateMax=2026-05-31T23:59:59Z" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # List Payout Transactions Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/payout-transactions GET /payouts/transactions List payout transactions with cursor pagination and filters > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Return a paginated list of payout transactions for the authenticated vendor. Uses cursor-based pagination for stable results when data changes between pages. ### Use Cases * **Payout history table** — Show a list of past payouts with status and amounts * **Transaction lookup** — Search for a specific payout by transaction ID or date * **Reconciliation** — Cross-reference payouts with bank deposits ## Headers **x-access-token** `string` *required* A valid vendor JWT. Requires `payouts:read` scope. ## Query Parameters **vendorId** `string` Filter by vendor ID (24-character hex string). Defaults to the authenticated vendor. **status** `string` Filter by status: `pending` · `paid` · `failed` · `cancelled`. **dateMin** `string` ISO 8601 lower bound on transaction date. **dateMax** `string` ISO 8601 upper bound on transaction date. **search** `string` Free-text search (max 200 characters). Searches transaction IDs and order references. **first** `integer` Number of records to return from the start of the result set (forward pagination). **after** `string` Cursor for forward pagination. Use the `endCursor` value from a previous response. **last** `integer` Number of records to return from the end of the result set (backward pagination). **before** `string` Cursor for backward pagination. Use the `startCursor` value from a previous response. ## Response ```json 200 theme={null} { "success": true, "data": { "edges": [ { "node": { "_id": "664a1b2c3d4e5f6a7b8c9d20", "processedAt": "2026-05-01T12:00:00Z", "status": "paid", "transactionId": "txn_1PqR2sT3uV4wX5yZ", "itemCount": 12, "amount": 5000.00, "createdAt": "2026-04-30T18:00:00Z" }, "cursor": "NjY0YTFiMmMzZDRlNWY2YTdiOGM5ZDIw" }, { "node": { "_id": "664a1b2c3d4e5f6a7b8c9d21", "processedAt": "2026-04-01T12:00:00Z", "status": "paid", "transactionId": "txn_6AbC7dEf8gHi9jKl", "itemCount": 8, "amount": 3200.00, "createdAt": "2026-03-31T18:00:00Z" }, "cursor": "NjY0YTFiMmMzZDRlNWY2YTdiOGM5ZDIx" } ], "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "startCursor": "NjY0YTFiMmMzZDRlNWY2YTdiOGM5ZDIw", "endCursor": "NjY0YTFiMmMzZDRlNWY2YTdiOGM5ZDIx" } } } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ```json 403 theme={null} { "success": false, "error": { "message": "Insufficient scope", "code": "FORBIDDEN" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts/transactions?status=paid&first=10" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` ### More Examples **Filter paid transactions** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts/transactions?first=20&status=paid&dateMin=2026-01-01T00:00:00Z" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # List Pending Payouts Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/pending-payouts GET /payouts/pending List line items that are pending payout with offset pagination > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Return a paginated list of line items that are pending payout for the authenticated vendor. Unlike the transactions endpoint, this uses **offset-based pagination** (limit/offset) instead of cursors. ### Use Cases * **Pending earnings table** — Show vendors what they have earned but not yet been paid for * **Payout preview** — Let vendors see what will be included in the next payout * **Filtered views** — Show only refunded or adjusted line items separately ## Headers **x-access-token** `string` *required* A valid vendor JWT. Requires `payouts:read` scope. ## Query Parameters **vendorId** `string` Filter by vendor ID (24-character hex string). Defaults to the authenticated vendor. **dateMin** `string` ISO 8601 lower bound on line item date. **dateMax** `string` ISO 8601 upper bound on line item date. **search** `string` Free-text search (max 200 characters). Searches order names, SKUs, and product titles. **lineItemType** `string` Filter by type: `paid` · `refunded` · `adjustment`. **limit** `integer` Number of records per page. Min `1`, max `500`. Defaults to `50`. **offset** `integer` Number of records to skip. Min `0`. Defaults to `0`. ## Response ```json 200 theme={null} { "success": true, "data": { "items": [ { "_id": "664a1b2c3d4e5f6a7b8c9d40", "orderId": "664a1b2c3d4e5f6a7b8c9d30", "orderName": "#1050", "productTitle": "Classic T-Shirt", "variantTitle": "Red / Medium", "sku": "TSH-RED-M", "quantity": 1, "type": "paid", "sales": 24.99, "commission": 3.75, "payout": 21.24, "createdAt": "2026-05-10T08:30:00Z" }, { "_id": "664a1b2c3d4e5f6a7b8c9d41", "orderId": "664a1b2c3d4e5f6a7b8c9d32", "orderName": "#1048", "productTitle": "Premium Hoodie", "variantTitle": "Navy / Large", "sku": "HOD-NAV-L", "quantity": 1, "type": "refunded", "sales": -89.99, "commission": -13.50, "payout": -76.49, "createdAt": "2026-05-08T11:00:00Z" } ], "total": 42, "limit": 50, "offset": 0 } } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ```json 403 theme={null} { "success": false, "error": { "message": "Insufficient scope", "code": "FORBIDDEN" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts/pending?lineItemType=paid&limit=25&offset=0" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` ### More Examples **Filter refunded items** ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/payouts/pending?limit=50&lineItemType=refunded&dateMin=2026-05-01T00:00:00Z" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Forgot Password Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/portal-forgot-password POST /portal/auth/forgot-password Send a password reset link to a vendor's email > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Send a password reset email to the vendor. For security, the response is always the same whether or not the email exists. Rate limited to **3 requests per 15 minutes per IP**. ### Use Cases * **Vendor portal "Forgot password?" link** — Let vendors request a reset email from the login screen * **Automated password recovery flows** — Trigger a reset on behalf of a vendor from your own UI ## Request Body **email** `string` *required* The vendor's registered email address. **shopDomain** `string` *required* The Shopify shop domain the vendor belongs to (e.g. `my-store.myshopify.com`). ## Response ```json 200 theme={null} { "success": true, "data": { "message": "If the email exists, a reset link has been sent" } } ``` ### Error Responses ```json 400 theme={null} { "success": false, "error": { "message": "\"email\" must be a valid email", "code": "VALIDATION_ERROR" } } ``` ```json 429 theme={null} { "success": false, "error": { "message": "Too many requests", "code": "RATE_LIMITED" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/portal/auth/forgot-password" \ -H "Content-Type: application/json" \ -d '{ "email": "vendor@example.com", "shopDomain": "my-store.myshopify.com" }' ``` # List Vendors for User Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/portal-list-vendors GET /portal/auth/vendors Get all vendor accounts linked to the authenticated user > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Return all vendor accounts associated with the currently authenticated user. This is useful when a single email address has been registered as a vendor on multiple shops. ### Use Cases * **Vendor switcher UI** — Show a dropdown of available vendor accounts after login * **Multi-shop vendors** — Let a vendor see which shops they belong to ## Headers **x-access-token** `string` *required* A valid vendor JWT (vendor scope). ## Response ```json 200 theme={null} { "success": true, "data": [ { "_id": "507f1f77bcf86cd799439012", "vendorName": "Acme Co", "vendorNameAlias": "acme" }, { "_id": "507f1f77bcf86cd799439099", "vendorName": "Widget Works", "vendorNameAlias": "widget-works" } ] } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/portal/auth/vendors" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Vendor Portal Login Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/portal-login POST /portal/auth/login Authenticate a vendor user with email and password; returns a JWT > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Authenticate a vendor user with email and password. Returns a JWT token that works with all protected V2 endpoints under the vendor scope. Rate limited to **5 requests per 15 minutes per IP**. ### Use Cases * **Vendor portal login screen** — Exchange credentials for a session token * **Mobile vendor app** — Bootstrap the app after vendor enters credentials ## Request Body **email** `string` *required* Vendor's email address. **password** `string` *required* Vendor's password. **shopDomain** `string` Target shop domain — required when a single email is registered across multiple shops. ## Response ```json 200 theme={null} { "success": true, "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expiresIn": 86400, "scope": "vendor", "shopDomain": "my-store.myshopify.com", "user": { "id": "507f1f77bcf86cd799439011", "email": "vendor@example.com", "vendorId": "507f1f77bcf86cd799439012", "vendor": "Acme Co" } } } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid credentials", "code": "INVALID_CREDENTIALS" } } ``` ```json 403 theme={null} { "success": false, "error": { "message": "Account not approved", "code": "NOT_APPROVED" } } ``` ```json 429 theme={null} { "success": false, "error": { "message": "Too many login attempts", "code": "RATE_LIMITED" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/portal/auth/login" \ -H "Content-Type: application/json" \ -d '{ "email": "vendor@example.com", "password": "secret123", "shopDomain": "my-store.myshopify.com" }' ``` # Vendor Portal Logout Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/portal-logout POST /portal/auth/logout Invalidate the current vendor session token > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Log out the current vendor by invalidating their JWT token. After calling this endpoint, the token can no longer be used for authenticated requests. ### Use Cases * **Logout button** — End the vendor's session when they click "Sign out" * **Security cleanup** — Invalidate a token after detecting suspicious activity ## Headers **x-access-token** `string` *required* A valid vendor JWT. ## Response ```json 200 theme={null} { "success": true } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/portal/auth/logout" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Refresh Vendor Token Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/portal-refresh-token POST /portal/auth/refresh-token Exchange a valid vendor token for a new one with extended expiry > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Exchange a valid (non-expired) vendor token for a new one with extended expiry. Call this proactively before the current token expires to avoid forcing the vendor to re-enter credentials. ## Headers **x-access-token** `string` *required* A valid (non-expired) vendor JWT. ## Response ```json 200 theme={null} { "success": true, "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expiresIn": 86400, "shopDomain": "my-store.myshopify.com" } } ``` ### Error Responses ```json 401 theme={null} { "success": false, "error": { "message": "Invalid or expired token" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/portal/auth/refresh-token" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Vendor Portal Signup Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/portal-signup POST /portal/auth/signup Create a new vendor portal signup request (pending merchant approval) > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Create a new vendor portal signup request. The account is created in a pending state (`approved: false`) and requires manual merchant approval before the vendor can log in. This endpoint is public (no authentication required) and accepts legacy compatibility aliases (`shopId`, `email_address`) for backwards compatibility with older clients. ### Use Cases * **Self-service onboarding** — Vendors submit a signup request from the vendor portal landing page * **Multi-shop installations** — Vendors specify `shopDomain` to target a specific merchant * **Honeypot protection** — `emailAddress` / `email_address` fields trap automated bots ## Request Body **email** `string` *required* Vendor's email address. **password** `string` *required* Password, minimum 6 characters. **vendor** `string` *required* Vendor / business name. **shopDomain** `string` Preferred shop identifier (e.g. `my-store.myshopify.com`). **shopId** `string` Legacy compatibility shop identifier. **profile** `object` Optional profile metadata. **termsAccepted** `boolean` Must be `true` if terms acceptance is required by the shop. **emailAddress** `string` Honeypot field — must be empty. **email\_address** `string` Legacy honeypot alias — must be empty. **message** `string` Optional custom success message. ## Response ```json 200 theme={null} { "success": true, "data": { "userId": "507f1f77bcf86cd799439011", "email": "vendor@example.com", "approved": false, "message": "Thank you for submitting your request. We will respond as soon as possible." } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/portal/auth/signup" \ -H "Content-Type: application/json" \ -d '{ "email": "vendor@example.com", "password": "secret123", "shopDomain": "my-store.myshopify.com", "vendor": "Acme Co", "termsAccepted": true, "email_address": "" }' ``` ### More Examples **Signup with full profile** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/portal/auth/signup" \ -H "Content-Type: application/json" \ -d '{ "email": "newvendor@example.com", "password": "secure-pass-123", "shopDomain": "my-store.myshopify.com", "vendor": "Fresh Produce Co", "firstName": "Jane", "lastName": "Smith", "phone": "+1-555-0456", "message": "We sell organic farm produce and would love to join your marketplace.", "termsAccepted": true }' ``` # Get Product Counts Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/product-counts GET /products/counts Get a breakdown of how many products you have in each status > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Returns the number of products you have in each status tab (active, draft, pending, error, deleted, archived). Vendor tokens are automatically scoped to your own products only. ### Use Cases * Display status badges or counters in your product dashboard * Check how many products are pending approval before submitting more * Monitor error counts after a bulk import ### Required Scope `products:read` ## Response ```json 200 theme={null} { "success": true, "data": { "counts": { "active": 45, "draft": 12, "pending": 3, "error": 1, "deleted": 0, "archived": 5 } } } ``` ## Example ```bash theme={null} curl -X GET "https://production-api.puppetvendors.com/products/counts" \ -H "x-access-token: YOUR_VENDOR_JWT" ``` # Purchase Shipping Label Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/purchase-shipping-label POST /shipping/purchase-label Purchase a shipping label for an order using a selected rate > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Purchase a shipping label for an order after selecting a rate from the [Get Shipping Rates](/api-reference/v2/vendor/endpoint/get-shipping-rates-op) endpoint. Provide the same shipment details plus the chosen service code and carrier. ### Use Cases * Purchase a label after a vendor selects a rate * Automate label generation in fulfillment workflows * Integrate carrier label purchase into custom shipping UIs ## Request Body Accepts the same fields as [Get Shipping Rates](/api-reference/v2/vendor/endpoint/get-shipping-rates-op), plus: **orderNumber** `string | number` *required* The Shopify order number. **vendorId** `string` *required* The vendor's ID. **lineItems** `string[]` *required* Array of line item IDs to ship. Minimum 1 item. **service\_code** `string` *required* The service code from the selected rate (e.g. `usps_priority`). **shippingCarrier** `string` *required* The shipping carrier provider (e.g. `shippo`, `shipstation`). **carrierCode** `string` Carrier-specific code (e.g. `usps`, `ups`, `fedex`). **length** `number` Package length. Must be a positive number. **width** `number` Package width. Must be a positive number. **height** `number` Package height. Must be a positive number. **weight** `number` Package weight. Must be a positive number. **weightunit** `string` Weight unit (e.g. `lb`, `kg`, `oz`, `g`). **distanceunit** `string` Distance unit for dimensions (e.g. `in`, `cm`). **to\_address** `object` Destination address. See [Get Shipping Rates](/api-reference/v2/vendor/endpoint/get-shipping-rates-op) for field details. **from\_address** `object` Origin address. See [Get Shipping Rates](/api-reference/v2/vendor/endpoint/get-shipping-rates-op) for field details. ## Response ```json 200 theme={null} { "success": true, "data": { "trackingNumber": "9400111899223456789012", "trackingUrl": "https://tools.usps.com/go/TrackConfirmAction?tLabels=9400111899223456789012", "labelUrl": "https://deliver.goshippo.com/label_abc123.pdf", "carrier": "USPS" } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/shipping/purchase-label" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "orderNumber": "1042", "vendorId": "507f1f77bcf86cd799439011", "lineItems": ["660a1b2e3d98f0001a2b3c01"], "service_code": "usps_priority", "shippingCarrier": "shippo", "carrierCode": "usps", "length": 12, "width": 8, "height": 6, "weight": 2.5, "weightunit": "lb", "distanceunit": "in", "to_address": { "street1": "456 Oak Ave", "city": "Portland", "state": "OR", "zip": "97201", "country": "US" }, "from_address": { "street1": "123 Main St", "city": "Austin", "state": "TX", "zip": "78701", "country": "US" } }' ``` ### More Examples **Purchase a USPS Priority Mail label** ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/shipping/purchase-label" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "orderNumber": "1055", "vendorId": "507f1f77bcf86cd799439012", "lineItems": ["665a1b2c3d4e5f6a7b8c9d0e"], "length": 12, "width": 8, "height": 6, "weight": 2.5, "weightunit": "lb", "distanceunit": "in", "service_code": "usps_priority", "shippingCarrier": "USPS", "from_address": { "street1": "123 Main St", "city": "New York", "state": "NY", "country": "US", "zip": "10001" }, "to_address": { "street1": "456 Oak Ave", "city": "Los Angeles", "state": "CA", "country": "US", "zip": "90001" } }' ``` # Initiate Stripe Connect Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/stripe-connect POST /integrations/stripe/connect Start the Stripe Connect onboarding process for the vendor > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Start the Stripe Connect onboarding process. Returns an onboarding URL the vendor should be redirected to. * **Express account** — Creates a new Stripe Express account and returns the onboarding link. * **Standard account** — Returns the Stripe OAuth authorization URL. Vendor scope required. ## Request Body **accountType** `string` *required* `express` or `standard`. **returnUrl** `string` *required* URL to redirect to after onboarding completes. ## Response ```json 200 theme={null} { "success": true, "data": { "onboardingUrl": "https://connect.stripe.com/setup/e/acct_1234/..." } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/integrations/stripe/connect" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "accountType": "express", "returnUrl": "https://portal.example.com/settings/integrations?stripe=connected" }' ``` # Update Account Settings Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-account-settings PUT /settings/accounts Update the authenticated user's account information or password > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update the authenticated user's account. Can modify first name, last name, email, and password. For password changes, `currentPassword` and `confirmPassword` are required, and `currentPassword` must match the user's existing password. For email changes, the new email must not already be in use. Vendor tokens can only update their own account. ## Request Body **firstName** `string` **lastName** `string` **email** `string` New email address (must be unique). **currentPassword** `string` Required when changing password. **password** `string` New password. **confirmPassword** `string` Must match `password`. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439011", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "lastLogin": "2026-04-15T14:22:31.000Z" } } ``` ### Error Responses ```json 400 theme={null} { "success": false, "error": { "message": "Current password is incorrect" } } ``` ```json 409 theme={null} { "success": false, "error": { "message": "Email already in use" } } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/accounts" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "currentPassword": "myCurrentPassword123", "password": "newSecurePassword123", "confirmPassword": "newSecurePassword123" }' ``` ### More Examples **Change password** ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/accounts" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -d '{ "currentPassword": "old-password-123", "password": "new-secure-password-456", "confirmPassword": "new-secure-password-456" }' ``` # Update Fulfillment Event Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-fulfillment-event PUT /fulfillments/events/{eventId} Update an existing fulfillment event > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update an existing fulfillment event. `lineItemId` is required in the body to identify the parent line item. ## Path Parameters **eventId** `string` *required* Event ObjectId. ## Request Body **lineItemId** `string` *required* Parent line item ObjectId. **status** `string` One of `in_transit`, `out_for_delivery`, `delivered`, `failed_delivery`. **happenedAt** `string` ISO 8601 timestamp. **city** `string` **province** `string` **country** `string` **message** `string` ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439020", "status": "delivered" } } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/fulfillments/events/507f1f77bcf86cd799439020" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "lineItemId": "507f1f77bcf86cd799439015", "status": "delivered" }' ``` # Update My Vendor Address Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-my-address PUT /vendors/me/address Update the authenticated vendor's own address > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update the authenticated vendor's own business address. Requires a vendor-scoped token. ## Request Body **address1** `string` Street address line 1. **address2** `string` Street address line 2. **city** `string` **state** `string` **postalCode** `string` **country** `string` ## Response ```json 200 theme={null} { "success": true, "data": { /* updated address */ } } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/vendors/me/address" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "address1": "456 Oak Ave", "city": "Austin", "state": "TX", "postalCode": "78702", "country": "US" }' ``` # Update My Vendor Profile Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-my-profile PUT /vendors/me/profile Update the authenticated vendor's own profile > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update the authenticated vendor's own profile. Requires a vendor-scoped token. Vendors use this endpoint to maintain their storefront profile (description, social media, contact info, policies) without needing to know their own vendorId. ## Request Body The request body mirrors the profile object returned by `GET /v2/vendors/me/profile`. Only provided fields are updated. **information** `object` Business description, logos, banner, and business address. **socialMedia** `object` Social handles: `facebook`, `instagram`, `twitter`, `pinterest`, `youtube`, `linkedin`, `tiktok`, `website`. **contactInfo** `object` `email`, `phone`, `location`. **policies** `object` `shippingPolicy`, `returnsPolicy`. ## Response ```json 200 theme={null} { "success": true, "data": { /* updated profile */ } } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/vendors/me/profile" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "information": { "description": "Handmade artisan products" }, "socialMedia": { "instagram": "myshop" } }' ``` ### More Examples **Update multiple profile fields** ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/vendors/me/profile" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -d '{ "fields": [ {"field": "description", "value": "Premium organic produce, farm to table"}, {"field": "website", "value": "https://freshproduce.co"}, {"field": "shippingPolicy", "value": "Free shipping on orders over $50"} ] }' ``` # Update Product Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-product PUT /products/{productId} Full product update via Shopify productSet mutation > [!NOTE] > > **V2 Preview**: this endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview `PUT /products/{productId}` Updates one of **your own** products via Shopify's `productSet` mutation. `productId` can be a Shopify numeric id, a Shopify GID or a MongoDB ObjectId. Fields you leave out keep their current values. > [!WARNING] > > `variants`, `options`, `metafields` and `images` **replace** the stored arrays. Send the full desired set. ## Path parameters **productId** `string` *required*. Shopify numeric id, Shopify GID or MongoDB ObjectId of a product owned by your vendor. ## Request body `title`, `descriptionHtml`, `productType`, `vendor`, `brandName`, `status` (`ACTIVE` | `DRAFT` | `ARCHIVED`), `handle`, `tags[]`, `collections[]`, `options[]`, `variants[]`, `metafields[]`, `seo`, `category`, `templateSuffix`, `isDigital`, plus: * **`images[]`** (max 250): product images, `{ "src": "", "altText": "" }`. * **`medias[]`** (max 250): downloadable files for digital products. Leave it out to keep the current files. * **`descriptionHtml`**: send `""` to clear the description. * **`vendorId`** (optional): if sent, it must be **your own vendor id**. Any other vendor returns `403 FORBIDDEN` "Vendor tokens can only assign products to their own vendor". You can't move a product to another vendor. The body is **strict**: unknown fields return `400 VALIDATION_ERROR` with a hint. `media` → use `images` / `medias`; `published` → use `status`; `description` / `body_html` → use `descriptionHtml`. ## Responses | Status | When | | - | - | | 200 | Updated; `data` is the full product | | 400 | `VALIDATION_ERROR`: invalid or unsupported field | | 401 | Missing or invalid token | | 403 | `vendorId` is not your vendor, or the token lacks product write scope | | 404 | `NOT_FOUND` "Product not found" (not your product, or deleted) | ```json 200 Updated theme={null} { "success": true, "data": { "_id": "", "vendorStoreProductId": null, "assignedVendors": [], "tags": [ "vendor_Vendor-78" ], "collections": [], "variants": [ { "id": "gid://shopify/ProductVariant/", "price": "19.61", "sku": null, "inventoryItem": { "id": "gid://shopify/InventoryItem/" }, "selectedOptions": [ { "name": "Color", "value": "Red" } ], "metafields": { "edges": [] }, "title": "Red" } ], "options": [ { "id": "gid://shopify/ProductOption/", "name": "Color", "position": 1, "values": [ "Red" ] } ], "images": [], "medias": [], "shopifyMedias": [], "status": "draft", "metafields": [], "giftCard": false, "changes": [], "deletedAt": null, "healAttempts": 0, "lastHealAt": null, "shopId": "", "isDigital": false, "handle": "test-product-1-a2db36", "title": "Test Product 1", "descriptionHtml": "Test Description", "vendorId": "", "vendor": "Vendor-78", "productType": "", "updatedByPV": true, "request": null, "createdAt": "2026-09-15T06:19:18.450Z", "updatedAt": "2026-10-21T10:36:54.334Z", "totalInventory": 0, "__v": 0, "shopifyErrors": null, "graphqlProductId": "gid://shopify/Product/", "productId": "", "publishedAt": "2026-09-15T06:45:03.119Z", "brandName": "Vendor-78" } } ``` ```json 403 Another vendor theme={null} { "success": false, "error": { "code": "FORBIDDEN", "message": "Vendor tokens can only assign products to their own vendor" } } ``` ```json 400 Old media field theme={null} { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Validation failed", "errorId": "err_1792578578483_abc1234", "details": [ { "code": "unrecognized_keys", "keys": ["media"], "path": [], "message": "Unsupported field(s): media (use images for product images, medias for digital files)" } ] } } ``` ```json 404 theme={null} { "success": false, "error": { "code": "NOT_FOUND", "message": "Product not found" } } ``` ## Examples ```bash Update title, status and images theme={null} curl -X PUT "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013" \ -H "x-access-token: $PV_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Updated Product", "status": "ACTIVE", "images": [{ "src": "https://cdn.example.com/p.jpg", "altText": "Front" }] }' ``` ```bash Update title and tags theme={null} curl -X PUT "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013" \ -H "x-access-token: $PV_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Updated Product Name", "tags": ["new-tag", "sale"] }' ``` ```bash Clear the description theme={null} curl -X PUT "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013" \ -H "x-access-token: $PV_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "descriptionHtml": "" }' ``` # Update Product Inventory Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-product-inventory PATCH /products/{productId}/inventory Inventory-only update without touching product/variant data > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Inventory-only update designed for the vendor quick-view modal. Uses Shopify's `inventorySetQuantities` (absolute) or `inventoryAdjustQuantities` (delta) depending on `mode`. Does **not** touch product/variant metadata — only the on-hand count. ## Path Parameters **productId** `string` *required* Product ID (Shopify numeric, GID, or MongoDB ObjectId). ## Request Body **mode** `string` *required* `set` (absolute) or `adjust` (delta). **updates** `array` *required* Array of `{ variantId, locationId, quantity }` (for `set`) or `{ variantId, locationId, delta }` (for `adjust`). ## Response ```json 200 theme={null} { "success": true, "data": { "updated": 2, "errors": [] } } ``` ## Example ```bash theme={null} curl -X PATCH "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013/inventory" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "mode": "set", "updates": [ { "variantId": "gid://shopify/ProductVariant/1", "locationId": "gid://shopify/Location/1", "quantity": 50 } ] }' ``` ### More Examples **Set inventory to exact quantity** ```bash theme={null} curl -X PATCH "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013/inventory" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "mode": "set", "variants": [ { "variantId": "gid://shopify/ProductVariant/123", "locationId": "gid://shopify/Location/456", "quantity": 100 } ] }' ``` **Adjust inventory (add 10 units)** ```bash theme={null} curl -X PATCH "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013/inventory" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "mode": "adjust", "variants": [ { "variantId": "gid://shopify/ProductVariant/123", "locationId": "gid://shopify/Location/456", "quantity": 10 } ], "reason": "Restock from supplier" }' ``` # Update Product Status Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-product-status PATCH /products/{productId}/status Change a product's status to ACTIVE or DRAFT > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Change a product's status without updating any other fields. This is a lightweight way to publish or unpublish a product. Vendor tokens can only update their own products. If the shop has product approval enabled, setting status to `ACTIVE` may place the product into a `pending` state instead, requiring merchant approval before it goes live. ### Use Cases * Publish a draft product to the storefront * Temporarily unpublish a product by switching it to draft * Quickly toggle product visibility without a full product update ### Required Scope `products:write` ## Path Parameters **productId** `string` *required* Product ID (Shopify numeric, GID, or MongoDB ObjectId). ## Request Body **status** `string` *required* The new status. Must be one of `ACTIVE` or `DRAFT`. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "507f1f77bcf86cd799439013", "title": "Organic Cotton Tee", "status": "active" } } ``` ```json 403 theme={null} { "success": false, "error": { "message": "Updating products is disabled for this vendor", "code": "FORBIDDEN" } } ``` ```json 404 theme={null} { "success": false, "error": { "message": "Product not found", "code": "PRODUCT_NOT_FOUND" } } ``` ## Example ```bash theme={null} curl -X PATCH "https://production-api.puppetvendors.com/products/507f1f77bcf86cd799439013/status" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{"status": "ACTIVE"}' ``` # Update Profile Settings Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-profile-settings PUT /settings/profiles Update the vendor's storefront profile using strict tab-based sections > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update the authenticated vendor's profile settings using strict tab-based payload sections. Unknown fields are rejected. Social-media values are normalized to https URLs where applicable. Vendor scope required. ## Request Body **information** `object` `businessLogo`, `businessLogoId`, `profileBanner`, `profileBannerId`, `description`, `profileDescription`, `businessAddress { address1, address2, city, state, postalCode, country }`. **socialMedia** `object` `facebook`, `instagram`, `twitter`, `pinterest`, `snapchat`, `youtube`, `linkedin`, `whatsapp`, `tiktok`, `website`. **contactInfo** `object` `email`, `phone`, `location`. **policies** `object` `shippingPolicy`, `returnsPolicy`. **vacation** `object` `enabled` (boolean), `timeRange` (2-element array of date strings), `message`. **others** `object` `hasTax` (boolean), `vendorTaxRate` (number 0–100). ## Response ```json 200 theme={null} { "success": true, "data": { /* updated profile sections */ } } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/profiles" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "information": { "description": "Handmade artisan products" }, "socialMedia": { "instagram": "myshop", "website": "example.com" }, "vacation": { "enabled": true, "timeRange": ["04/01/2026", "04/10/2026"], "message": "Back soon" }, "others": { "hasTax": true, "vendorTaxRate": 8.25 } }' ``` ### More Examples **Update business info and social media** ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/profiles" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -d '{ "information": { "description": "Premium handcrafted goods since 2020", "businessAddress": "123 Artisan Way, Portland, OR" }, "socialMedia": { "instagram": "https://instagram.com/acmeco", "website": "https://acmeco.com" } }' ``` **Set vacation mode** ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/profiles" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -d '{ "vacation": { "enabled": true, "timeRange": ["2026-06-15T00:00:00Z", "2026-07-01T00:00:00Z"], "message": "We'\''re on vacation! Orders placed now will ship after July 1st." } }' ``` # Update Shipping Dimension Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-shipping-dimension PUT /shipping/dimensions/{shippingDimensionsId} Update an existing shipping dimension preset > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update an existing shipping dimension preset. All fields are optional -- only the provided fields are updated. ### Use Cases * Correct packaging dimensions for a preset * Rename a dimension preset * Change the unit of measurement ## Path Parameters **shippingDimensionsId** `string` *required* The ID of the shipping dimension preset to update. ## Request Body **type** `string` Dimension type. Must be `generic` or `productSpecific`. **productId** `string` Shopify product ID. **title** `string` A human-readable name for the preset. **dimensionUnit** `string` Unit of measurement. Must be one of: `in`, `cm`, `mm`, `ft`, `m`, `yd`. **heightValue** `number` Package height. Minimum 0. **widthValue** `number` Package width. Minimum 0. **lengthValue** `number` Package length. Minimum 0. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "665a1b2e3d98f0001a2b3c52", "type": "generic", "title": "Medium Box (Updated)", "dimensionUnit": "in", "heightValue": 9, "widthValue": 10, "lengthValue": 12 } } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/shipping/dimensions/665a1b2e3d98f0001a2b3c52" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Medium Box (Updated)", "heightValue": 9 }' ``` # Update Shipping Rates Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-shipping-rates PUT /settings/shipping/rates Set or update the vendor's shipping rate configuration > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Set or update the vendor's shipping rate configuration. Choose a calculation method and provide the relevant details. Vendor scope required. ## Request Body **method** `string` *required* One of `order`, `lineItem`, `orderRange`, `orderWeight`, `realtime`. **amount** `number` Fixed amount — required when `method` is `order` or `lineItem`. **ranges** `array` Array of `{ from, to, rate }` — required when `method` is `orderRange` or `orderWeight` (grams for weight). **warehouseId** `integer` Warehouse index to ship from — used when `method` is `realtime`. **realtimeOption** `string` `fastest` or `cheapest` — used when `method` is `realtime`. ## Response ```json 200 theme={null} { "success": true } ``` ## Examples ```bash Fixed per order theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/shipping/rates" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "method": "order", "amount": 7.99 }' ``` ```bash Weight ranges (grams) theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/shipping/rates" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "method": "orderWeight", "ranges": [ { "from": 0, "to": 500, "rate": 3.5 }, { "from": 500, "to": 2000, "rate": 7 } ] }' ``` ```bash Realtime carrier rates theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/shipping/rates" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "method": "realtime", "warehouseId": 0, "realtimeOption": "cheapest" }' ``` ### More Examples **Flat rate per order** ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/shipping/rates" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_TOKEN" \ -d '{"method": "order", "amount": 5.99}' ``` **Weight-based ranges** ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/shipping/rates" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_TOKEN" \ -d '{ "method": "orderWeight", "ranges": [ {"from": 0, "to": 1, "rate": 4.99}, {"from": 1, "to": 5, "rate": 9.99}, {"from": 5, "to": 50, "rate": 14.99} ] }' ``` **Real-time rates from warehouse** ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/shipping/rates" \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_TOKEN" \ -d '{"method": "realtime", "warehouseId": "507f1f77bcf86cd799439012", "realtimeOption": "cheapest"}' ``` # Update Team Member Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-team-member PUT /settings/team/{userId} Update an existing team member's details or permissions > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update an existing team member's profile, password, or permissions. All fields are optional -- only provided fields are updated. ### Use Cases * Update a team member's permissions as their role changes * Reset a team member's password * Correct profile information ## Path Parameters **userId** `string` *required* The team member's user ID. ## Request Body **email** `string` Updated email address. Must be a valid email format. **password** `string` New password. Minimum 6 characters, maximum 100 characters. **profile** `object` Profile information. **profile.firstName** `string` First name. Maximum 100 characters. **profile.lastName** `string` Last name. Maximum 100 characters. **profile.phone** `string` Phone number. Maximum 50 characters. **apiPermissions** `string[]` Updated array of permission strings. Replaces the existing permissions entirely. ## Response ```json 200 theme={null} { "success": true, "data": { "_id": "665a1b2e3d98f0001a2b3c81", "email": "bob@example.com", "profile": { "firstName": "Bob", "lastName": "Smith", "phone": "+15125559876" }, "apiPermissions": [ "orders:read", "orders:write", "fulfillments:write" ], "updatedAt": "2026-05-19T14:00:00.000Z" } } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/team/665a1b2e3d98f0001a2b3c81" \ -H "x-access-token: YOUR_VENDOR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "apiPermissions": ["orders:read", "orders:write", "fulfillments:write"] }' ``` # Update Warehouse Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/update-warehouse PUT /settings/shipping/warehouses/{index} Update an existing warehouse at the given index > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Update an existing warehouse / location at the given zero-based index. Only provided fields are updated. Vendor scope required. > [!WARNING] > > Warehouse updates are indexed by **zero-based array position**, not by `locationId`. Use `GET /v2/settings/shipping/warehouses` to determine the current index order. ## Path Parameters **index** `integer` *required* Zero-based index of the warehouse to update. ## Request Body **name** `string` Max 200 chars. **address1** `string` Max 500 chars. **address2** `string` Max 500 chars. **city** `string` Max 200 chars. **province** `string` Max 200 chars. **zip** `string` Max 50 chars. **country** `string` Max 200 chars. ## Response ```json 200 theme={null} { "success": true } ``` ## Example ```bash theme={null} curl -X PUT "https://production-api.puppetvendors.com/settings/shipping/warehouses/0" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "name": "Updated Warehouse Name" }' ``` # Upload Product Media Source: https://dev.puppetvendors.com/api-reference/v2/vendor/endpoint/upload-product-media POST /products/media Upload media to Shopify staging for later use in product creation > [!NOTE] > > **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur. ## Overview Upload media to Shopify staging for later use in product creation. Returns a staged upload URL, HTTP parameters to POST the binary to, and a `resourceUrl` that can be passed into subsequent `productSet` calls. ## Request Body See `ProductMediaUploadRequest` in the OpenAPI spec. Typical fields: **filename** `string` *required* **mimeType** `string` *required* E.g. `image/png`, `image/jpeg`, `video/mp4`. **resource** `string` *required* Shopify resource type — usually `IMAGE` or `VIDEO`. **fileSize** `string` Size in bytes (some MIME types require this). ## Response ```json 200 theme={null} { "success": true, "data": { "url": "https://shopify-staged-uploads.storage.googleapis.com/...", "resourceUrl": "gid://shopify/StagedUploadTarget/...", "parameters": { "Content-Type": "image/png", "acl": "private" } } } ``` ## Example ```bash theme={null} curl -X POST "https://production-api.puppetvendors.com/products/media" \ -H "x-access-token: YOUR_VENDOR_JWT" \ -H "Content-Type: application/json" \ -d '{ "filename": "hero.png", "mimeType": "image/png", "resource": "IMAGE" }' ``` # Error Handling Source: https://dev.puppetvendors.com/api-reference/v2/vendor/errors Standard error responses in the V2 Vendor API > [!NOTE] > > **V2 Preview** — This error format is part of the V2 API preview. Breaking changes may occur. ## Overview All V2 API endpoints return a consistent error format. Errors always include `success: false` and an `error` object with a human-readable `message` and a machine-readable `code`. ## Error Response Format ```json theme={null} { "success": false, "error": { "message": "Invalid API key", "code": "UNAUTHORIZED" } } ``` ## Error Codes | Code | HTTP Status | Description | Retry? | | - | - | - | - | | `UNAUTHORIZED` | 401 | Invalid API key, expired token, revoked key, or inactive shop | No — re-authenticate or fix the key | | `FORBIDDEN` | 403 | Accessing another vendor's data, unapproved account, or insufficient scope | No — check your permissions | | `NOT_FOUND` | 404 | Requested resource does not exist | No — verify the resource ID | | `VALIDATION_ERROR` | 400 | Request body or query parameters failed validation | No — fix the request | | `FULFILLMENT_FAILED` | 400 | Fulfillment creation failed (e.g., invalid line items) | No — fix the request | | `CONFLICT` | 409 | Resource creation/update conflict | No — check resource state | | `RATE_LIMITED` | 429 | Exceeded 100 requests/minute per IP | Yes — exponential backoff | | `INTERNAL_SERVER_ERROR` | 500 | Unexpected server error | Yes — retry up to 3 times with backoff | ## HTTP Status Codes | Status | Description | | - | - | | **200** | Success | | **201** | Resource created | | **400** | Bad request — invalid parameters or missing required fields | | **401** | Unauthorized — missing, invalid, or expired token | | **403** | Forbidden — accessing another vendor's data or insufficient scope | | **404** | Not found — resource does not exist | | **409** | Conflict — resource creation/update conflict | | **429** | Too many requests — rate limit exceeded | | **500** | Internal server error | ## Validation Errors When request validation fails, the `message` field describes which fields are invalid: ```json theme={null} { "success": false, "error": { "message": "createdAtMin must be a valid ISO 8601 date", "code": "VALIDATION_ERROR" } } ``` ## Rate Limiting The API allows **100 requests per minute per IP address**. The limit is per IP, not per API key. The API returns standard `RateLimit-*` headers on every response. When you exceed the limit: ```json theme={null} { "success": false, "error": { "message": "Too many requests, please try again later", "code": "RATE_LIMITED" } } ``` Implement exponential backoff — wait 1s, then 2s, then 4s between retries. ## Retry Guidance | Status | Should Retry? | Strategy | | - | - | - | | **400, 401, 403, 404, 409** | No | Fix the request — these are client errors | | **429** | Yes | Exponential backoff. Check `RateLimit-*` response headers | | **500** | Yes | Retry up to 3 times with exponential backoff. If persistent, contact support | # V2 Vendor API Introduction Source: https://dev.puppetvendors.com/api-reference/v2/vendor/introduction Overview of the PuppetVendors V2 Vendor API (Alpha) > [!NOTE] > > **V2 Preview** — The V2 API is actively being developed. We aim for stability but breaking changes may occasionally occur. ## Overview The PuppetVendors V2 Vendor API gives vendors direct, secure access to their own data — orders, products, fulfillments, payouts, and more — without going through the merchant. Vendor-scoped tokens are automatically restricted to the authenticated vendor's data. There is no way for a vendor token to access another vendor's resources. **Base URL:** `https://production-api.puppetvendors.com` > [!NOTE] > > **For AI agents and tooling:** [OpenAPI 3.1 spec](https://production-api.puppetvendors.com/resources/openapi.yaml) | [Postman Collection](https://production-api.puppetvendors.com/resources/PuppetVendors_V2_Vendor_API.postman_collection.json) ## Getting Started 1. **Get your vendor API key** — Create one in the vendor portal or ask your merchant for a key (prefixed `vk_`) 2. **Authenticate** — Exchange your key for a JWT token via `POST /authenticate` 3. **Make requests** — Pass the token in the `x-access-token` header See the [Authentication guide](/api-reference/v2/vendor/authentication) and [API Keys & Scopes](/api-reference/v2/vendor/api-keys-scopes) for details. ## Vendor Resources > **[Orders](/api-reference/v2/endpoint/vendor-list-orders)** > > View, export, and track your orders > **[Products](/api-reference/v2/endpoint/vendor-list-products)** > > Create, update, and manage your products > **[Fulfillments](/api-reference/v2/endpoint/vendor-list-fulfillments)** > > Create, update, and track fulfillments > **[Documents](/api-reference/v2/vendor/endpoint/generate-invoice)** > > Generate invoices, packing slips, and shipping labels > **[Payouts](/api-reference/v2/endpoint/vendor-list-payouts)** > > Track payouts, transactions, and pending balances > **[Shipping](/api-reference/v2/vendor/endpoint/get-shipping-rates-op)** > > Get rates, purchase labels, manage dimensions > **[Customers](/api-reference/v2/endpoint/vendor-list-customers)** > > View customers who purchased your products > **[Discounts](/api-reference/v2/endpoint/vendor-list-discounts)** > > Manage your discount codes > **[Integrations](/api-reference/v2/vendor/endpoint/list-integrations)** > > Connect Shippo, ShipStation, PayPal, and Stripe > **[Profile & Settings](/api-reference/v2/vendor/endpoint/get-my-profile)** > > Update your profile, address, and account settings ## Unscoped Endpoints Some endpoints work with any valid vendor token — no specific scope required on your API key: **Discounts**, **Profile**, **Settings** (account, shipping, team), **Integrations** (Shippo, ShipStation, PayPal, Stripe), and **Documents** (invoices, packing slips, shipping labels). See [API Keys & Scopes](/api-reference/v2/vendor/api-keys-scopes) for the full breakdown. ## Rate Limits The API is rate-limited to **100 requests per minute per IP address**. The limit is per IP, not per API key — if your agent runs in a shared environment (Lambda, Vercel, CI), all consumers on that IP share the 100/min budget. The API returns standard `RateLimit-*` headers on every response. On HTTP 429, implement exponential backoff before retrying. ## Need Help? Contact [support@puppetvendors.com](mailto:support@puppetvendors.com) for API access or questions. # Pagination Source: https://dev.puppetvendors.com/api-reference/v2/vendor/pagination Cursor-based pagination in the V2 Vendor API > [!NOTE] > > **V2 Preview** — This pagination model is part of the V2 API preview. Breaking changes may occur. ## Overview The V2 API uses **cursor-based pagination** (Relay-style) instead of offset-based pagination. Cursors provide stable, consistent results even when data is being added or removed between requests. ## Pagination Parameters | Parameter | Type | Description | | - | - | - | | `first` | integer (1–100) | Number of items to return (forward pagination) | | `after` | string | Cursor to start after (forward pagination) | | `last` | integer (1–100) | Number of items to return (backward pagination) | | `before` | string | Cursor to start before (backward pagination) | Default page size is **20** items. Maximum is **100**. > [!WARNING] > > You cannot combine `first` with `last`, or `after` with `before`, in the same request. ## Response Format All paginated endpoints return a `pageInfo` object alongside the data: ```json theme={null} { "success": true, "data": { "items": [ ... ], "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "startCursor": "eyJpZCI6IjY1YTFiMmMzZDRlNWY2... ", "endCursor": "eyJpZCI6IjY1YTFiMmMzZDRlNWY3..." }, "totalCount": 150 } } ``` | Field | Type | Description | | - | - | - | | `hasNextPage` | boolean | Whether more items exist after this page | | `hasPreviousPage` | boolean | Whether more items exist before this page | | `startCursor` | string \| null | Cursor of the first item in this page | | `endCursor` | string \| null | Cursor of the last item in this page | | `totalCount` | integer | Total number of matching items (when available) | ## Forward Pagination Fetch the first page, then use `endCursor` to get the next: ```bash theme={null} # First page of your orders curl "https://production-api.puppetvendors.com/orders?first=10" \ -H "x-access-token: YOUR_VENDOR_TOKEN" # Next page (use endCursor from previous response) curl "https://production-api.puppetvendors.com/orders?first=10&after=eyJpZCI6IjY1YTF..." \ -H "x-access-token: YOUR_VENDOR_TOKEN" ``` ## Backward Pagination Use `last` and `before` to paginate backwards: ```bash theme={null} # Last 10 items before a cursor curl "https://production-api.puppetvendors.com/orders?last=10&before=eyJpZCI6IjY1YTF..." \ -H "x-access-token: YOUR_VENDOR_TOKEN" ``` ## Full Iteration Example ```javascript theme={null} const BASE_URL = 'https://production-api.puppetvendors.com'; let hasMore = true; let cursor = null; while (hasMore) { const params = cursor ? `first=50&after=${cursor}` : 'first=50'; const response = await fetch(`${BASE_URL}/orders?${params}`, { headers: { 'x-access-token': VENDOR_TOKEN } }); const { data } = await response.json(); // Process your orders for (const order of data.items) { console.log(order.orderName); } hasMore = data.pageInfo.hasNextPage; cursor = data.pageInfo.endCursor; } ``` ## Python Example ```python theme={null} import requests BASE_URL = "https://production-api.puppetvendors.com" headers = {"x-access-token": VENDOR_TOKEN} cursor = None while True: params = {"first": 50} if cursor: params["after"] = cursor resp = requests.get(f"{BASE_URL}/orders", headers=headers, params=params) data = resp.json()["data"] for order in data["items"]: print(order["orderName"]) if not data["pageInfo"]["hasNextPage"]: break cursor = data["pageInfo"]["endCursor"] ``` # Quick Start Source: https://dev.puppetvendors.com/api-reference/v2/vendor/quickstart Get up and running with the PuppetVendors Vendor API in 5 minutes ## Overview This guide walks you through making your first API calls. By the end, you'll have listed your orders and created a product. ## Prerequisites * A vendor API key (starts with `vk_`) — get one from your merchant or create one in **Settings > API Keys** * A tool to make HTTP requests: `curl`, Postman, Insomnia, or any programming language ## Step 1: Authenticate Exchange your API key for a JWT token: ```bash cURL theme={null} curl -X POST https://production-api.puppetvendors.com/authenticate \ -H "Content-Type: application/json" \ -d '{"apiKey": "vk_live_YOUR_API_KEY"}' ``` ```python Python theme={null} import requests resp = requests.post( "https://production-api.puppetvendors.com/authenticate", json={"apiKey": "vk_live_YOUR_API_KEY"} ) token = resp.json()["data"]["token"] ``` ```javascript JavaScript theme={null} const resp = await fetch("https://production-api.puppetvendors.com/authenticate", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ apiKey: "vk_live_YOUR_API_KEY" }) }); const { data } = await resp.json(); const token = data.token; ``` **Response:** ```json theme={null} { "success": true, "data": { "token": "eyJhbGciOiJIUzI1NiIs...", "expiresIn": 86400, "scope": "vendor", "permissions": ["orders:read", "products:read", "products:write"], "shopDomain": "my-store.myshopify.com", "mode": "live" } } ``` Save the `token` value — you'll use it for all subsequent requests. It expires in 24 hours. The `permissions` array shows which scopes your key has. ## Step 2: List Your Orders ```bash cURL theme={null} curl "https://production-api.puppetvendors.com/orders?first=5" \ -H "x-access-token: YOUR_TOKEN" ``` ```python Python theme={null} resp = requests.get( "https://production-api.puppetvendors.com/orders", params={"first": 5}, headers={"x-access-token": token} ) orders = resp.json()["data"]["items"] for order in orders: print(f"#{order['orderNumber']} — ${order['totalSales']}") ``` ```javascript JavaScript theme={null} const resp = await fetch("https://production-api.puppetvendors.com/orders?first=5", { headers: { "x-access-token": token } }); const { data } = await resp.json(); data.items.forEach(order => console.log(`#${order.orderNumber} — $${order.totalSales}`)); ``` **Response:** ```json theme={null} { "success": true, "data": { "items": [ { "_id": "665a1b2c3d4e5f6a7b8c9d0e", "orderNumber": 1042, "orderName": "#1042", "totalSales": 149.99, "status": "fulfilled", "createdAt": "2026-05-15T10:30:00Z" } ], "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "endCursor": "eyJpZCI6IjY2NWExYjJj..." }, "totalCount": 156 } } ``` ## Step 3: Create a Product ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/products \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_TOKEN" \ -d '{ "title": "Classic Cotton T-Shirt", "descriptionHtml": "

Soft, breathable cotton tee.

", "productType": "Apparel", "tags": ["cotton", "t-shirt", "summer"], "status": "DRAFT", "variants": [ { "title": "Small / Blue", "price": "29.99", "sku": "TEE-BLU-S", "inventoryQuantity": 50, "weight": 0.3, "weightUnit": "KILOGRAMS" }, { "title": "Medium / Blue", "price": "29.99", "sku": "TEE-BLU-M", "inventoryQuantity": 75, "weight": 0.35, "weightUnit": "KILOGRAMS" } ], "options": [ {"name": "Size", "values": ["Small", "Medium"]}, {"name": "Color", "values": ["Blue"]} ] }' ``` ## Step 4: Create a Fulfillment Once an order is ready to ship: ```bash theme={null} curl -X POST https://production-api.puppetvendors.com/fulfillments \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_TOKEN" \ -d '{ "lineItemIds": ["665a1b2c3d4e5f6a7b8c9d0e"], "trackingNumber": "1Z999AA10123456784", "shippingCarrier": "UPS", "trackingUrl": "https://www.ups.com/track?tracknum=1Z999AA10123456784", "notifyCustomer": true }' ``` ## Step 5: Check Your Payout Summary ```bash theme={null} curl "https://production-api.puppetvendors.com/payouts/summary" \ -H "x-access-token: YOUR_TOKEN" ``` **Response:** ```json theme={null} { "success": true, "data": { "totalReceived": 12500.00, "totalPending": 3200.00, "totalScheduled": 1500.00, "currency": "USD", "previousPayout": { "amount": 5000.00, "status": "paid", "date": "2026-05-01T00:00:00Z" }, "nextPayout": { "amount": 1500.00, "estimatedDate": "2026-06-01T00:00:00Z", "type": "automated" } } } ``` ## Common Patterns ### Filtering Most list endpoints support filters via query parameters: ```bash theme={null} # Orders from the last 7 days curl "https://production-api.puppetvendors.com/orders?first=20&startDate=2026-05-12T00:00:00Z&status=pending" \ -H "x-access-token: YOUR_TOKEN" # Products that are out of stock curl "https://production-api.puppetvendors.com/products?first=50&inventoryStatus=outOfStock" \ -H "x-access-token: YOUR_TOKEN" ``` ### Pagination All list endpoints use cursor-based pagination. See the [Pagination guide](/api-reference/v2/vendor/pagination) for details. ```bash theme={null} # Page 1 curl "https://production-api.puppetvendors.com/orders?first=20" \ -H "x-access-token: YOUR_TOKEN" # Page 2 (use endCursor from previous response) curl "https://production-api.puppetvendors.com/orders?first=20&after=eyJpZCI6..." \ -H "x-access-token: YOUR_TOKEN" ``` ### Exporting to CSV Many endpoints have an `/export` variant that returns a CSV file: ```bash theme={null} # Download orders as CSV curl "https://production-api.puppetvendors.com/orders/export?startDate=2026-05-01T00:00:00Z" \ -H "x-access-token: YOUR_TOKEN" \ -o orders.csv ``` Export responses can be: * **200** — CSV data streamed directly * **202** — Export queued (large datasets), check back later * **204** — No data matches your filters ### Generating Documents Each document type has its own endpoint — simple and clear: ```bash theme={null} # Generate an invoice curl -X POST https://production-api.puppetvendors.com/documents/invoice \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_TOKEN" \ -d '{"orderIds": [1042, 1043]}' # Generate a packing slip curl -X POST https://production-api.puppetvendors.com/documents/packing-slip \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_TOKEN" \ -d '{"orderIds": [1042]}' # Generate a shipping label curl -X POST https://production-api.puppetvendors.com/documents/shipping-label \ -H "Content-Type: application/json" \ -H "x-access-token: YOUR_TOKEN" \ -d '{"orderIds": [1042]}' ``` All document endpoints return a temporary URL: ```json theme={null} { "success": true, "data": { "url": "https://s3.amazonaws.com/...", "expiresAt": "2026-05-19T12:00:00Z" } } ``` ## Postman / Insomnia Download our ready-to-import collection: > **[Download Postman Collection](https://production-api.puppetvendors.com/resources/PuppetVendors_V2_Vendor_API.postman_collection.json)** > > Import into Postman or Insomnia. Set your `api_key` variable and hit Authenticate — all other requests auto-use the token. ## Error Handling All errors follow the same format: ```json theme={null} { "success": false, "error": { "message": "Human-readable error description", "code": "ERROR_CODE", "details": {} } } ``` Common HTTP status codes: | Status | Meaning | What to Do | | - | - | - | | 400 | Bad request (validation error) | Check the `details` field for which parameter failed | | 401 | Token expired or missing | Re-authenticate with `POST /authenticate` | | 403 | Insufficient scope | Your API key doesn't have the required scope | | 404 | Resource not found | Verify the ID exists and belongs to your vendor account | | 429 | Rate limited | Wait and retry — limit is 100 requests/minute | | 500 | Server error | Retry after a brief delay, contact support if persistent | ## For AI Agents This API is designed to be AI-agent friendly: * **OpenAPI 3.1 spec** available at [`/resources/openapi.yaml`](https://production-api.puppetvendors.com/resources/openapi.yaml) — import it to understand all endpoints, schemas, and constraints * **Consistent response format** — every response has `{success, data, error?}` * **Cursor-based pagination** — no page drift when data changes * **Scoped API keys** — create keys with minimal permissions for your agent * **Postman collection** — auto-generates working requests for every endpoint # PuppetVendors API Source: https://dev.puppetvendors.com/index Public REST API for the PuppetVendors multi-vendor marketplace platform ## Overview The PuppetVendors API allows you to programmatically manage vendors, users, orders, products, payouts, fulfillments, commissions, and reports for your multi-vendor Shopify store. **Base URL:** `https://api.puppetvendors.com` ## Resources > **[Authentication](/api-reference/authentication)** > > Exchange your API key for a JWT token > **[Vendors](/api-reference/endpoint/list-vendors)** > > Manage vendor accounts, profiles, and addresses > **[Users](/api-reference/endpoint/list-users)** > > Create and manage vendor portal user accounts > **[Orders](/api-reference/endpoint/get-order)** > > Retrieve orders and calculated line items > **[Products](/api-reference/endpoint/list-products)** > > List products with inventory and variant details > **[Payouts](/api-reference/endpoint/list-payouts)** > > Track vendor payout balances and payment status > **[Fulfillments](/api-reference/endpoint/list-fulfillments)** > > Monitor and create order fulfillments > **[Commissions](/api-reference/endpoint/get-commissions-by-vendor)** > > View commission rates by vendor or SKU > **[Reports](/api-reference/endpoint/get-reports)** > > Pull vendor sales and earnings reports > **[Line Items](/api-reference/endpoint/update-line-items)** > > Update report data, COGS, and trigger recalculations ## Rate Limits The API is rate-limited to **100 requests per minute** per IP address. Exceeding this limit returns HTTP 429. ## Authentication All endpoints require a JWT token. Get started by exchanging your API key at [`POST /v1/authenticate`](/api-reference/authentication). ## Need Help? Contact [support@puppetvendors.com](mailto:support@puppetvendors.com) for API access or questions.