### GetNameservers Success Response Example Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Example of a successful response when retrieving nameservers for a domain. Includes hostnames for up to five nameservers. ```json { "status": "success", "data": { "ns1": "ns1.example.com", "ns2": "ns2.example.com", "ns3": "", "ns4": "", "ns5": "" } } ``` -------------------------------- ### RegisterDomain Action Example Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Example request for registering a new domain. Requires comprehensive contact details and service flags like DNS management and ID protection. ```json { "api_key": "your_api_key", "action": "RegisterDomain", "params": { "domainid": 123, "domainname": "example.com", "regperiod": 1, "dnsmanagement": true, "emailforwarding": false, "idprotection": true, "contacts": { "registrant": { "firstname": "John", "lastname": "Doe", "email": "john@example.com" }, "admin": { "firstname": "John", "lastname": "Doe", "email": "john@example.com" }, "tech": { "firstname": "Jane", "lastname": "Doe", "email": "jane@example.com" }, "billing": { "firstname": "John", "lastname": "Doe", "email": "billing@example.com" } } } } ``` -------------------------------- ### SaveNameservers Action Example Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Example request for updating the nameservers for a domain. Requires domain ID and name, along with at least two nameserver hostnames. ```json { "api_key": "your_api_key", "action": "SaveNameservers", "params": { "domainid": 123, "domainname": "example.com", "ns1": "ns1.provider-dns.net", "ns2": "ns2.provider-dns.net" } } ``` -------------------------------- ### Quick Example: Success Response Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Example of a successful response after a domain operation, indicating renewal status and the new expiry date. ```json { "status": "success", "data": { "renewed": true, "expirydate": "2027-03-25" } } ``` -------------------------------- ### Quick Example: Error Response Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Example of an error response, indicating a failure with a descriptive message. ```json { "status": "error", "message": "Domain is in redemption period" } ``` -------------------------------- ### TransferDomain Action Example Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Example request for transferring an existing domain. Requires EPP code, nameservers, and registrant contact information. ```json { "api_key": "your_api_key", "action": "TransferDomain", "params": { "domainid": 456, "domainname": "example.net", "eppcode": "AUTH-ABC-123", "regperiod": 1, "dnsmanagement": true, "emailforwarding": false, "idprotection": false, "nameservers": ["ns1.example.net", "ns2.example.net"], "contacts": { "registrant": { "firstname": "John", "lastname": "Doe", "email": "john@example.com" } } } } ``` -------------------------------- ### GetContactDetails Success Response Example Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Example of a successful response when retrieving contact details for a domain. Shows details for the 'Registrant' role. ```json { "status": "success", "data": { "Registrant": { "Full_Name": "John Doe", "Email": "john@example.com", "Address": "123 Main Street", "City": "Dhaka", "State": "Dhaka", "Zip": "1207", "Country": "BD", "Phone": "+8801000000000" } } } ``` -------------------------------- ### Quick Example: Renew Domain Request Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md An example of a request body for renewing a domain, including domain ID, name, and registration period. ```json { "api_key": "your_api_key", "action": "RenewDomain", "params": { "domainid": 123, "domainname": "example.com", "regperiod": 1 } } ``` -------------------------------- ### Module Installation and Configuration Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Details the file placement for the module and the activation path within the WHMCS admin panel. Lists the required configuration fields for API endpoint and key. ```text # File placement /path/to/whmcs/modules/registrars/domain_reseller_registrar/ domain_reseller_registrar.php hooks.php css/style.css logo.png whmcs.json # WHMCS Admin activation path Configuration > System Settings > Domain Registrars > Avalon Hosting Services > Activate # Required configuration fields API Endpoint : https://your-provider.example.com/api API Key : Enable Module Log : checked (optional, for debugging) ``` -------------------------------- ### Get TLD Pricing Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Retrieve pricing for all supported TLDs in the specified currency. The response is formatted for WHMCS `ImportItem`. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "GetTldPricing", "params": { "currency": "USD" } }' ``` -------------------------------- ### Initiate Domain Transfer with TransferDomain API Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Use this action to start an inbound domain transfer. It requires an EPP code, nameservers, registration period, add-on flags, and contact details for all four roles. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "TransferDomain", "params": { "domainid": 202, "domainname": "transferme.net", "eppcode": "AUTH-XYZ-789", "regperiod": 1, "dnsmanagement": true, "emailforwarding": false, "idprotection": false, "nameservers": ["ns1.provider-dns.net", "ns2.provider-dns.net"], "contacts": { "registrant": { "firstname": "Alice", "lastname": "Jones", "email": "alice@transferme.net", "country": "US", "phonenumber": "+12025550100" }, "admin": { "firstname": "Alice", "lastname": "Jones", "email": "alice@transferme.net" }, "tech": { "firstname": "Bob", "lastname": "Tech", "email": "tech@provider.net" }, "billing": { "firstname": "Alice", "lastname": "Jones", "email": "billing@transferme.net" } } } }' ``` -------------------------------- ### Get Current Nameservers with GetNameservers API Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Retrieves the current nameservers for a domain. This action can fetch up to five nameservers. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "GetNameservers", "params": { "domainid": 123, "domainname": "example.com" } }' ``` -------------------------------- ### Get Domain Suggestions Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Returns alternative domain name suggestions based on a search term and TLDs. ```APIDOC ## POST /api ### Description Returns alternative domain name suggestions based on a search term and TLDs. ### Method POST ### Endpoint https://provider.example.com/api ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "GetDomainSuggestions". - **params** (object) - Required - Parameters for the action. - **searchTerm** (string) - Required - The search term for domain suggestions. - **tldsToInclude** (array) - Required - An array of TLDs to include in the suggestions. ### Request Example ```json { "api_key": "sk_live_abc123", "action": "GetDomainSuggestions", "params": { "searchTerm": "myshop", "tldsToInclude": [".com", ".net", ".io", ".shop"] } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure. - **data** (array) - An array of domain suggestions. - **domainname** (string) - The suggested domain name. - **status** (string) - The availability status of the domain (e.g., "available", "unavailable"). #### Response Example ```json { "status": "success", "data": [ { "domainname": "myshop.io", "status": "available" }, { "domainname": "myshop.shop", "status": "available" }, { "domainname": "myshop.net", "status": "unavailable" } ] } ``` ``` -------------------------------- ### Get TLD Pricing Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Retrieves provider pricing for all supported TLDs in WHMCS ImportItem format. ```APIDOC ## POST /api ### Description Retrieves provider pricing for all supported TLDs in WHMCS ImportItem format. ### Method POST ### Endpoint https://provider.example.com/api ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "GetTldPricing". - **params** (object) - Required - Parameters for the action. - **currency** (string) - Required - The currency code for pricing (e.g., "USD"). ### Request Example ```json { "api_key": "sk_live_abc123", "action": "GetTldPricing", "params": { "currency": "USD" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure. - **data** (object) - Pricing data for TLDs. - **currency** (object) - Currency information. - **code** (string) - The currency code. - **tlds** (object) - An object where keys are TLDs (e.g., ".com"). - **register** (object) - Pricing for domain registration. - **1yr** (number) - Price for 1 year registration. - **2yr** (number) - Price for 2 years registration. - **3yr** (number) - Price for 3 years registration. - **renew** (object) - Pricing for domain renewal. - **1yr** (number) - Price for 1 year renewal. - **2yr** (number) - Price for 2 years renewal. - **transfer** (object) - Pricing for domain transfer. - **1yr** (number) - Price for 1 year transfer. #### Response Example ```json { "status": "success", "data": { "currency": { "code": "USD" }, "tlds": { ".com": { "register": { "1yr": 9.99, "2yr": 19.98, "3yr": 28.99 }, "renew": { "1yr": 11.99, "2yr": 23.98 }, "transfer": { "1yr": 9.99 } }, ".net": { "register": { "1yr": 10.99 }, "renew": { "1yr": 12.99 }, "transfer": { "1yr": 10.99 } }, ".io": { "register": { "1yr": 39.99 }, "renew": { "1yr": 44.99 } } } } } ``` ``` -------------------------------- ### Get Domain Name Suggestions Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Fetch alternative domain name suggestions based on a search term and specified TLDs. Used by the WHMCS domain search widget. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "GetDomainSuggestions", "params": { "searchTerm": "myshop", "tldsToInclude": [".com", ".net", ".io", ".shop"] } }' ``` -------------------------------- ### Get EPP Code for Domain Transfer Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Use this action to retrieve the EPP or authorization code required to transfer a domain away from the current registrar. Ensure you have the correct domain ID or name. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "GetEPPCode", "params": { "domainid": 123, "domainname": "example.com" } }' ``` -------------------------------- ### API Action: RegisterDomain using cURL Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Shows how to register a new domain using a cURL command. Includes parameters for domain details, registration period, add-ons, and contact information. Displays expected success and error responses. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "RegisterDomain", "params": { "domainid": 101, "domainname": "mynewdomain.com", "regperiod": 1, "dnsmanagement": true, "emailforwarding": false, "idprotection": true, "contacts": { "registrant": { "firstname": "Jane", "lastname": "Smith", "email": "jane@mynewdomain.com", "address1": "1 Example Road", "city": "Dhaka", "state": "Dhaka", "postcode": "1207", "country": "BD", "phonenumber": "+8801700000000" }, "admin": { "firstname": "Jane", "lastname": "Smith", "email": "admin@mynewdomain.com" }, "tech": { "firstname": "Bob", "lastname": "Tech", "email": "tech@provider.example.com" }, "billing": { "firstname": "Jane", "lastname": "Smith", "email": "billing@mynewdomain.com" } } } }' # Expected success response: # { "status": "success", "data": {} } ``` -------------------------------- ### Register Child Nameserver Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Use this action to register a child nameserver for a domain. Ensure the API key and domain details are correct. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "RegisterNameserver", "params": { "domainname": "example.com", "nameserver": "ns1.example.com", "ipaddress": "203.0.113.10" } }' ``` -------------------------------- ### Get DNS records Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Retrieves DNS zone records for a specified domain. ```APIDOC ## POST /api ### Description Retrieves DNS zone records for a specified domain. ### Method POST ### Endpoint https://provider.example.com/api ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "GetDNS". - **params** (object) - Required - Parameters for the action. - **domainname** (string) - Required - The domain name. ### Request Example ```json { "api_key": "sk_live_abc123", "action": "GetDNS", "params": { "domainname": "example.com" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure. - **data** (array) - An array of DNS records. - **hostname** (string) - The hostname of the record. - **type** (string) - The type of the DNS record (e.g., A, MX). - **address** (string) - The IP address or value of the record. - **priority** (integer) - The priority for MX records. - **ttl** (integer) - The Time To Live for the record. #### Response Example ```json { "status": "success", "data": [ { "hostname": "@", "type": "A", "address": "203.0.113.5", "ttl": 3600 }, { "hostname": "www", "type": "A", "address": "203.0.113.5", "ttl": 3600 }, { "hostname": "@", "type": "MX", "address": "mail.example.com", "priority": 10, "ttl": 3600 } ] } ``` ``` -------------------------------- ### Get DNS Records Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Retrieve all DNS zone records for a specified domain. This is useful for auditing or backup purposes. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "GetDNS", "params": { "domainname": "example.com" } }' ``` -------------------------------- ### RegisterNameserver Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Creates a child nameserver (glue record) for a domain. ```APIDOC ## RegisterNameserver ### Description Creates a child nameserver (glue record). ### Method POST (assumed, as it creates a resource) ### Endpoint / ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "RegisterNameserver". - **params** (object) - Required - WHMCS parameters for creating a nameserver. These are forwarded directly. ``` -------------------------------- ### GetDomainSuggestions Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Returns a list of suggested domain names. ```APIDOC ## GetDomainSuggestions ### Description Returns suggested domains. ### Method POST (assumed, as it retrieves data) ### Endpoint / ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "GetDomainSuggestions". - **params** (object) - Required - WHMCS parameters for getting domain suggestions. These are forwarded directly. ``` -------------------------------- ### Get Domain Registrar Lock Status Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Retrieves the current lock status of a domain. The response will indicate if the domain is 'locked' or 'unlocked'. ```bash # --- Get lock status --- curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "GetRegistrarLock", "params": { "domainid": 123, "domainname": "example.com" } }' ``` -------------------------------- ### Create and Push Git Tag Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/RELEASE_PROCESS.md Use signed annotated tags for creating release versions. Push the tag to GitHub to trigger the automated release workflow. ```bash git tag -s v2.0.1 -m "Release version 2.0.1" git push origin v2.0.1 ``` -------------------------------- ### GetNameservers Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Retrieves the nameservers configured for a domain. ```APIDOC ## GetNameservers ### Description Returns nameservers for a domain. ### Method POST ### Endpoint / ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "GetNameservers". - **params** (object) - Required - Action-specific parameters. - **domainid** (integer) - Required - WHMCS domain ID. - **domainname** (string) - Required - Full domain name (e.g., example.com). ### Response #### Success Response (200) - **status** (string) - "success". - **data** (object) - Action-specific response data. - **ns1** (string) - Nameserver 1. - **ns2** (string) - Nameserver 2. - **ns3** (string) - Nameserver 3 (optional). - **ns4** (string) - Nameserver 4 (optional). - **ns5** (string) - Nameserver 5 (optional). ### Response Example ```json { "status": "success", "data": { "ns1": "ns1.example.com", "ns2": "ns2.example.com", "ns3": "", "ns4": "", "ns5": "" } } ``` #### Error Response (400) - **status** (string) - "error". - **message** (string) - Human readable error message. - **data** (object) - Optional diagnostics. ``` -------------------------------- ### RegisterNameserver, ModifyNameserver, DeleteNameserver Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Actions to manage child nameservers (glue records), including creation, IP address updates, and deletion. ```APIDOC ## POST /api (RegisterNameserver) ### Description Creates a child nameserver (glue record) for a domain. ### Method POST ### Endpoint https://provider.example.com/api ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be set to "RegisterNameserver". - **params** (object) - Required - Contains parameters for the action. - **domainid** (integer) - Required - The ID of the domain. - **domainname** (string) - Required - The name of the domain. - **nameserver** (string) - Required - The hostname of the nameserver (e.g., "ns1.example.com"). - **ipaddress** (string) - Required - The IP address of the nameserver. ### Request Example ```json { "api_key": "sk_live_abc123", "action": "RegisterNameserver", "params": { "domainid": 123, "domainname": "example.com", "nameserver": "ns1.example.com", "ipaddress": "192.0.2.1" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation ('success' or 'error'). - **data** (object) - Contains the result of the operation (empty on success). #### Response Example ```json { "status": "success", "data": {} } ``` ## POST /api (ModifyNameserver) ### Description Updates the IP address for an existing child nameserver (glue record). ### Method POST ### Endpoint https://provider.example.com/api ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be set to "ModifyNameserver". - **params** (object) - Required - Contains parameters for the action. - **domainid** (integer) - Required - The ID of the domain. - **domainname** (string) - Required - The name of the domain. - **nameserver** (string) - Required - The hostname of the nameserver to modify. - **ipaddress** (string) - Required - The new IP address for the nameserver. ### Request Example ```json { "api_key": "sk_live_abc123", "action": "ModifyNameserver", "params": { "domainid": 123, "domainname": "example.com", "nameserver": "ns1.example.com", "ipaddress": "192.0.2.2" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation ('success' or 'error'). - **data** (object) - Contains the result of the operation (empty on success). #### Response Example ```json { "status": "success", "data": {} } ``` ## POST /api (DeleteNameserver) ### Description Deletes a child nameserver (glue record) for a domain. ### Method POST ### Endpoint https://provider.example.com/api ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be set to "DeleteNameserver". - **params** (object) - Required - Contains parameters for the action. - **domainid** (integer) - Required - The ID of the domain. - **domainname** (string) - Required - The name of the domain. - **nameserver** (string) - Required - The hostname of the nameserver to delete. ### Request Example ```json { "api_key": "sk_live_abc123", "action": "DeleteNameserver", "params": { "domainid": 123, "domainname": "example.com", "nameserver": "ns1.example.com" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation ('success' or 'error'). - **data** (object) - Contains the result of the operation (empty on success). #### Response Example ```json { "status": "success", "data": {} } ``` ``` -------------------------------- ### Sync and TransferSync Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Synchronizes domain information with the registry. Sync reconciles active/cancelled/transferred states and expiry dates. TransferSync reports the status of domain transfers. ```APIDOC ## POST /api (Sync) ### Description Reconciles a domain's active/cancelled/transferred state and expiry date with the registry. ### Method POST ### Endpoint https://provider.example.com/api ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be set to "Sync". - **params** (object) - Required - Contains parameters for the action. - **domainid** (integer) - Required - The ID of the domain. - **domainname** (string) - Required - The name of the domain. - **sld** (string) - Required - The second-level domain (e.g., "example"). - **tld** (string) - Required - The top-level domain (e.g., "com"). ### Request Example ```json { "api_key": "sk_live_abc123", "action": "Sync", "params": { "domainid": 123, "domainname": "example.com", "sld": "example", "tld": "com" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation ('success' or 'error'). - **data** (object) - Contains the synchronization results. - **active** (boolean) - Whether the domain is active. - **cancelled** (boolean) - Whether the domain is cancelled. - **transferredAway** (boolean) - Whether the domain has been transferred away. - **expirydate** (string) - The domain's expiry date in YYYY-MM-DD format. #### Response Example ```json { "status": "success", "data": { "active": true, "cancelled": false, "transferredAway": false, "expirydate": "2027-03-25" } } ``` ## POST /api (TransferSync) ### Description Reports transfer completion or failure. Used by WHMCS's automated transfer polling. ### Method POST ### Endpoint https://provider.example.com/api ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be set to "TransferSync". - **params** (object) - Required - Contains parameters for the action. - **domainid** (integer) - Required - The ID of the domain. - **domainname** (string) - Required - The name of the domain. - **sld** (string) - Required - The second-level domain (e.g., "transferme"). - **tld** (string) - Required - The top-level domain (e.g., "net"). ### Request Example ```json { "api_key": "sk_live_abc123", "action": "TransferSync", "params": { "domainid": 202, "domainname": "transferme.net", "sld": "transferme", "tld": "net" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation ('success' or 'error'). - **data** (object) - Contains the transfer status results. - **completed** (boolean) - Whether the transfer has completed successfully. - **failed** (boolean) - Whether the transfer has failed. - **expirydate** (string) - The domain's expiry date in YYYY-MM-DD format (if completed). - **reason** (string) - The reason for failure, if applicable. #### Response Example (Success) ```json { "status": "success", "data": { "completed": true, "failed": false, "expirydate": "2027-03-25", "reason": "" } } ``` #### Response Example (Failure) ```json { "status": "success", "data": { "completed": false, "failed": true, "expirydate": "", "reason": "Auth code rejected by gaining registrar" } } ``` ``` -------------------------------- ### RegisterDomain Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Registers a new domain with the specified details. ```APIDOC ## RegisterDomain ### Description Registers a new domain. ### Method POST ### Endpoint / ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "RegisterDomain". - **params** (object) - Required - Action-specific parameters. - **domainid** (integer) - Required - WHMCS domain ID. - **domainname** (string) - Required - Full domain name (e.g., example.com). - **regperiod** (integer) - Required - Registration period in years. - **dnsmanagement** (boolean) - Required - Enable DNS management. - **emailforwarding** (boolean) - Required - Enable email forwarding. - **idprotection** (boolean) - Required - Enable ID protection. - **contacts** (object) - Required - Contact details. - **registrant** (object) - Required - Registrant contact information. - **firstname** (string) - Required. - **lastname** (string) - Required. - **email** (string) - Required. - **admin** (object) - Required - Admin contact information. - **firstname** (string) - Required. - **lastname** (string) - Required. - **email** (string) - Required. - **tech** (object) - Required - Technical contact information. - **firstname** (string) - Required. - **lastname** (string) - Required. - **email** (string) - Required. - **billing** (object) - Required - Billing contact information. - **firstname** (string) - Required. - **lastname** (string) - Required. - **email** (string) - Required. ### Request Example ```json { "api_key": "your_api_key", "action": "RegisterDomain", "params": { "domainid": 123, "domainname": "example.com", "regperiod": 1, "dnsmanagement": true, "emailforwarding": false, "idprotection": true, "contacts": { "registrant": { "firstname": "John", "lastname": "Doe", "email": "john@example.com" }, "admin": { "firstname": "John", "lastname": "Doe", "email": "john@example.com" }, "tech": { "firstname": "Jane", "lastname": "Doe", "email": "jane@example.com" }, "billing": { "firstname": "John", "lastname": "Doe", "email": "billing@example.com" } } } } ``` ### Response #### Success Response (200) - **status** (string) - "success". - **data** (object) - Action-specific response data. #### Error Response (400) - **status** (string) - "error". - **message** (string) - Human readable error message. - **data** (object) - Optional diagnostics. ``` -------------------------------- ### Sync Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Synchronizes the registration state of a domain. ```APIDOC ## Sync ### Description Synchronizes registration state. ### Method POST (assumed, as it modifies data) ### Endpoint / ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "Sync". - **params** (object) - Required - Contains the domain identifiers and components for synchronization. - **domainid** (integer) - Required - The ID of the domain. - **domainname** (string) - Required - The name of the domain. - **sld** (string) - Required - The second-level domain (e.g., "example"). - **tld** (string) - Required - The top-level domain (e.g., "com"). ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation (e.g., "success"). - **data** (object) - Contains synchronization details. - **active** (boolean) - Indicates if the domain is active. - **cancelled** (boolean) - Indicates if the domain is cancelled. - **transferredAway** (boolean) - Indicates if the domain has been transferred away. - **expirydate** (string) - The expiry date of the domain. ``` -------------------------------- ### GetNameservers and SaveNameservers Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Retrieves and updates the nameservers for a domain. ```APIDOC ## POST https://provider.example.com/api ### Description Retrieves the current nameservers for a domain or replaces them. ### Method POST ### Endpoint https://provider.example.com/api ### Actions #### GetNameservers Retrieves the current nameservers (up to 5) for a domain. ##### Parameters - **api_key** (string) - Required - API key for authentication - **action** (string) - Required - Must be "GetNameservers" - **params** (object) - Required - Parameters for the action - **domainid** (integer) - Required - The ID of the domain - **domainname** (string) - Required - The name of the domain ##### Request Example ```json { "api_key": "sk_live_abc123", "action": "GetNameservers", "params": { "domainid": 123, "domainname": "example.com" } } ``` ##### Response Example (Success) ```json { "status": "success", "data": { "ns1": "ns1.example.com", "ns2": "ns2.example.com", "ns3": "", "ns4": "", "ns5": "" } } ``` #### SaveNameservers Replaces the current nameservers for a domain. ##### Parameters - **api_key** (string) - Required - API key for authentication - **action** (string) - Required - Must be "SaveNameservers" - **params** (object) - Required - Parameters for the action - **domainid** (integer) - Required - The ID of the domain - **domainname** (string) - Required - The name of the domain - **ns1** (string) - Optional - Primary nameserver address - **ns2** (string) - Optional - Secondary nameserver address - **ns3** (string) - Optional - Tertiary nameserver address - **ns4** (string) - Optional - Quaternary nameserver address - **ns5** (string) - Optional - Quinary nameserver address ##### Request Example ```json { "api_key": "sk_live_abc123", "action": "SaveNameservers", "params": { "domainid": 123, "domainname": "example.com", "ns1": "ns1.provider-dns.net", "ns2": "ns2.provider-dns.net", "ns3": "", "ns4": "", "ns5": "" } } ``` ##### Response Example (Success) ```json { "status": "success", "data": {} } ``` ``` -------------------------------- ### Register child nameserver Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Registers a child nameserver for a given domain. ```APIDOC ## POST /api ### Description Registers a child nameserver for a given domain. ### Method POST ### Endpoint https://provider.example.com/api ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "RegisterNameserver". - **params** (object) - Required - Parameters for the action. - **domainname** (string) - Required - The domain name. - **nameserver** (string) - Required - The nameserver to register. - **ipaddress** (string) - Required - The IP address of the nameserver. ### Request Example ```json { "api_key": "sk_live_abc123", "action": "RegisterNameserver", "params": { "domainname": "example.com", "nameserver": "ns1.example.com", "ipaddress": "203.0.113.10" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure. - **data** (object) - Empty object on success. #### Response Example ```json { "status": "success", "data": {} } ``` ``` -------------------------------- ### Check Domain Name Availability Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Checks if a specified domain name is available for registration. The response will contain a 'status' field indicating 'available' or 'unavailable'. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "CheckAvailability", "params": { "domainid": 0, "domain": "available-domain.com", "domainname": "available-domain.com" } }' ``` -------------------------------- ### GetTldPricing Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Retrieves TLD pricing information from the provider, formatted for WHMCS import. ```APIDOC ## GetTldPricing ### Description Returns provider TLD pricing mapped into WHMCS import format. ### Method POST (assumed, as it retrieves data) ### Endpoint / ### Parameters #### Request Body - **api_key** (string) - Required - Your API key. - **action** (string) - Required - Must be "GetTldPricing". - **params** (object) - Contains parameters for fetching TLD pricing. - **currency** (string) - Optional - The default WHMCS currency code (e.g., "USD"). ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation (e.g., "success"). - **data** (object) - Contains TLD pricing information. - **currency** (object) - An object containing currency details. - **code** (string) - The currency code (e.g., "USD"). - **tlds** (object) - A map containing pricing for different TLDs. - **[tld_name]** (object) - Pricing details for a specific TLD. - **register** (object) - Pricing for domain registration. - **1yr** (string) - Price for a 1-year registration. - **renew** (object) - Pricing for domain renewal. - **1yr** (string) - Price for a 1-year renewal. - **transfer** (object) - Pricing for domain transfer. - **1yr** (string) - Price for a 1-year transfer. ``` -------------------------------- ### Verify SHA256 Checksums Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/RELEASE_PROCESS.md Verify the integrity of downloaded release artifacts using SHA256 checksums. Commands are provided for Linux/macOS and Windows PowerShell. ```bash # Linux/macOS sha256sum -c whmcs-domain-registrar-module-v2.0.1.zip.sha256 ``` ```powershell # Windows PowerShell (Get-FileHash -Path "whmcs-domain-registrar-module-v2.0.1.zip" -Algorithm SHA256).Hash ``` -------------------------------- ### Internal API Call Function: reseller_callAPI Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Demonstrates the internal `reseller_callAPI` function used for all registrar operations. Shows how to call it directly and the expected request/response formats for domain renewal. ```php // Internal signature (called by all registrar hook functions): // reseller_callAPI(array $params, string $action, array $apiParams = []): array // Example – calling the API directly from a custom hook or test script: $moduleParams = [ 'customApiEndpoint' => 'https://provider.example.com/api', 'customApiKey' => 'sk_live_abc123', 'moduleLog' => true, // writes to WHMCS Module Log ]; $result = reseller_callAPI($moduleParams, 'RenewDomain', [ 'domainid' => 123, 'domainname' => 'example.com', 'regperiod' => 1, ]); if (isset($result['error'])) { // $result['error'] = 'Domain is in redemption period' echo 'Error: ' . $result['error']; } else { // $result = ['renewed' => true, 'expirydate' => '2027-03-25'] echo 'New expiry: ' . $result['expirydate']; } // Underlying HTTP request built by reseller_callAPI: // POST https://provider.example.com/api // Content-Type: application/json // { // "api_key": "sk_live_abc123", // "action": "RenewDomain", // "params": { "domainid": 123, "domainname": "example.com", "regperiod": 1 } // } // Provider success response expected: // { "status": "success", "data": { "renewed": true, "expirydate": "2027-03-25" } } // Provider error response expected: // { "status": "error", "message": "Domain is in redemption period" } ``` -------------------------------- ### Update Nameservers with SaveNameservers API Source: https://context7.com/avalonhostingservices/whmcs-domain-registrar-module/llms.txt Replaces the existing nameservers for a domain. You can specify up to five nameservers, including empty strings for unused slots. ```bash curl -s -X POST https://provider.example.com/api \ -H "Content-Type: application/json" \ -d '{ "api_key": "sk_live_abc123", "action": "SaveNameservers", "params": { "domainid": 123, "domainname": "example.com", "ns1": "ns1.provider-dns.net", "ns2": "ns2.provider-dns.net", "ns3": "", "ns4": "", "ns5": "" } }' ``` -------------------------------- ### Check Domain Availability Source: https://github.com/avalonhostingservices/whmcs-domain-registrar-module/blob/main/API.md Checks if a domain is available for registration. The response indicates the availability status. ```json { "status": "success", "data": { "status": "available" } } ```