{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"TLD & Pricing Sync","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":"tld--pricing-sync","__idx":0},"children":["TLD & Pricing Sync"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In WHMCS 7.10 and later, the Registrar TLD & Pricing Sync Utility allows for a registrar module to support importing TLDs and pricing."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Users can use the Sync Utility to import TLDs and automatically apply a defined margin markup."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To integrate this functionality into your registrar module, you must define a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GetTldPricing"]}," function that builds and returns a ResultList object containing ImportItems defining TLDs and their cost pricing."]},{"$$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":"Method"},"children":["Method"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required/Optional"},"children":["Required/Optional"]},{"$$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":["setExtension"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The extension to import. Example: .com, .net, or .co.uk"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setMinYears"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The minimum number of years that the extension can be registered for. Default: 1"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setMaxYears"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The maximum number of years that the extension can be registered for. Default: 10"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setYearsStep"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The number of years between each registration period. Default: 1"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setRegisterPrice"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The registration cost price for the minimum registration period term."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setRenewPrice"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The renewal cost price for the minimum registration period term. Pass null if renewals are not supported."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setTransferPrice"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The transfer cost price for the minimum registration period term. Pass null if transfers are not supported."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setGraceFeeDays"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The grace period for the extension."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setGraceFeePrice"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The grace fee cost price for the extension. Pass null if grace periods are not supported."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setRedemptionFeeDays"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The redemption period for the extension."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setRedemptionFeePrice"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The redemption fee cost price for the extension. Pass null if redemption periods are not supported."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setCurrency"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ISO4217 three letter currency code that registrar cost prices are defined in. This currency must exist within the WHMCS installation. eg. USD, GBP, etc...."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setEppRequired"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Does the extension require an EPP code for transfer requests"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["setYears"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use in place of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setMinYears"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setMaxYears"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setYearsStep"]}," for extensions with more specialised pricing. Default: array()"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-usage","__idx":1},"children":["Example Usage"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"use WHMCS\\Domain\\TopLevel\\ImportItem;\nuse WHMCS\\Results\\ResultsList;\n\nfunction modulename_GetTldPricing(array $params)\n{\n    // Perform API call to retrieve extension information\n    // A connection error should return a simple array with error key and message\n    // return ['error' => 'This error occurred',];\n\n    $results = new ResultsList;\n\n    foreach ($extensionData as $extension) {\n        // All the set methods can be chained and utilised together.\n        $item = (new ImportItem)\n            ->setExtension($extension['tld'])\n            ->setMinYears($extension['minPeriod'])\n            ->setMaxYears($extension['maxPeriod'])\n            ->setRegisterPrice($extension['registrationPrice'])\n            ->setRenewPrice($extension['renewalPrice'])\n            ->setTransferPrice($extension['transferPrice'])\n            ->setRedemptionFeeDays($extension['redemptionDays'])\n            ->setRedemptionFeePrice($extension['redemptionFee'])\n            ->setCurrency($extension['currencyCode'])\n            ->setEppRequired($extension['transferSecretRequired']);\n\n        $results[] = $item;\n    }\n    return $results;\n}\n"},"children":[]}]},"headings":[{"value":"TLD & Pricing Sync","id":"tld--pricing-sync","depth":1},{"value":"Example Usage","id":"example-usage","depth":2}],"frontmatter":{"title":"TLD & Pricing Sync","seo":{"title":"TLD & Pricing Sync"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/domain-registrars/tld-pricing-sync","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}