API Documentation

v1.0
REST API - Developer Documentation

digages-smv / trybebox

Complete reference for all REST API endpoints powering the vendor marketplace. Covers authentication, vendor registration, products, dashboard, earnings, orders, store items, bank info, and pinned banners.

14Sections
40+Endpoints
BasicAuth Method
https://testing.digages.com/wp-json/digages-smv/v1
1

Getting Started

Base URL

All API routes are prefixed with:

HTTP
https://testing.digages.com/wp-json/digages-smv/v1
Replace with your actual WordPress domain. Pretty permalinks must be enabled in WP Admin → Settings → Permalinks → Save.

Authentication

All protected endpoints require HTTP Basic Authentication using WordPress Application Passwords (WP 5.6+). Every request must include an Authorization header.

HTTP
Authorization: Basic <base64(username:app_password)>

The auth_header value is returned by both /vendor/register and /login. Store it securely - shown only once on first creation.

🔑 Stored Token No token stored - use /login or /vendor/register to get one

Application Passwords on localhost

WordPress disables Application Passwords on non-HTTPS environments. Add this to your functions.php while developing locally:

PHP
add_filter( 'wp_is_application_passwords_available', '__return_true' );

Request Format

HTTP
Content-Type: application/json
Accept: application/json

File upload endpoints use multipart/form-data - see individual endpoint docs.

Response Format

JSON
// Success
{
  "success": true,
  "data": { ... }
}

// Error
{
  "success": false,
  "code": "machine_readable_code",
  "message": "Human readable error message."
}
2

Auth - Login & Logout

Authenticate with WordPress credentials to receive an Application Password token used for all subsequent requests.

POST /login Authenticate and receive auth token

Authenticates a user and returns an Application Password token. Store the returned auth_header - it is the Authorization header value for all subsequent requests.

Request Body
ParameterTypeRequiredDescription
usernamestringrequiredWordPress username or email address
passwordstringrequiredWordPress account password
app_namestringoptionalToken scope name. Default: "digages-smv-app"
rememberbooloptionalUnused flag for future session control
Example Request
HTTP
POST /wp-json/digages-smv/v1/login
Content-Type: application/json

{
  "username": "john@example.com",
  "password": "MySecurePass123",
  "app_name": "my-mobile-app"
}
Success Response 200
JSON
{
  "success": true,
  "user_id": 5,
  "user_email": "john@example.com",
  "display_name": "John Doe",
  "roles": ["trybebox_vendor"],
  "token_type": "Basic",
  "app_uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "app_password": "ABCD 1234 efgh ijkl mnop qrst",
  "auth_header": "am9obkBleGFtcGxlLmNvbTpBQkNE...",
  "is_new_token": true,
  "dashboard_url": "https://yoursite.com/dashboard/"
}
If is_new_token is false, app_password and auth_header are null - use your already-stored token.
Try it live
POST /logout Revoke Application Password token

Revokes the Application Password token for the authenticated user. Requires Authorization header.

Request Body
ParameterTypeRequiredDescription
app_namestringoptionalThe app name used when logging in. Default: "digages-smv-app"
Example Request
HTTP
POST /wp-json/digages-smv/v1/logout
Authorization: Basic am9obkBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{"app_name": "my-mobile-app"}
Success Response 200
JSON
{"success": true, "message": "Logged out successfully."}
Try it live
3

Vendor Registration

Three-step onboarding flow. Step 1 creates the account and returns an auth token so steps 2 and 3 can be called immediately. Files must be uploaded before steps 2/3 - upload returns an attachment_id which is then passed into the step endpoints.

POST/vendor/registerCreate vendor account (public)

Creates a new vendor account. Public endpoint - no auth required. Returns an auth token immediately so steps 2 & 3 can follow without a separate login.

Request Body / Parameters
ParameterTypeRequiredDescription
first_namestringrequiredVendor first name
last_namestringrequiredVendor last name
emailstringrequiredEmail address (used as username)
passwordstringrequiredAccount password
app_namestringoptionalToken scope name. Default: "digages-smv-app"
Example Request
HTTP
POST /wp-json/digages-smv/v1/vendor/register
Content-Type: application/json

