### JSON Response Example Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Example of the JSON structure for batch data, including purchase order information. ```json { "batches": [ { "batch_number": "EOEOEOEOEOEOE", "date_expiry": "2023-12-31 00:00:00", "quantity": "50", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` ```json { "batches": [ { "batch_number": "EOEOEOEOEOEOE", "date_expiry": "2023-12-31 00:00:00", "quantity": "50", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` ```json { "batches": [ { "batch_number": "EOEOEOEOEOEOE", "date_expiry": "2023-12-31 00:00:00", "quantity": "50", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` -------------------------------- ### Get all batches endpoint Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 The GET request URL to retrieve all product batches. ```http http://wpovernight.local/wp-json/wc/v3/products/batches ``` -------------------------------- ### Retrieve all batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 A GET request to fetch all product batches. ```json "request": { "method": "GET", "header": [], "url": { "raw": "{{api_path}}/products/batches", "host": [ "{{api_path}}" ], "path": [ "products", "batches" ] } }, "response": [] ``` -------------------------------- ### JSON Response Example Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 A sample JSON structure representing the response after updating a product batch. ```json { "batches": [ { "id": "53", "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` ```json { "batches": [ { "id": "53", "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` ```json { "batches": [ { "id": "53", "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` -------------------------------- ### Usage of [wcpdf_download_pdf] shortcode Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/download-invoice-link-with-shortcode Examples of using the download shortcode with default and custom attributes. ```text [wcpdf_download_pdf] ``` ```text [wcpdf_download_pdf document_type="invoice" link_text="Click here to Download the PDF invoice" order_id="123" id="invoice-link" class="pdf-invoice pdf-shortcode"] ``` -------------------------------- ### Usage of [wcpdf_document_link] shortcode Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/download-invoice-link-with-shortcode Example of using the raw document link shortcode. ```text [wcpdf_document_link] ``` -------------------------------- ### JSON response for batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Example of the JSON structure returned when querying for batches. ```json { "23": { "id": "23", "date_created": "2024-02-01 09:55:08", "date_expiry": "2024-10-01 09:55:08", "user_id": "1", "batch_number": "c40b0dc24d", "supplier": "WP Overnight", "location": "Netherlands", "quantity": "20.0000", "quantity_available": "18.0000", "units": "1", "status": "active", "order_ids": "[1037,1038]", "shared_ids": "[275]" }, } ``` ```json { "23": { "id": "23", "date_created": "2024-02-01 09:55:08", "date_expiry": "2024-10-01 09:55:08", "user_id": "1", "batch_number": "c40b0dc24d", "supplier": "WP Overnight", "location": "Netherlands", "quantity": "20.0000", "quantity_available": "18.0000", "units": "1", "status": "active", "order_ids": "[1037,1038]", "shared_ids": "[275]" }, } ``` ```json { "23": { "id": "23", "date_created": "2024-02-01 09:55:08", "date_expiry": "2024-10-01 09:55:08", "user_id": "1", "batch_number": "c40b0dc24d", "supplier": "WP Overnight", "location": "Netherlands", "quantity": "20.0000", "quantity_available": "18.0000", "units": "1", "status": "active", "order_ids": "[1037,1038]", "shared_ids": "[275]" }, } ``` -------------------------------- ### GET /products/batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves a list of all product batches. ```APIDOC ## GET /products/batches ### Description Retrieves a list of all product batches available in the system. ### Method GET ### Endpoint /wp-json/wc/v3/products/batches ### Response #### Success Response (200) - **id** (string) - The unique identifier of the batch - **date_created** (string) - The date the batch was created - **date_expiry** (string) - The expiry date of the batch - **user_id** (string) - The ID of the user associated with the batch - **batch_number** (string) - The unique batch number string - **supplier** (string) - The supplier name - **location** (string) - The location of the batch - **quantity** (string) - The total quantity - **quantity_available** (string) - The available quantity - **units** (string) - The unit count - **status** (string) - The status of the batch (e.g., active) - **order_ids** (string) - JSON array of associated order IDs - **shared_ids** (string) - JSON array of shared IDs #### Response Example { "23": { "id": "23", "date_created": "2024-02-01 09:55:08", "date_expiry": "2024-10-01 09:55:08", "user_id": "1", "batch_number": "c40b0dc24d", "supplier": "WP Overnight", "location": "Netherlands", "quantity": "20.0000", "quantity_available": "18.0000", "units": "1", "status": "active", "order_ids": "[1037,1038]", "shared_ids": "[275]" } } ``` -------------------------------- ### GET /products/{product_id} Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves details for a specific product. ```APIDOC ## GET /products/{product_id} ### Description Retrieves information for a specific product by its ID. ### Method GET ### Endpoint {{api_path}}/products/{product_id} ### Parameters #### Path Parameters - **product_id** (string) - Required - The ID of the product to retrieve. ``` -------------------------------- ### GET /products/batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves a list of all product batches. ```APIDOC ## GET /products/batches ### Description Retrieves a list of all product batches. ### Method GET ### Endpoint {{api_path}}/products/batches ``` -------------------------------- ### GET /products/batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves a list of all product batches. ```APIDOC ## GET /products/batches ### Description Retrieves all available product batches. ### Method GET ### Endpoint {{api_path}}/products/batches ``` -------------------------------- ### Example Server Error Message Source: https://docs.wpovernight.com/woocommerce-smart-reminder-emails/troubleshooting An example of a server-side error message that may appear when the environment does not support JSON partial matching. ```text Error during status transition. JSON partial matching not supported in your environment. Please check your MySQL/MariaDB version ``` -------------------------------- ### Using Placeholders in Email Templates Source: https://docs.wpovernight.com/woocommerce-smart-reminder-emails/email-placeholders Example of how to reference standard and custom placeholders within the reminder email editor. ```text The order was placed on {order_date} Here are the product descriptions: {all_product_descriptions} ``` -------------------------------- ### Broken Translation String Example Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-loco-translate-to-customize-translations An example of a translation string missing required placeholders. ```text Pour garder les limites de l'API %1$s sous contrôle, vous devez activer votre licence d'extension professionnelle pour utiliser ce service. Découvrez comment activer votre licence %2$s. ``` -------------------------------- ### Create a Custom Placeholder with PHP Source: https://docs.wpovernight.com/woocommerce-smart-reminder-emails/email-placeholders Use the wpo_wcsre_replace_ABCDE filter hook to define a new placeholder. This example demonstrates creating a placeholder that retrieves and displays all product descriptions from an order. ```php /** * WP Overnight * Introducing a new placeholder to display all product descriptions. **/ add_filter( 'wpo_wcsre_replace_all_product_descriptions', 'wpo_handle_all_product_descriptions_placeholder', 10, 2 ); function wpo_handle_all_product_descriptions_placeholder( string $output, WC_Abstract_Order $order ): string { $product_descriptions = array(); foreach ( $order->get_items() as $item ) { $product = $item->get_product(); if ( $product ) { $product_descriptions[] = $product->get_description(); } } $output = implode( "\n", $product_descriptions ); return $output; } ``` -------------------------------- ### Create or regenerate document JSON response Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-the-rest-api Example response returned after successfully creating or regenerating a document. ```json { "number": "1078", "date": "2024-03-02T13:37:25", "date_timestamp": 1709386645 } ``` -------------------------------- ### GET /products/batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves a list of all batches. ```APIDOC ## GET /products/batches ### Description Retrieves a list of all available batches. ### Method GET ### Endpoint {{api_path}}/products/batches ``` -------------------------------- ### CSV structure for existing batch updates Source: https://docs.wpovernight.com/woocommerce-batch-numbers/import-update-product-batch-data-using-wp-all-import-add-on Example of a CSV row containing a batch_id to update an existing product batch. ```text batch_id,date_expiry,product_id,batch_number,supplier,quantity,quantity_available,status 38,"2022-12-03 00:00:00",310,PWOWOWOWOWOWO,WPO,100,20,active ``` -------------------------------- ### Retrieve an order JSON response Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-the-rest-api Example structure of the response containing document details for an order. ```json { ... "documents": { "invoice": { "number": "1", "date": "2024-02-27T15:34:31", "date_timestamp": 1709048071 }, "proforma": { "number": 1, "date": "2024-02-23T13:25:50", "date_timestamp": 1708694750 }, "credit-note": [ { "number": 2, "date": "2024-02-28T10:34:31", "date_timestamp": 1735893084 }, { "number": 3, "date": "2024-02-28T10:34:32", "date_timestamp": 1735892964 } ] }, } ``` -------------------------------- ### Display order notes via action hooks Source: https://docs.wpovernight.com/article/displaying-order-notes Add these snippets to your theme's functions.php to inject order notes into documents. The second example restricts output to packing slips. ```php add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_order_notes', 10, 2 ); function wpo_wcpdf_order_notes ($template_type, $order) { $document = wcpdf_get_document( $template_type, $order ); $document->order_notes(); } ``` ```php add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_order_notes', 10, 2 ); function wpo_wcpdf_order_notes ($template_type, $order) { if ($template_type == 'packing-slip') { $document = wcpdf_get_document( $template_type, $order ); $document->order_notes(); } } ``` -------------------------------- ### Template Header and Footer Structure Source: https://docs.wpovernight.com/article/repeating-headers-footers Example of the top section of a template file with the footer positioned immediately following the header table. ```php
| has_header_logo() ) { $this->header_logo(); } else { echo $this->get_title(); } ?> |
shop_name(); ?>shop_address(); ?>
|
| has_header_logo() ) { $this->header_logo(); } else { echo $this->get_title(); } ?> | shop_name(); ?>shop_address(); ?> |
| has_header_logo() ) { $this->header_logo(); } else { echo $this->get_title(); } ?> |
shop_name(); ?>shop_address(); ?>
|
|
Return address: Some Company 123 Main Street Anytown, US 12345 |
| Return address: Some Company 123 Main Street Anytown, US 12345 |
|
Return address: Some Company 123 Main Street Anytown, US 12345 |
Please consider the environment before printing this document
```
--------------------------------
### GET /wp-json/wc/v3/orders/
```
--------------------------------
### GET /wc/wpo/wcpc/v1/wc-postcode-checker
Source: https://docs.wpovernight.com/woocommerce-postcode-checker/address-check-using-woocommerce-rest-api
Retrieves address details based on the provided postcode and house number.
```APIDOC
## GET /wc/wpo/wcpc/v1/wc-postcode-checker
### Description
Retrieves address information such as street and city based on a provided postcode and house number.
### Method
GET
### Endpoint
/wp-json/wc/wpo/wcpc/v1/wc-postcode-checker
### Parameters
#### Query Parameters
- **house_number** (string) - Required - The house number to check.
- **postcode** (string) - Required - The postcode to check.
### Response
#### Success Response (200)
- **address** (object) - Contains address details including postcode, housenumber, street, and city.
#### Response Example
{
"address": {
"postcode": "2012ES",
"housenumber": "30",
"housenumber_suffix": "",
"street": "Julianastraat",
"city": "Haarlem",
"data": {
"street": "Julianastraat",
"city": "Haarlem"
}
}
}
```
--------------------------------
### Display a product barcode via shortcode
Source: https://docs.wpovernight.com/woocommerce-ultimate-barcodes/display-a-barcode-using-a-shortcode
Use this shortcode to display a product barcode by providing the product ID.
```text
[wcub_product_barcode id="21"]
```
--------------------------------
### Authentication Error Response
Source: https://docs.wpovernight.com/woocommerce-postcode-checker/address-check-using-woocommerce-rest-api
Example of the error response received when there is an issue with the REST API authentication.
```json
{
"code": "woocommerce_rest_authentication_error",
"message": "Invalid signature - provided signature does not match.",
"data": {
"status": 401
}
}
```
--------------------------------
### Basic Shortcode Usage
Source: https://docs.wpovernight.com/woocommerce-batch-numbers/display-batch-number-on-product-pages-with-shortcode
Displays the batch number using default settings.
```text
[wcpbn_product_batch_numbers]
```
--------------------------------
### Example base64_decode error message
Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/server-requirements
This warning appears if the base64_decode function is restricted in the PHP configuration.
```text
"Warning: base64_decode() has been disabled for security reasons"
```
--------------------------------
### Document type placeholder usage
Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/add-an-additional-billing-email-address
Example of using the {document_type} placeholder within email content.
```text
Document type(s): {document_type}
```
--------------------------------
### Recipient field configuration
Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/add-an-additional-billing-email-address
Example format for entering multiple email recipients in the settings field.
```text
{customer}, test1@gmail.com, test2@gmail.com
```
--------------------------------
### Display default Menu Cart shortcode
Source: https://docs.wpovernight.com/wp-menu-cart/menu-cart-pro-shortcode
Use this basic shortcode to insert the shopping cart with default settings.
```text
[wpmenucart]
```
--------------------------------
### Batch Update JSON Response
Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2
Example of the JSON structure returned after a successful batch update request.
```json
{
"quantity_available": "20",
"po":
{
"date_created": "2023-01-16 00:00:00",
"po_number": "PO23456",
"supplier": "WPO",
"cost": 10.99,
"regular_price": 14.99,
"sale_price": 13.99,
"price_margin": 30.00,
"price_discount": 5.00
}
}
```
```json
{ "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } }
```
```json
{
"quantity_available": "20",
"po":
{
"date_created": "2023-01-16 00:00:00",
"po_number": "PO23456",
"supplier": "WPO",
"cost": 10.99,
"regular_price": 14.99,
"sale_price": 13.99,
"price_margin": 30.00,
"price_discount": 5.00
}
}
```
--------------------------------
### Address Verification JSON Response
Source: https://docs.wpovernight.com/woocommerce-postcode-checker/address-check-using-woocommerce-rest-api
Example of a successful JSON response returned by the address check endpoint.
```json
{
"address":
{
"postcode": "2012ES",
"housenumber": "30",
"housenumber_suffix": "",
"street": "Julianastraat",
"city": "Haarlem",
"data":
{
"street": "Julianastraat",
"city": "Haarlem"
}
}
}
```
--------------------------------
### PUT /wc/v3/products/