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.
Getting Started
Base URL
All API routes are prefixed with:
https://testing.digages.com/wp-json/digages-smv/v1
Authentication
All protected endpoints require HTTP Basic Authentication using WordPress Application Passwords (WP 5.6+). Every request must include an Authorization header.
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.
Application Passwords on localhost
WordPress disables Application Passwords on non-HTTPS environments. Add this to your functions.php while developing locally:
add_filter( 'wp_is_application_passwords_available', '__return_true' );
Request Format
Content-Type: application/json Accept: application/json
File upload endpoints use multipart/form-data - see individual endpoint docs.
Response Format
// Success
{
"success": true,
"data": { ... }
}
// Error
{
"success": false,
"code": "machine_readable_code",
"message": "Human readable error message."
}Auth - Login & Logout
Authenticate with WordPress credentials to receive an Application Password token used for all subsequent requests.
Authenticates a user and returns an Application Password token. Store the returned auth_header - it is the Authorization header value for all subsequent requests.
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | required | WordPress username or email address |
| password | string | required | WordPress account password |
| app_name | string | optional | Token scope name. Default: "digages-smv-app" |
| remember | bool | optional | Unused flag for future session control |
POST /wp-json/digages-smv/v1/login
Content-Type: application/json
{
"username": "john@example.com",
"password": "MySecurePass123",
"app_name": "my-mobile-app"
}{
"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/"
}is_new_token is false, app_password and auth_header are null - use your already-stored token.Revokes the Application Password token for the authenticated user. Requires Authorization header.
| Parameter | Type | Required | Description |
|---|---|---|---|
| app_name | string | optional | The app name used when logging in. Default: "digages-smv-app" |
POST /wp-json/digages-smv/v1/logout
Authorization: Basic am9obkBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json
{"app_name": "my-mobile-app"}{"success": true, "message": "Logged out successfully."}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.
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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| first_name | string | required | Vendor first name |
| last_name | string | required | Vendor last name |
| string | required | Email address (used as username) | |
| password | string | required | Account password |
| app_name | string | optional | Token scope name. Default: "digages-smv-app" |
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"
}{
"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"
}Saves store name and store link. Requires auth.
| Parameter | Type | Required | Description |
|---|---|---|---|
| store_name | string | required | Public display name of the store |
| store_link | string | required | URL slug - must be unique (e.g. "janes-boutique") |
| terms_agree | bool | required | Must be true to proceed |
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
}{"success": true, "message": "Step 2 saved successfully.", "next_step": "/vendor/step/3"}Saves store profile. Pass draft=true to save without completing the step.
| Parameter | Type | Required | Description |
|---|---|---|---|
| store_heading | string | required | Store heading / tagline |
| bio | string | required | Store bio / description |
| video_type | string | required | "upload" or "youtube" |
| youtube_link | string | conditional | Required when video_type is "youtube" |
| banner_attachment_id | integer | optional | Attachment ID from /vendor/upload |
| profile_attachment_id | integer | optional | Attachment ID from /vendor/upload |
| video_attachment_id | integer | conditional | Required when video_type is "upload" |
| draft | bool | optional | true = save without completing step |
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"
}{"success": true, "message": "Store setup complete."}Uploads a file to the media library. Returns an attachment_id to pass into step/2 or step/3. Send as multipart/form-data.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file_key | string | required | "banner_picture", "profile_picture", or "welcome_video" |
| [file_key] | file | required | The actual file binary (field name matches file_key value) |
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
{
"success": true,
"attachment_id": 88,
"url": "https://yoursite.com/wp-content/uploads/banner.jpg",
"filename": "banner.jpg",
"size": 204800
}Permanently deletes an uploaded attachment. Requires auth.
DELETE /wp-json/digages-smv/v1/vendor/upload/88 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{"success": true, "message": "Attachment deleted."}Check whether a store slug is available. Public endpoint - no auth required.
| Parameter | Type | Required | Description |
|---|---|---|---|
| store_name | string | required | The slug to check (URL query param) |
GET /wp-json/digages-smv/v1/vendor/check-store?store_name=janes-boutique
{"available": true, "status": "available", "message": "Store link is available."}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.
Updates the vendor's first name and/or last name.
| Parameter | Type | Required | Description |
|---|---|---|---|
| first_name | string | optional | Vendor first name |
| last_name | string | optional | Vendor last name |
PUT /wp-json/digages-smv/v1/vendor/account
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json
{
"first_name": "Jane",
"last_name": "Cooper"
}{
"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."
}Updates store name and/or store link. Store link must be unique across all vendors.
| Parameter | Type | Required | Description |
|---|---|---|---|
| store_name | string | optional | Store display name |
| store_link | string | optional | URL slug - must be unique |
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"
}{"success": true, "updated": {"store_name": "Jane's New Boutique"}, "message": "Store details updated successfully."}Updates store profile. Pass attachment IDs from /vendor/upload. All fields optional.
| Parameter | Type | Required | Description |
|---|---|---|---|
| store_heading | string | optional | Store heading / tagline |
| bio | string | optional | Store bio |
| video_type | string | optional | "upload" or "youtube" |
| youtube_link | string | optional | YouTube URL |
| banner_attachment_id | integer | optional | Attachment ID for banner image |
| profile_attachment_id | integer | optional | Attachment ID for profile picture |
| video_attachment_id | integer | optional | Attachment ID for welcome video |
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
}{"success": true, "message": "Store profile updated successfully."}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.
[digages_smv_add_product]. Active query param: digages_smv_product. Legacy variants still accepted for compatibility.Creates or updates product details. Returns a product_id needed for step/2 and step/3.
| Parameter | Type | Required | Description |
|---|---|---|---|
| product_name | string | required | Product title |
| product_amount | number | required | Product price |
| short_desc | string | optional | Short product description |
| desc | string | optional | Full product description |
| category_ids | array | optional | Array of WooCommerce product category IDs |
| tag_ids | array | optional | Array of existing WooCommerce product tag IDs |
| tags | array | optional | Array of tag names to assign or create |
| draft | bool | optional | true = save without advancing step |
| product_id | integer | optional | Existing product ID for edit mode |
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"]
}{"success": true, "product_id": 77, "message": "Step 1 saved."}Save product images and print files. Pass attachment IDs from /product/upload.
| Parameter | Type | Required | Description |
|---|---|---|---|
| product_id | integer | required | Product ID from step/1 response |
| product_images_ids | array | optional | Array of image attachment IDs |
| print_files_ids | array | optional | Array of print file attachment IDs |
| draft | bool | optional | true = save without advancing step |
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]
}{"success": true, "message": "Step 2 saved."}Publish the product. Requires policy acceptance for public products.
| Parameter | Type | Required | Description |
|---|---|---|---|
| product_id | integer | required | Product ID from step/1 |
| publish_type | string | required | "publish" or "publish_privately" |
| policy_accept | bool | conditional | Must be true for public publish |
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
}{"success": true, "message": "Product published successfully."}Upload a product image or print file. Send as multipart/form-data.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | required | The file binary |
| type | string | required | "product_images" or "print_files" |
POST /wp-json/digages-smv/v1/product/upload Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE... Content-Type: multipart/form-data file=@product.jpg type=product_images
{
"success": true,
"attachment_id": 91,
"url": "https://yoursite.com/wp-content/uploads/product.jpg",
"filename": "product.jpg",
"size": 153600
}Delete a product image or print file attachment.
DELETE /wp-json/digages-smv/v1/product/upload/91 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{"success": true, "message": "Attachment deleted."}Single-call CRUD update endpoint for vendors. You can update text fields, price, categories, tags, and status without re-running the multi-step flow.
| Parameter | Type | Required | Description |
|---|---|---|---|
| product_name | string | optional | Updated product title |
| product_amount | number | optional | Updated price |
| short_desc | string | optional | Updated short description |
| desc | string | optional | Updated full description |
| category_ids | array | optional | Replace assigned product categories |
| tag_ids | array | optional | Replace/merge with existing tags by ID |
| tags | array | optional | Replace/merge with tag names; new names are created |
| status | string | optional | "Active", "Inactive", or "Draft" |
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"
}{
"success": true,
"data": {"id": 77, "name": "Custom Hoodie XL", "categories": [...], "tags": [...]},
"message": "Product updated successfully."
}Deletes a vendor-owned product permanently.
DELETE /wp-json/digages-smv/v1/products/77 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{"success": true, "product_id": 77, "message": "Product deleted successfully."}Product Listings (Public)
These endpoints are public - no authentication required.
Returns a paginated list of all vendor products across the marketplace. Supports category, tag, and text search filtering.
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | optional | Page number. Default: 1 |
| per_page | integer | optional | Results per page, max 100. Default: 12 |
| status | string | optional | "Active", "Inactive", or "Draft" |
| vendor_id | integer | optional | Filter by vendor user ID |
| orderby | string | optional | "date", "title", or "price" |
| order | string | optional | "asc" or "desc" |
| category | integer | optional | Filter by product category ID |
| tag | integer | optional | Filter by product tag ID |
| search | string | optional | Search product title/content |
GET /wp-json/digages-smv/v1/products?page=1&per_page=12&status=Active&orderby=date&order=desc&category=15&tag=8&search=hoodie
{
"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}
}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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| vendor_id | integer | optional | Validate product belongs to this vendor |
GET /wp-json/digages-smv/v1/products/77?vendor_id=12
{
"success": true,
"data": {"id": 77, "name": "Custom Hoodie", "price": 49.99, ...}
}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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | optional | Page number. Default: 1 |
| per_page | integer | optional | Results per page, max 100. Default: 12 |
| status | string | optional | "Active", "Inactive", or "Draft" |
| orderby | string | optional | "date", "title", or "price" |
| order | string | optional | "asc" or "desc" |
| category | integer | optional | Filter by product category ID |
| tag | integer | optional | Filter by product tag ID |
| search | string | optional | Search product title/content |
GET /wp-json/digages-smv/v1/vendors/12/products?page=1&per_page=12&status=Active
{
"success": true,
"vendor": {"id": 12, "display_name": "Jane's Boutique", "store_link": "janes-boutique"},
"data": [...],
"pagination": {...}
}Returns WooCommerce product categories for app pickers and filters.
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | optional | Page number. Default: 1 |
| per_page | integer | optional | Results per page. Default: 50 |
| search | string | optional | Search by category name |
| hide_empty | bool | optional | true = only categories with products |
| parent | integer | optional | Filter by parent term ID. Use 0 for top-level only |
GET /wp-json/digages-smv/v1/product-categories?per_page=20&parent=0
{
"success": true,
"data": [
{"id": 15, "name": "Hoodies", "slug": "hoodies", "taxonomy": "product_cat", "parent": 0, "count": 6}
],
"pagination": {"page": 1, "total": 12, "total_pages": 1}
}Returns WooCommerce product tags for app pickers and filters.
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | optional | Page number. Default: 1 |
| per_page | integer | optional | Results per page. Default: 50 |
| search | string | optional | Search by tag name |
| hide_empty | bool | optional | true = only tags with products |
GET /wp-json/digages-smv/v1/product-tags?search=hood
{
"success": true,
"data": [
{"id": 8, "name": "hoodies", "slug": "hoodies", "taxonomy": "product_tag", "parent": 0, "count": 4}
],
"pagination": {"page": 1, "total": 1, "total_pages": 1}
}Vendor Dashboard
Returns sales stats and paginated order listings for the authenticated vendor. Only Normal (product) orders are included.
Returns gross sales, total earnings, available balance, active product count, and a paginated order listing for the period.
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | string | optional | today | yesterday | this_week | this_month | this_year | all_time. Default: this_month |
| type | string | optional | "all" or "Normal". Default: all |
| page | integer | optional | Page number. Default: 1 |
| per_page | integer | optional | Orders per page, max 100. Default: 10 |
GET /wp-json/digages-smv/v1/vendor/dashboard?filter=this_month&page=1&per_page=10 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{
"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}
}Vendor Earnings
Returns the vendor's available balance, total earnings, and a paginated history of payout and withdrawal records.
| Parameter | Type | Required | Description |
|---|---|---|---|
| time_filter | string | optional | today | yesterday | this_week | this_month | this_year | all_time. Default: all_time |
| record_filter | string | optional | "all", "withdrawals", or "payouts". Default: all |
| page | integer | optional | Page number. Default: 1 |
| per_page | integer | optional | Records per page, max 100. Default: 10 |
GET /wp-json/digages-smv/v1/vendor/earnings?time_filter=this_month&per_page=20 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{
"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}
}Store Items
Returns stats (active, inactive, draft counts) and a paginated list of the vendor's products.
| Parameter | Type | Required | Description |
|---|---|---|---|
| status_filter | string | optional | "total", "active", "inactive", or "draft". Default: total |
| tab | string | optional | "all", "published", or "draft". Default: all |
| page | integer | optional | Page number. Default: 1 |
| per_page | integer | optional | Items per page, max 100. Default: 10 |
GET /wp-json/digages-smv/v1/vendor/store-items?status_filter=active&tab=published&per_page=20 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{
"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": {...}
}Toggle a product between Active and Inactive. Only the product owner can do this.
| Parameter | Type | Required | Description |
|---|---|---|---|
| status | string | required | "Active" or "Inactive" |
PUT /wp-json/digages-smv/v1/vendor/store-items/77/status
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json
{"status": "Inactive"}{"success": true, "product_id": 77, "status": "Inactive", "message": "Product status updated successfully."}Permanently deletes a product (force delete - no trash). Only the product owner can delete. Returns 403 if the product belongs to another vendor.
DELETE /wp-json/digages-smv/v1/vendor/store-items/77 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{"success": true, "product_id": 77, "message": "Product deleted successfully."}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.
Returns a paginated list of orders containing this vendor's products.
| Parameter | Type | Required | Description |
|---|---|---|---|
| status | string | optional | all | completed | processing | on-hold | pending | cancelled | refunded. Default: all |
| page | integer | optional | Page number. Default: 1 |
| per_page | integer | optional | Orders per page, max 100. Default: 10 |
GET /wp-json/digages-smv/v1/vendor/orders?status=completed&page=1&per_page=10 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{
"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": {...}
}Returns full order detail including all line items, billing address, and financial totals. Each item has an is_vendor_product flag.
GET /wp-json/digages-smv/v1/vendor/orders/101 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{
"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..."}
}
}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).
Returns the vendor's saved bank details with account number masked. Includes an is_complete flag indicating whether all required fields are filled.
GET /wp-json/digages-smv/v1/vendor/bank-info Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{
"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
}Save or update bank details. The four required fields must always be sent.
| Parameter | Type | Required | Description |
|---|---|---|---|
| bank_name | string | required | Name of the bank |
| account_number | string | required | Bank account number |
| account_name | string | required | Name on the account |
| country | string | required | Country of the bank |
| sort_code | string | optional | UK/Irish sort code |
| iban | string | optional | IBAN number |
| bic_swift | string | optional | BIC / SWIFT code |
| routing_number | string | optional | US routing number |
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"
}{
"success": true,
"bank_info": {
"bank_name": "First Bank",
"account_number_masked": "******7890",
"account_name": "Jane Smith",
"country": "Nigeria"
},
"message": "Bank details updated successfully."
}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.
Returns the vendor's pinned banners alongside their full profile in one call.
GET /wp-json/digages-smv/v1/banners Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{
"success": true,
"total_banners": 2,
"can_add_more": true,
"banners": [...],
"profile": {...}
}Public endpoint - no auth required. Returns banners for any store by URL slug.
GET /wp-json/digages-smv/v1/banners/store/janes-boutique
{
"success": true,
"store_slug": "janes-boutique",
"total": 3,
"banners": [
{"image": "https://...", "name": "Custom Hoodie", "link": "https://..."}
]
}Add a new pinned banner. Maximum 5 banners per vendor.
| Parameter | Type | Required | Description |
|---|---|---|---|
| image | string | required | Full URL of banner image (from /banners/upload) |
| name | string | required | Display name of the linked item |
| type | string | required | "product" |
| item_id | integer | required | ID of the linked product |
| link | string | required | Full URL the banner links to |
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"
}{
"success": true,
"added": {...},
"total_banners": 3,
"can_add_more": true,
"message": "Banner pinned successfully."
}Edit an existing banner at the given zero-based index. All fields optional - only sent fields are updated.
| Parameter | Type | Required | Description |
|---|---|---|---|
| index | integer | required | Zero-based index of the banner to edit (URL param) |
| image | string | optional | New banner image URL |
| name | string | optional | New display name |
| type | string | optional | Item type |
| item_id | integer | optional | New item ID |
| link | string | optional | New link URL |
PUT /wp-json/digages-smv/v1/banners/0
Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
Content-Type: application/json
{"name": "Updated Product Name"}{"success": true, "index": 0, "updated": {...}, "message": "Banner updated successfully."}Delete a banner at the given zero-based index. Remaining banners are re-indexed from 0 after deletion.
DELETE /wp-json/digages-smv/v1/banners/2 Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{"success": true, "total_banners": 2, "can_add_more": true, "message": "Banner deleted successfully."}Returns all active WooCommerce products for the vendor to use as banner targets.
GET /wp-json/digages-smv/v1/banners/items Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE...
{
"success": true,
"total": 8,
"items": [
{"id": 77, "name": "Custom Hoodie", "type": "product", "url": "https://..."}
]
}Upload a banner image to the media library. Send as multipart/form-data.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | required | Image file. Allowed: JPEG, PNG, GIF. Max size: 10 MB |
POST /wp-json/digages-smv/v1/banners/upload Authorization: Basic amFuZUBleGFtcGxlLmNvbTpBQkNE... Content-Type: multipart/form-data file=@banner.jpg
{
"success": true,
"attachment_id": 99,
"url": "https://yoursite.com/wp-content/uploads/banner.jpg",
"filename": "banner.jpg",
"size": 204800
}Error Reference
HTTP Status Codes
| Code | Status | Description |
|---|---|---|
| 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
{
"success": false,
"code": "machine_readable_error_code",
"message": "Human readable description of the error.",
"data": { "status": 400 }
}Common Error Codes
| Code | HTTP | Description |
|---|---|---|
| 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 |
Pagination Reference
Standard Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | optional | Page number. Default: 1. Minimum: 1 |
| per_page | integer | optional | Results per page. Default varies. Maximum: 100 |
Pagination Response Fields
| Field | Type | Description |
|---|---|---|
| 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
// 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
}
}has_next is false you have reached the last page. When total is 0 the result set is empty.