{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-api/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"GetOrders","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"getorders","__idx":0},"children":["GetOrders"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Obtain orders matching the passed criteria"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"request-parameters","__idx":1},"children":["Request Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["action"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"GetOrders\""]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["limitstart"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The offset for the returned order data (default: 0)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["limitnum"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The number of records to return (default: 25)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Find orders for a specific id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["userid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Find orders for a specific client id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["requestor_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Find orders for a specific requestor id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["status"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Find orders for a specific status"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"response-parameters","__idx":2},"children":["Response Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["result"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The result of the operation: success or error"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["totalresults"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The total number of results available"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["startnumber"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The starting number for the returned results"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["numreturned"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The number of results returned"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["orders"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An array of orders matching the criteria passed"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-request-curl","__idx":3},"children":["Example Request (CURL)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, 'https://www.example.com/includes/api.php');\ncurl_setopt($ch, CURLOPT_POST, 1);\ncurl_setopt($ch, CURLOPT_POSTFIELDS,\n    http_build_query(\n        array(\n            'action' => 'GetOrders',\n            // See https://developers.whmcs.com/api/authentication\n            'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',\n            'password' => 'SECRET_OR_HASHED_PASSWORD',\n            'id' => '1',\n            'responsetype' => 'json',\n        )\n    )\n);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n$response = curl_exec($ch);\ncurl_close($ch);\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-request-local-api","__idx":4},"children":["Example Request (Local API)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$command = 'GetOrders';\n$postData = array(\n    'id' => '1',\n);\n$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later\n\n$results = localAPI($command, $postData, $adminUsername);\nprint_r($results);\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-response-json","__idx":5},"children":["Example Response JSON"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{\n    \"result\": \"success\",\n    \"totalresults\": 1,\n    \"startnumber\": 0,\n    \"numreturned\": 1,\n    \"orders\": {\n        \"order\": [\n            {\n                \"id\": 1,\n                \"ordernum\": 7858259149,\n                \"userid\": 1,\n                \"contactid\": 0,\n                \"requestor_id\": 1,\n                \"admin_requestor_id\": 0,\n                \"date\": \"2020-09-23 13:59:35\",\n                \"nameservers\": \"\",\n                \"transfersecret\": \"\",\n                \"renewals\": \"\",\n                \"renewalsByType\": {\n                    \"domains\": [],\n                    \"services\": [],\n                    \"addons\": []\n                },\n                \"promocode\": \"\",\n                \"promotype\": \"\",\n                \"promovalue\": \"\",\n                \"orderdata\": \"}\",\n                \"amount\": \"8.00\",\n                \"paymentmethod\": \"stripe\",\n                \"invoiceid\": 1,\n                \"status\": \"Active\",\n                \"ipaddress\": \"123.456.789.110\",\n                \"fraudmodule\": \"fraudlabs\",\n                \"fraudoutput\": \"{\\\"is_country_match\\\":\\\"Y\\\",\\\"is_high_risk_country\\\":\\\"N\\\",\\\"distance_in_km\\\":484.990000000000009094947017729282379150390625,\\\"distance_in_mile\\\":301.3600000000000136424205265939235687255859375,\\\"ip_country\\\":\\\"US\\\",\\\"ip_continent\\\":\\\"North America\\\",\\\"ip_region\\\":\\\"Texas\\\",\\\"ip_city\\\":\\\"Houston\\\",\\\"ip_latitude\\\":\\\"29.8284\\\",\\\"ip_longitude\\\":\\\"-95.4696\\\",\\\"ip_timezone\\\":\\\"-04:00\\\",\\\"ip_elevation\\\":\\\"104\\\",\\\"ip_domain\\\":\\\"whmcs.com\\\",\\\"ip_mobile_mnc\\\":\\\"NA\\\",\\\"ip_mobile_mcc\\\":\\\"NA\\\",\\\"ip_mobile_brand\\\":\\\"NA\\\",\\\"ip_netspeed\\\":\\\"DSL\\\",\\\"ip_isp_name\\\":\\\"WHMCS\\\",\\\"ip_usage_type\\\":\\\"Commercial\\\",\\\"is_free_email\\\":\\\"Y\\\",\\\"is_new_domain_name\\\":\\\"N\\\",\\\"is_domain_exists\\\":\\\"Y\\\",\\\"is_proxy_ip_address\\\":\\\"N\\\",\\\"is_bin_found\\\":\\\"NA\\\",\\\"is_bin_country_match\\\":\\\"NA\\\",\\\"is_bin_name_match\\\":\\\"NA\\\",\\\"is_bin_phone_match\\\":\\\"NA\\\",\\\"is_bin_prepaid\\\":\\\"NA\\\",\\\"is_address_ship_forward\\\":\\\"N\\\",\\\"is_bill_ship_city_match\\\":\\\"Y\\\",\\\"is_bill_ship_state_match\\\":\\\"Y\\\",\\\"is_bill_ship_country_match\\\":\\\"Y\\\",\\\"is_bill_ship_postal_match\\\":\\\"Y\\\",\\\"is_ship_address_blacklist\\\":\\\"N\\\",\\\"is_phone_blacklist\\\":\\\"N\\\",\\\"is_ip_blacklist\\\":\\\"N\\\",\\\"is_email_blacklist\\\":\\\"N\\\",\\\"is_credit_card_blacklist\\\":\\\"NA\\\",\\\"is_device_blacklist\\\":\\\"NA\\\",\\\"is_user_blacklist\\\":\\\"NA\\\",\\\"is_high_risk_username\\\":\\\"NA\\\",\\\"is_export_controlled_country\\\":\\\"NA\\\",\\\"is_malware_exploit\\\":\\\"NA\\\",\\\"user_order_id\\\":\\\"7858259149\\\",\\\"user_order_memo\\\":\\\"\\\",\\\"fraudlabspro_score\\\":14,\\\"fraudlabspro_distribution\\\":\\\"57\\\",\\\"fraudlabspro_status\\\":\\\"APPROVE\\\",\\\"fraudlabspro_id\\\":\\\"20200923-SAMPLE\\\",\\\"fraudlabspro_version\\\":\\\"1.5.1\\\",\\\"fraudlabspro_error_code\\\":\\\"\\\",\\\"fraudlabspro_message\\\":\\\"\\\",\\\"fraudlabspro_credits\\\":496,\\\"http_response_code\\\":200}\",\n                \"notes\": \"Sample Notes!\",\n                \"paymentmethodname\": \"Stripe\",\n                \"paymentstatus\": \"Paid\",\n                \"name\": \"WHMCS Tester\",\n                \"currencyprefix\": \"$\",\n                \"currencysuffix\": \"USD\",\n                \"frauddata\": \"\",\n                \"validationdata\": \"\",\n                \"lineitems\": {\n                    \"lineitem\": [\n                        {\n                            \"type\": \"product\",\n                            \"relid\": 1,\n                            \"producttype\": \"Other Product\\/Service\",\n                            \"product\": \"SSL Certificates - Rapid SSL\",\n                            \"domain\": \"sampledomain.com\",\n                            \"billingcycle\": \"One-Time\",\n                            \"amount\": \"8.00\",\n                            \"status\": \"Active\"\n                        }\n                    ]\n                }\n            }\n        ]\n    }\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"version-history","__idx":6},"children":["Version History"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Version"},"children":["Version"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Changelog"},"children":["Changelog"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Initial Version"]}]}]}]}]}]},"headings":[{"value":"GetOrders","id":"getorders","depth":1},{"value":"Request Parameters","id":"request-parameters","depth":3},{"value":"Response Parameters","id":"response-parameters","depth":3},{"value":"Example Request (CURL)","id":"example-request-curl","depth":3},{"value":"Example Request (Local API)","id":"example-request-local-api","depth":3},{"value":"Example Response JSON","id":"example-response-json","depth":3},{"value":"Version History","id":"version-history","depth":3}],"frontmatter":{"title":"GetOrders","seo":{"title":"GetOrders"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/api-reference/getorders","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}