Skip to main content

MageMe HidePricePro Magento 2 Module | REST API

The HidePricePro REST API enables programmatic access to the HidePricePro functionalities within a Magento 2 environment. This documentation outlines the various API endpoints available for managing price request functionality.

Request API

To access the HidePricePro API endpoints, you need to authenticate and obtain authorization. Ensure that you have the appropriate permissions (MageMe_HidePricePro::manage_requests) assigned to your API integration or user role.

1. Retrieve Request Details

  • Endpoint: /V1/hidepricepro/request/:id
  • Method: GET
  • Description: Fetches detailed information about a specific price request by ID.
  • Parameters:
    • id (required): The ID of the request.
  • Response: Returns detailed data about the request, including customer information, product data, custom fields, and message details.

Example Usage:

curl -X GET "https://example.com/rest/V1/hidepricepro/request/123" \
-H "Authorization: Bearer <access_token>"

Response Structure:

{
"request_id": 123,
"increment_id": "REQ000123",
"is_admin_notified": true,
"is_customer_notified": true,
"store_id": 1,
"customer_ip": "192.168.1.1",
"customer_email": "customer@example.com",
"customer_firstname": "John",
"customer_lastname": "Doe",
"customer_phone": "+1234567890",
"message": "I would like to request pricing for this product.",
"product": {
"product_id": 456,
"name": "Product Name",
"sku": "PROD-123"
},
"custom_field_1": "Value 1",
"custom_field_2": "Value 2",
"custom_field_3": "Value 3",
"created_at": "2025-05-09 12:34:56",
"is_replied": false,
"is_read": false
}

2. Retrieve Multiple Requests

  • Endpoint: /V1/hidepricepro/requests
  • Method: GET
  • Description: Retrieves all price requests available in the system.
  • Parameters:
    • filter (optional): JSON-encoded filter criteria to search for specific requests.
  • Response: Returns an array of request data.

Example Usage Without Filter:

curl -X GET "https://example.com/rest/V1/hidepricepro/requests" \
-H "Authorization: Bearer <access_token>"

Example Usage With Date Range Filter:

curl -X GET "https://example.com/rest/V1/hidepricepro/requests?filter=%7B%22created_at%22%3A%7B%22from%22%3A%222025-01-01%2000%3A00%3A00%22%2C%22to%22%3A%222025-05-09%2023%3A59%3A59%22%7D%7D" \
-H "Authorization: Bearer <access_token>"

Note: The filter parameter above is URL-encoded. The decoded JSON is:

{
"created_at": {
"from": "2025-01-01 00:00:00",
"to": "2025-05-09 23:59:59"
}
}

Example Usage With Multiple Filters:

curl -X GET "https://example.com/rest/V1/hidepricepro/requests?filter=%7B%22created_at%22%3A%7B%22from%22%3A%222025-01-01%2000%3A00%3A00%22%2C%22to%22%3A%222025-05-09%2023%3A59%3A59%22%7D%2C%22is_read%22%3Afalse%7D" \
-H "Authorization: Bearer <access_token>"

Note: The filter parameter above is URL-encoded. The decoded JSON is:

{
"created_at": {
"from": "2025-01-01 00:00:00",
"to": "2025-05-09 23:59:59"
},
"is_read": false
}

Available Filter Fields:

  • request_id: Filter by request ID
  • increment_id: Filter by increment ID
  • is_admin_notified: Filter by admin notification status (true/false)
  • is_customer_notified: Filter by customer notification status (true/false)
  • store_id: Filter by store ID
  • customer_email: Filter by customer email
  • customer_firstname: Filter by customer first name
  • customer_lastname: Filter by customer last name
  • created_at: Filter by creation date range (using "from" and "to")
  • is_replied: Filter by reply status (true/false)
  • is_read: Filter by read status (true/false)

Response Structure:

[
{
"request_id": 123,
"increment_id": "REQ000123",
"customer_email": "customer@example.com",
"customer_firstname": "John",
"customer_lastname": "Doe",
"created_at": "2025-03-15 12:34:56",
"is_read": false
},
{
"request_id": 124,
"increment_id": "REQ000124",
"customer_email": "another@example.com",
"customer_firstname": "Jane",
"customer_lastname": "Smith",
"created_at": "2025-04-22 10:15:30",
"is_read": false
}
]

3. Submit a Price Request

  • Endpoint: /V1/hidepricepro/request/submit
  • Method: POST
  • Description: Submits a new price request.
  • Request Body: JSON object containing the request data.

Example Usage:

curl -X POST "https://example.com/rest/V1/hidepricepro/request/submit" \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"email": "customer@example.com",
"firstname": "John",
"lastname": "Doe",
"phone": "+1234567890",
"message": "I would like to request pricing for this product.",
"product_id": 456,
"product_sku": "PROD-123",
"product_name": "Joust Duffle Bag",
"custom_field_1": "Value 1",
"custom_field_2": "Value 2",
"custom_field_3": "Value 3"
}'

4. Upload File for a Request

  • Endpoint: /V1/hidepricepro/request/upload
  • Method: POST
  • Description: Uploads a file to be attached to a price request.
  • Request Body: Multipart form data containing the file.

Example Usage:

curl -X POST "https://example.com/rest/V1/hidepricepro/request/upload" \
-H "Authorization: Bearer <access_token>" \
-F "file=@/path/to/file.pdf"

Response Structure:

{
"request_message_file_tmp_id": 789,
"name": "file.pdf",
"size": 12345,
"mime_type": "application/pdf",
"path": "tmp/hidepricepro/uploads/file.pdf",
"hash": "a1b2c3d4e5f6g7h8i9j0",
"created_at": "2025-05-09 12:34:56"
}