# Get a URL to purchase a domain

This function returns a URL for the configured domain store's checkout page. This URL allows the user to complete the purchase of a domain name.

Note:

This function requires the domain_recommendation feature.

Endpoint: GET /DomainRecommendations/purchase_domain
Version: 11.137.9999.106
Security: BasicAuth

## Query parameters:

  - `domain` (string, required)
    The fully-qualified domain name (FQDN) to purchase.

Note:

This value must include the TLD (for example, mybusiness.com).
    Example: "mybusiness.com"

  - `period` (integer, required)
    The registration period in years.
    Example: 1

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "purchase_domain"

  - `module` (string)
    The name of the module called.
    Example: "DomainRecommendations"

  - `result` (object)

  - `result.data` (object)
    An object that contains the URL to complete the domain purchase.

  - `result.data.purchase_url` (string)
    The URL to redirect the user to in order to complete the domain purchase through the configured store.
    Example: "https://store.example.com/cart.php?a=add&domain=register&sld=mybusiness&tld=.com&regperiod=1"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    * 1 — Success.
* 0 — Failed. Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.