{
  "first_name": "Jane",
  "last_name": "Smith",
  "email": "jane@example.com",
  "password": "SecurePass123!",
  "app_name": "my-vendor-app"
}
Example Response
JSON
{
  "success": true,
  "user_id": 12,
  "auth_header": "amFuZUBleGFtcGxlLmNvbTpBQkNE...",
  "app_password": "ABCD 1234 efgh ijkl mnop qrst",
  "next_step": "/wp-json/digages-smv/v1/vendor/step/2"
}
Store auth_header immediately - it is only returned on first registration.
Try it live
Live response
POST/vendor/step/2Save store name & link

Saves store name and store link. Requires auth.

Request Body / Parameters
ParameterTypeRequiredDescription
store_namestringrequiredPublic display name of the store
store_linkstringrequiredURL slug - must be unique (e.g. "janes-boutique")
terms_agreeboolrequiredMust be true to proceed
Example Request
HTTP
POST /wp-json/digages-smv/v1/vendor/step/2
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "store_name": "Jane's Boutique",
  "store_link": "janes-boutique",
  "terms_agree": true
}
Example Response
JSON
{"success": true, "message": "Step 2 saved successfully.", "next_step": "/vendor/step/3"}
Try it live
Live response
POST/vendor/step/3Save store profile

Saves store profile. Pass draft=true to save without completing the step.

Request Body / Parameters
ParameterTypeRequiredDescription
store_headingstringrequiredStore heading / tagline
biostringrequiredStore bio / description
video_typestringrequired"upload" or "youtube"
youtube_linkstringconditionalRequired when video_type is "youtube"
banner_attachment_idintegeroptionalAttachment ID from /vendor/upload
profile_attachment_idintegeroptionalAttachment ID from /vendor/upload
video_attachment_idintegerconditionalRequired when video_type is "upload"
draftbooloptionaltrue = save without completing step
Example Request
HTTP
POST /wp-json/digages-smv/v1/vendor/step/3
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "store_heading": "Quality Products Only",
  "bio": "We sell the best handmade items.",
  "video_type": "youtube",
  "youtube_link": "https://youtube.com/watch?v=xxx"
}
Example Response
JSON
{"success": true, "message": "Store setup complete."}
Try it live
Live response
POST/vendor/uploadUpload file (banner/profile/video)

Uploads a file to the media library. Returns an attachment_id to pass into step/2 or step/3. Send as multipart/form-data.

Request Body / Parameters
ParameterTypeRequiredDescription
file_keystringrequired"banner_picture", "profile_picture", or "welcome_video"
[file_key]filerequiredThe actual file binary (field name matches file_key value)
Example Request
HTTP
POST /wp-json/digages-smv/v1/vendor/upload
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: multipart/form-data

file_key=banner_picture
banner_picture=@/path/to/banner.jpg
Example Response
JSON
{
  "success": true,
  "attachment_id": 88,
  "url": "https://yoursite.com/wp-content/uploads/banner.jpg",
  "filename": "banner.jpg",
  "size": 204800
}
DELETE/vendor/upload/{id}Delete uploaded attachment

Permanently deletes an uploaded attachment. Requires auth.

Example Request
HTTP
DELETE /wp-json/digages-smv/v1/vendor/upload/88
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{"success": true, "message": "Attachment deleted."}
GET/vendor/check-store?store_name={slug}Check store slug availability (public)

Check whether a store slug is available. Public endpoint - no auth required.

Request Body / Parameters
ParameterTypeRequiredDescription
store_namestringrequiredThe slug to check (URL query param)
Example Request
HTTP
GET /wp-json/digages-smv/v1/vendor/check-store?store_name=janes-boutique
Example Response
JSON
{"available": true, "status": "available", "message": "Store link is available."}
4

Vendor Profile - Edit

Three endpoints to update different sections of a vendor's profile. All fields in PUT requests are optional - only fields that are sent are updated. All require authentication. Response always returns full refreshed profile.

PUT/vendor/accountUpdate first name & last name

Updates the vendor's first name and/or last name.

Request Body / Parameters
ParameterTypeRequiredDescription
first_namestringoptionalVendor first name
last_namestringoptionalVendor last name
Example Request
HTTP
PUT /wp-json/digages-smv/v1/vendor/account
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "first_name": "Jane",
  "last_name": "Cooper"
}
Example Response
JSON
{
  "success": true,
  "updated": {"first_name": "Jane", "last_name": "Cooper"},
  "account": {"user_id": 12, "first_name": "Jane", "last_name": "Cooper", "display_name": "Jane Cooper"},
  "message": "Account details updated successfully."
}
Try it live
Live response
PUT/vendor/storeUpdate store name & link

