Documentation
ReturnDesk
Developer Reference

WindCodex ReturnDesk Developer Reference


Constants

ConstantValueDescription
RETURNDESK_VERSIONe.g. '1.0.4'Current plugin version
RETURNDESK_PLUGIN_FILEabsolute pathMain plugin file
RETURNDESK_PLUGIN_DIRabsolute pathPlugin directory (with trailing slash)
RETURNDESK_PLUGIN_URLURLPlugin directory URL (with trailing slash)
RETURNDESK_PLUGIN_BASErelative pathwindcodex-returndesk/windcodex-returndesk.php
RETURNDESK_SETTINGS_OPTION'returndesk_settings'Option key for all settings

Hooks

HookTypeDescription
returndesk_before_settingsActionFires at the top of the ReturnDesk settings page

ReturnDesk also uses WooCommerce's woocommerce_email_header and woocommerce_email_footer actions to wrap its emails.


My Account Endpoints

EndpointDescription
returndesk-requestsThe Returns tab listing the customer's requests
returndesk-returns"Start a return" page for choosing an order to return

Options

All settings are stored in the returndesk_settings option. Main keys:

KeyTypeDefaultDescription
enable_returnsyes/noyesMaster toggle
return_window_daysint7Return window in days
allowed_statusesarray['completed', 'processing']Eligible order statuses
return_allow_sale_productsyes/noyesAllow returns of sale items
return_reasonsstring4 defaultsOne reason per line
return_guidelinesstring (HTML)Default guidelinesReturn Guidelines
terms_page_idint0Terms & Conditions page ID
customer_messagestringDefault messageCustomer Success Message
return_store_address_1 … return_store_phonestringStore addressReturn address fields
admin_notification_emailstring''Admin notification address (blank = site admin email)
email_enable_*, email_subject_*, email_heading_*, email_body_*, email_items_title_*, email_additional_content_*stringDefaultsEmail template settings

Other options: returndesk_requests_table_version (database table version).


Database Table

Table: {prefix}returndesk_requests

ColumnTypeDescription
idbigint AUTO_INCREMENTRequest ID
order_idbigintWooCommerce order ID
customer_idbigint (nullable)WordPress user ID (empty for guests)
guest_emailvarchar (nullable)Billing email for guest requests
request_typevarcharreturn
statusvarcharpending / approved / rejected / cancelled
reasontextReason and customer message
items_jsonlongtextJSON list of requested items and quantities
attachment_ids_jsonlongtextJSON list of attachment IDs
refund_methodvarcharRefund method (used by Pro)
created_atdatetimeSubmission time
updated_atdatetimeLast update time