TLD & Pricing Sync

In WHASOLS the Registrar TLD & Pricing Sync Utility allows for a registrar module to support importing TLDs and pricing.

Users can use the Sync Utility to import TLDs and automatically apply a defined margin markup.

To integrate this functionality into your registrar module, you must define a GetTldPricing function that builds and returns a ResultList object containing ImportItems defining TLDs and their cost pricing.
Method Type Required/Optional Notes
ExtensionstringRequired The extension to import. Example: .com, .net, or .co.uk
MinYearsintOptional The minimum number of years that the extension can be registered for. Default: 1
MaxYearsintOptional The maximum number of years that the extension can be registered for. Default: 10
YearsStepintOptional The number of years between each registration period. Default: 1
RegisterPricefloatRequired The registration cost price for the minimum registration period term.
RenewPricefloatOptional The renewal cost price for the minimum registration period term. Pass null if renewals are not supported.
TransferPricefloatOptional The transfer cost price for the minimum registration period term. Pass null if transfers are not supported.
GraceFeeDaysintOptional The grace period for the extension.
GraceFeePricefloatOptional The grace fee cost price for the extension. Pass null if grace periods are not supported.
RedemptionFeeDaysintOptional The redemption period for the extension.
RedemptionFeePricefloatOptional The redemption fee cost price for the extension. Pass null if redemption periods are not supported.
CurrencystringRequired The ISO4217 three letter currency code that registrar cost prices are defined in. This currency must exist within the WHASOLS installation. eg. USD, GBP, etc
EppRequiredbooleanOptional Does the extension require an EPP code for transfer requests
YearsarrayOptional Use in place of MinYears, MaxYears, and YearsStep for extensions with more specialised pricing. Default:array()

Example Usage

<?php
function yourmodule_GetTldPricing($params)
{
    try {
        $api = yourmodule_getApiClient($params);
        $extensionData = $api->GetTldPrices();
        $results = [];
        foreach ($extensionData as $extension)
        {
            // All the set methods can be chained and utilised together.
            $results[] = [
                "Extension"=>$extension['tld'],
                "YearsStep"=>$extension['YearsStep'],
                "MinYears"=>$extension['minPeriod'],
                "MaxYears"=>$extension['maxPeriod'],
                "RegisterPrice"=>$extension['registrationPrice'],
                "RenewPrice"=>$extension['renewalPrice'],
                "TransferPrice"=>$extension['transferPrice'],
                "RedemptionFeeDays"=>$extension['redemptionDays'],
                "RedemptionFeePrice"=>$extension['redemptionFee'],
                "GraceFeeDays"=>$extension['GraceFeeDays'],
                "GraceFeePrice"=>$extension['GraceFeePrice'],
                "Currency"=>$extension['currencyCode'],
                "EppRequired"=>$extension['transferSecretRequired'],
                "Years"=>["YearsStep"=>$extension['YearsStep'],"MinYears"=>$extension['minPeriod'],"MaxYears"=>$extension['maxPeriod']],
                ];
        }
        return ['status'=>'success','message'=>'Your Message Here','response'=>$results];
    } catch (\Exception $e) {
        return ['status'=>'error','message'=> 'Your Custom Error Message Here:' . $e->getMessage()];
    }
}