Updates store name and/or store link. Store link must be unique across all vendors.

Request Body / Parameters
ParameterTypeRequiredDescription
store_namestringoptionalStore display name
store_linkstringoptionalURL slug - must be unique
Example Request
HTTP
PUT /wp-json/digages-smv/v1/vendor/store
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "store_name": "Jane's New Boutique",
  "store_link": "janes-new-boutique"
}
Example Response
JSON
{"success": true, "updated": {"store_name": "Jane's New Boutique"}, "message": "Store details updated successfully."}
Try it live
Live response
PUT/vendor/profileUpdate store profile fields

Updates store profile. Pass attachment IDs from /vendor/upload. All fields optional.

Request Body / Parameters
ParameterTypeRequiredDescription
store_headingstringoptionalStore heading / tagline
biostringoptionalStore bio
video_typestringoptional"upload" or "youtube"
youtube_linkstringoptionalYouTube URL
banner_attachment_idintegeroptionalAttachment ID for banner image
profile_attachment_idintegeroptionalAttachment ID for profile picture
video_attachment_idintegeroptionalAttachment ID for welcome video
Example Request
HTTP
PUT /wp-json/digages-smv/v1/vendor/profile
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "store_heading": "Quality Products Only",
  "bio": "We sell the best items.",
  "banner_attachment_id": 102
}
Example Response
JSON
{"success": true, "message": "Store profile updated successfully."}
Try it live
Live response
5

Products - Create & Manage

Three-step product creation flow. Step 1 creates the product. Step 2 adds images and print files. Step 3 publishes it. Use draft=true on any step to save without advancing.

Active shortcode: [digages_smv_add_product]. Active query param: digages_smv_product. Legacy variants still accepted for compatibility.
POST/product/step/1Create or update product details

Creates or updates product details. Returns a product_id needed for step/2 and step/3.

Request Body / Parameters
ParameterTypeRequiredDescription
product_namestringrequiredProduct title
product_amountnumberrequiredProduct price
short_descstringoptionalShort product description
descstringoptionalFull product description
category_idsarrayoptionalArray of WooCommerce product category IDs
tag_idsarrayoptionalArray of existing WooCommerce product tag IDs
tagsarrayoptionalArray of tag names to assign or create
draftbooloptionaltrue = save without advancing step
product_idintegeroptionalExisting product ID for edit mode
Example Request
HTTP
POST /wp-json/digages-smv/v1/product/step/1
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "product_name": "Custom Hoodie",
  "product_amount": 49.99,
  "short_desc": "Premium quality hoodie.",
  "desc": "A detailed description here.",
  "category_ids": [15],
  "tags": ["hoodies", "premium"]
}
Example Response
JSON
{"success": true, "product_id": 77, "message": "Step 1 saved."}
Try it live
Live response
POST/product/step/2Save images & print files

Save product images and print files. Pass attachment IDs from /product/upload.

Request Body / Parameters
ParameterTypeRequiredDescription
product_idintegerrequiredProduct ID from step/1 response
product_images_idsarrayoptionalArray of image attachment IDs
print_files_idsarrayoptionalArray of print file attachment IDs
draftbooloptionaltrue = save without advancing step
Example Request
HTTP
POST /wp-json/digages-smv/v1/product/step/2
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "product_id": 77,
  "product_images_ids": [88, 89],
  "print_files_ids": [90]
}
Example Response
JSON
{"success": true, "message": "Step 2 saved."}
Try it live
Live response
POST/product/step/3Publish product

Publish the product. Requires policy acceptance for public products.

Request Body / Parameters
ParameterTypeRequiredDescription
product_idintegerrequiredProduct ID from step/1
publish_typestringrequired"publish" or "publish_privately"
policy_acceptboolconditionalMust be true for public publish
Example Request
HTTP
POST /wp-json/digages-smv/v1/product/step/3
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "product_id": 77,
  "publish_type": "publish",
  "policy_accept": true
}
Example Response
JSON
{"success": true, "message": "Product published successfully."}
Try it live
Live response
POST/product/uploadUpload product image or print file

Upload a product image or print file. Send as multipart/form-data.

Request Body / Parameters
ParameterTypeRequiredDescription
filefilerequiredThe file binary
typestringrequired"product_images" or "print_files"
Example Request
HTTP
POST /wp-json/digages-smv/v1/product/upload
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: multipart/form-data

file=@product.jpg
type=product_images
Example Response
JSON
{
  "success": true,
  "attachment_id": 91,
  "url": "https://yoursite.com/wp-content/uploads/product.jpg",
  "filename": "product.jpg",
  "size": 153600
}
DELETE/product/upload/{id}Delete product image or print file

Delete a product image or print file attachment.

Example Request
HTTP
DELETE /wp-json/digages-smv/v1/product/upload/91
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{"success": true, "message": "Attachment deleted."}
PUT/products/{product_id}Update a product directly

Single-call CRUD update endpoint for vendors. You can update text fields, price, categories, tags, and status without re-running the multi-step flow.

Request Body / Parameters
ParameterTypeRequiredDescription
product_namestringoptionalUpdated product title
product_amountnumberoptionalUpdated price
short_descstringoptionalUpdated short description
descstringoptionalUpdated full description
category_idsarrayoptionalReplace assigned product categories
tag_idsarrayoptionalReplace/merge with existing tags by ID
tagsarrayoptionalReplace/merge with tag names; new names are created
statusstringoptional"Active", "Inactive", or "Draft"
Example Request
HTTP
PUT /wp-json/digages-smv/v1/products/77
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "product_name": "Custom Hoodie XL",
  "product_amount": 59.99,
  "category_ids": [15, 19],
  "tags": ["hoodies", "featured"],
  "status": "Active"
}
Example Response
JSON
{
  "success": true,
  "data": {"id": 77, "name": "Custom Hoodie XL", "categories": [...], "tags": [...]},
  "message": "Product updated successfully."
}
Try it live
Live response
DELETE/products/{product_id}Delete a product directly

Deletes a vendor-owned product permanently.

Example Request
HTTP
DELETE /wp-json/digages-smv/v1/products/77
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{"success": true, "product_id": 77, "message": "Product deleted successfully."}
6

Product Listings (Public)

These endpoints are public - no authentication required.

GET/productsList all vendor products

Returns a paginated list of all vendor products across the marketplace. Supports category, tag, and text search filtering.

Request Body / Parameters
ParameterTypeRequiredDescription
pageintegeroptionalPage number. Default: 1
per_pageintegeroptionalResults per page, max 100. Default: 12
statusstringoptional"Active", "Inactive", or "Draft"
vendor_idintegeroptionalFilter by vendor user ID
orderbystringoptional"date", "title", or "price"
orderstringoptional"asc" or "desc"
categoryintegeroptionalFilter by product category ID
tagintegeroptionalFilter by product tag ID
searchstringoptionalSearch product title/content
Example Request
HTTP
GET /wp-json/digages-smv/v1/products?page=1&per_page=12&status=Active&orderby=date&order=desc&category=15&tag=8&search=hoodie
Example Response
JSON
{
  "success": true,
  "data": [
    {
      "id": 77,
      "name": "Custom Hoodie",
      "slug": "custom-hoodie",
      "price": 49.99,
      "status": "publish",
      "trybebox_status": "Active",
      "categories": [{"id": 15, "name": "Hoodies"}],
      "tags": [{"id": 8, "name": "premium"}],
      "vendor": {"id": 12, "display_name": "Jane's Boutique"},
      "images": [{"id": 88, "url": "https://...", "alt": ""}]
    }
  ],
  "pagination": {"page": 1, "total": 24, "total_pages": 2}
}
GET/products/{product_id}Get single product

Returns a single vendor product. Returns 404 if product is not found, not a vendor product, or belongs to a different vendor when vendor_id is supplied.

Request Body / Parameters
ParameterTypeRequiredDescription
vendor_idintegeroptionalValidate product belongs to this vendor
Example Request
HTTP
GET /wp-json/digages-smv/v1/products/77?vendor_id=12
Example Response
JSON
{
  "success": true,
  "data": {"id": 77, "name": "Custom Hoodie", "price": 49.99, ...}
}
GET/vendors/{vendor_id}/productsGet products by vendor

Returns all products from a specific vendor. Supports same query params as /products except vendor_id. Response includes a vendor object at the top level.

Request Body / Parameters
ParameterTypeRequiredDescription
pageintegeroptionalPage number. Default: 1
per_pageintegeroptionalResults per page, max 100. Default: 12
statusstringoptional"Active", "Inactive", or "Draft"
orderbystringoptional"date", "title", or "price"
orderstringoptional"asc" or "desc"
categoryintegeroptionalFilter by product category ID
tagintegeroptionalFilter by product tag ID
searchstringoptionalSearch product title/content
Example Request
HTTP
GET /wp-json/digages-smv/v1/vendors/12/products?page=1&per_page=12&status=Active
Example Response
JSON
{
  "success": true,
  "vendor": {"id": 12, "display_name": "Jane's Boutique", "store_link": "janes-boutique"},
  "data": [...],
  "pagination": {...}
}
GET/product-categoriesList product categories

Returns WooCommerce product categories for app pickers and filters.

Request Body / Parameters
ParameterTypeRequiredDescription
pageintegeroptionalPage number. Default: 1
per_pageintegeroptionalResults per page. Default: 50
searchstringoptionalSearch by category name
hide_emptybooloptionaltrue = only categories with products
parentintegeroptionalFilter by parent term ID. Use 0 for top-level only
Example Request
HTTP
GET /wp-json/digages-smv/v1/product-categories?per_page=20&parent=0
Example Response
JSON
{
  "success": true,
  "data": [
    {"id": 15, "name": "Hoodies", "slug": "hoodies", "taxonomy": "product_cat", "parent": 0, "count": 6}
  ],
  "pagination": {"page": 1, "total": 12, "total_pages": 1}
}
GET/product-tagsList product tags

Returns WooCommerce product tags for app pickers and filters.

Request Body / Parameters
ParameterTypeRequiredDescription
pageintegeroptionalPage number. Default: 1
per_pageintegeroptionalResults per page. Default: 50
searchstringoptionalSearch by tag name
hide_emptybooloptionaltrue = only tags with products
Example Request
HTTP
GET /wp-json/digages-smv/v1/product-tags?search=hood
Example Response
JSON
{
  "success": true,
  "data": [
    {"id": 8, "name": "hoodies", "slug": "hoodies", "taxonomy": "product_tag", "parent": 0, "count": 4}
  ],
  "pagination": {"page": 1, "total": 1, "total_pages": 1}
}
7

Vendor Dashboard

Returns sales stats and paginated order listings for the authenticated vendor. Only Normal (product) orders are included.

GET/vendor/dashboardGet dashboard stats & orders

Returns gross sales, total earnings, available balance, active product count, and a paginated order listing for the period.

Request Body / Parameters
ParameterTypeRequiredDescription
filterstringoptionaltoday | yesterday | this_week | this_month | this_year | all_time. Default: this_month
typestringoptional"all" or "Normal". Default: all
pageintegeroptionalPage number. Default: 1
per_pageintegeroptionalOrders per page, max 100. Default: 10
Example Request
HTTP
GET /wp-json/digages-smv/v1/vendor/dashboard?filter=this_month&page=1&per_page=10
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{
  "success": true,
  "filters": {"filter": "this_month", "type": "all"},
  "stats": {
    "gross_sales": 1500.00,
    "total_earnings": 300.00,
    "available_balance": 200.00,
    "active_products": 12
  },
  "order_listings": [
    {
      "order_id": 101,
      "order_number": "#PR101",
      "customer": "John D",
      "amount": 75.00,
      "item_count": 2,
      "date": "Mar 10, 2026"
    }
  ],
  "pagination": {"page": 1, "per_page": 10, "total": 47, "has_next": true}
}
Try it live
Live response
8

Vendor Earnings

GET/vendor/earningsGet balance & earnings history

Returns the vendor's available balance, total earnings, and a paginated history of payout and withdrawal records.

Request Body / Parameters
ParameterTypeRequiredDescription
time_filterstringoptionaltoday | yesterday | this_week | this_month | this_year | all_time. Default: all_time
record_filterstringoptional"all", "withdrawals", or "payouts". Default: all
pageintegeroptionalPage number. Default: 1
per_pageintegeroptionalRecords per page, max 100. Default: 10
Example Request
HTTP
GET /wp-json/digages-smv/v1/vendor/earnings?time_filter=this_month&per_page=20
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{
  "success": true,
  "balance": {
    "available_balance": 450.00,
    "total_earnings": 600.00,
    "gross_product_sales": 1200.00,
    "total_withdrawn": 150.00
  },
  "records": [
    {
      "id": "PR101",
      "type": "Order",
      "amount": 85.00,
      "is_positive": true,
      "status": "Successful",
      "date": "Mar 10, 2026"
    }
  ],
  "pagination": {"page": 1, "total": 24}
}
Try it live
Live response
9

Store Items

GET/vendor/store-itemsList items with stats

Returns stats (active, inactive, draft counts) and a paginated list of the vendor's products.

Request Body / Parameters
ParameterTypeRequiredDescription
status_filterstringoptional"total", "active", "inactive", or "draft". Default: total
tabstringoptional"all", "published", or "draft". Default: all
pageintegeroptionalPage number. Default: 1
per_pageintegeroptionalItems per page, max 100. Default: 10
Example Request
HTTP
GET /wp-json/digages-smv/v1/vendor/store-items?status_filter=active&tab=published&per_page=20
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{
  "success": true,
  "stats": {"active": 8, "inactive": 2, "draft": 3, "total": 10},
  "tab_counts": {"published": 8, "draft": 3},
  "items": [{"id": 77, "name": "Custom Hoodie", "status": "active", "orders": 12, ...}],
  "pagination": {...}
}
Try it live
Live response
PUT/vendor/store-items/{id}/statusToggle product active/inactive

Toggle a product between Active and Inactive. Only the product owner can do this.

Request Body / Parameters
ParameterTypeRequiredDescription
statusstringrequired"Active" or "Inactive"
Example Request
HTTP
PUT /wp-json/digages-smv/v1/vendor/store-items/77/status
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{"status": "Inactive"}
Example Response
JSON
{"success": true, "product_id": 77, "status": "Inactive", "message": "Product status updated successfully."}
Try it live
Live response
DELETE/vendor/store-items/{id}Delete product permanently

Permanently deletes a product (force delete - no trash). Only the product owner can delete. Returns 403 if the product belongs to another vendor.

Example Request
HTTP
DELETE /wp-json/digages-smv/v1/vendor/store-items/77
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{"success": true, "product_id": 77, "message": "Product deleted successfully."}
10

Orders

A vendor can access any order that contains at least one product they authored. Admins with edit_shop_orders capability can view any order.

GET/vendor/ordersList vendor orders

Returns a paginated list of orders containing this vendor's products.

Request Body / Parameters
ParameterTypeRequiredDescription
statusstringoptionalall | completed | processing | on-hold | pending | cancelled | refunded. Default: all
pageintegeroptionalPage number. Default: 1
per_pageintegeroptionalOrders per page, max 100. Default: 10
Example Request
HTTP
GET /wp-json/digages-smv/v1/vendor/orders?status=completed&page=1&per_page=10
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{
  "success": true,
  "orders": [
    {
      "order_id": 101,
      "order_number": "#PR101",
      "customer": "John D",
      "status": "Completed",
      "order_total": 75.00,
      "vendor_items_total": 50.00,
      "date": "Mar 10, 2026"
    }
  ],
  "pagination": {...}
}
Try it live
Live response
GET/vendor/orders/{id}Get order detail

Returns full order detail including all line items, billing address, and financial totals. Each item has an is_vendor_product flag.

Example Request
HTTP
GET /wp-json/digages-smv/v1/vendor/orders/101
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{
  "success": true,
  "order": {
    "order_id": 101,
    "status": "Completed",
    "payment_method": "Stripe",
    "subtotal": 70.00,
    "shipping_total": 5.00,
    "order_total": 75.00,
    "vendor_items_total": 50.00,
    "items": [
      {"product_id": 77, "name": "Custom Hoodie", "quantity": 1, "item_total": 49.99, "is_vendor_product": true}
    ],
    "billing": {"name": "John Doe", "email": "john@example.com", "phone": "+234..."}
  }
}
Try it live
Live response
11

Bank Information

Store and retrieve vendor bank details. The raw account number is never returned in any response - only the last 4 digits are shown (masked).

GET/vendor/bank-infoGet bank details

Returns the vendor's saved bank details with account number masked. Includes an is_complete flag indicating whether all required fields are filled.

Example Request
HTTP
GET /wp-json/digages-smv/v1/vendor/bank-info
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{
  "success": true,
  "bank_info": {
    "bank_name": "First Bank",
    "account_number_masked": "******7890",
    "account_name": "Jane Smith",
    "country": "Nigeria",
    "sort_code": "",
    "iban": "",
    "bic_swift": "FIRSTNGLA",
    "routing_number": ""
  },
  "is_complete": true
}
Try it live
Live response
PUT/vendor/bank-infoSave / update bank details

Save or update bank details. The four required fields must always be sent.

Request Body / Parameters
ParameterTypeRequiredDescription
bank_namestringrequiredName of the bank
account_numberstringrequiredBank account number
account_namestringrequiredName on the account
countrystringrequiredCountry of the bank
sort_codestringoptionalUK/Irish sort code
ibanstringoptionalIBAN number
bic_swiftstringoptionalBIC / SWIFT code
routing_numberstringoptionalUS routing number
Example Request
HTTP
PUT /wp-json/digages-smv/v1/vendor/bank-info
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "bank_name": "First Bank",
  "account_number": "1234567890",
  "account_name": "Jane Smith",
  "country": "Nigeria",
  "bic_swift": "FIRSTNGLA"
}
Example Response
JSON
{
  "success": true,
  "bank_info": {
    "bank_name": "First Bank",
    "account_number_masked": "******7890",
    "account_name": "Jane Smith",
    "country": "Nigeria"
  },
  "message": "Bank details updated successfully."
}
The raw account number is never returned - only the masked version.
Try it live
Live response
12

Pinned Banners

Vendors can pin up to 5 promotional banners to their store profile. GET /banners/store/{slug} is public. All other endpoints require authentication.

GET/bannersGet own banners + profile

Returns the vendor's pinned banners alongside their full profile in one call.

Example Request
HTTP
GET /wp-json/digages-smv/v1/banners
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{
  "success": true,
  "total_banners": 2,
  "can_add_more": true,
  "banners": [...],
  "profile": {...}
}
Try it live
Live response
GET/banners/store/{store_slug}Get public store banners

Public endpoint - no auth required. Returns banners for any store by URL slug.

Example Request
HTTP
GET /wp-json/digages-smv/v1/banners/store/janes-boutique
Example Response
JSON
{
  "success": true,
  "store_slug": "janes-boutique",
  "total": 3,
  "banners": [
    {"image": "https://...", "name": "Custom Hoodie", "link": "https://..."}
  ]
}
POST/bannersAdd pinned banner

Add a new pinned banner. Maximum 5 banners per vendor.

Request Body / Parameters
ParameterTypeRequiredDescription
imagestringrequiredFull URL of banner image (from /banners/upload)
namestringrequiredDisplay name of the linked item
typestringrequired"product"
item_idintegerrequiredID of the linked product
linkstringrequiredFull URL the banner links to
Example Request
HTTP
POST /wp-json/digages-smv/v1/banners
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{
  "image": "https://yoursite.com/wp-content/uploads/banner.jpg",
  "name": "Custom Hoodie",
  "type": "product",
  "item_id": 77,
  "link": "https://yoursite.com/product/custom-hoodie"
}
Example Response
JSON
{
  "success": true,
  "added": {...},
  "total_banners": 3,
  "can_add_more": true,
  "message": "Banner pinned successfully."
}
Try it live
Live response
PUT/banners/{index}Edit banner by index

Edit an existing banner at the given zero-based index. All fields optional - only sent fields are updated.

Request Body / Parameters
ParameterTypeRequiredDescription
indexintegerrequiredZero-based index of the banner to edit (URL param)
imagestringoptionalNew banner image URL
namestringoptionalNew display name
typestringoptionalItem type
item_idintegeroptionalNew item ID
linkstringoptionalNew link URL
Example Request
HTTP
PUT /wp-json/digages-smv/v1/banners/0
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json

{"name": "Updated Product Name"}
Example Response
JSON
{"success": true, "index": 0, "updated": {...}, "message": "Banner updated successfully."}
Try it live
Live response
DELETE/banners/{index}Delete banner by index

Delete a banner at the given zero-based index. Remaining banners are re-indexed from 0 after deletion.

Example Request
HTTP
DELETE /wp-json/digages-smv/v1/banners/2
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{"success": true, "total_banners": 2, "can_add_more": true, "message": "Banner deleted successfully."}
Always refresh your banner list after DELETE - indexes shift when a banner is removed.
GET/banners/itemsGet linkable items

Returns all active WooCommerce products for the vendor to use as banner targets.

Example Request
HTTP
GET /wp-json/digages-smv/v1/banners/items
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Example Response
JSON
{
  "success": true,
  "total": 8,
  "items": [
    {"id": 77, "name": "Custom Hoodie", "type": "product", "url": "https://..."}
  ]
}
Try it live
Live response
POST/banners/uploadUpload banner image

Upload a banner image to the media library. Send as multipart/form-data.

Request Body / Parameters
ParameterTypeRequiredDescription
filefilerequiredImage file. Allowed: JPEG, PNG, GIF. Max size: 10 MB
Example Request
HTTP
POST /wp-json/digages-smv/v1/banners/upload
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: multipart/form-data

file=@banner.jpg
Example Response
JSON
{
  "success": true,
  "attachment_id": 99,
  "url": "https://yoursite.com/wp-content/uploads/banner.jpg",
  "filename": "banner.jpg",
  "size": 204800
}
13

Error Reference

HTTP Status Codes

CodeStatusDescription
200 OK Request succeeded
201 Created Resource created successfully
400 Bad Request Missing or invalid parameters
401 Unauthorized Missing or invalid Authorization header
403 Forbidden Authenticated but not allowed to access this resource
404 Not Found Resource does not exist
409 Conflict Duplicate resource (e.g. email or store link already taken)
413 Payload Too Large Uploaded file exceeds size limit
415 Unsupported Media Type File type not allowed
500 Internal Server Error Server-side error, check WordPress debug log

Error Response Shape

JSON
{
  "success": false,
  "code": "machine_readable_error_code",
  "message": "Human readable description of the error.",
  "data": { "status": 400 }
}

Common Error Codes

CodeHTTPDescription
rest_not_logged_in 401 No Authorization header or invalid token
email_exists 409 Email already registered
store_link_taken 409 Store slug already in use by another vendor
max_banners_reached 400 Vendor already has 5 pinned banners
banner_not_found 404 No banner at the given index
product_not_found 404 Product does not exist
not_your_product 403 Product belongs to a different vendor
not_a_vendor_product 404 Product has no _trybebox_created_by meta
vendor_mismatch 404 Product belongs to a different vendor (public endpoint)
order_not_found 404 Order does not exist
access_denied 403 Order contains no products from this vendor
no_file 400 No file received in upload request
invalid_file_type 415 File MIME type not allowed
file_too_large 413 File exceeds maximum size
nothing_to_update 400 No fields provided in PUT request
missing_bank_name 400 bank_name is required but missing
store_not_found 404 No store found with given slug
14

Pagination Reference

Standard Query Parameters

ParameterTypeRequiredDescription
pageintegeroptionalPage number. Default: 1. Minimum: 1
per_pageintegeroptionalResults per page. Default varies. Maximum: 100

Pagination Response Fields

FieldTypeDescription
pagination.page integer Current page number
pagination.per_page integer Results per page
pagination.total integer Total records across all pages
pagination.total_pages integer Total number of pages
pagination.has_next bool true if there is a next page
pagination.has_prev bool true if there is a previous page
X-WP-Total (header) integer Total number of records
X-WP-TotalPages (header) integer Total number of pages
X-WP-Page (header) integer Current page number

Example

HTTP
// Fetch page 3 with 20 results per page
GET /wp-json/digages-smv/v1/vendor/orders?page=3&per_page=20
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...

// Response headers
X-WP-Total: 87
X-WP-TotalPages: 5
X-WP-Page: 3

// Response body (excerpt)
{
  "pagination": {
    "page": 3,
    "per_page": 20,
    "total": 87,
    "total_pages": 5,
    "has_next": true,
    "has_prev": true
  }
}
When has_next is false you have reached the last page. When total is 0 the result set is empty.
No results found for your search.