---
updatedAt: 2025-11-11T21:42:02.000Z
agentTools:
  projectIndex: https://domains.opensrs.guide/llms.txt
---

# get_domain_affiliate_id

Retrieves the affiliate id associated with a domain.

## Request parameters

#### Standard request parameters

* **action** = get\_domain\_affiliate\_id
* **object** = domain

### Request attributes

| Parameter | Obligation | Definition/Value               |
| :-------- | :--------- | :----------------------------- |
| domain    | Required   | The domain name to be queried. |

***

## Response parameters

#### Standard response parameters

* **action** = reply
* **object** = domain
* is\_success = Boolean indicating success or failure of the request.
* response\_code = Response code indicating outcome of the request.
* response\_text = Message describing the outcome of the request.

### Response attributes

If the request is successful, the **attributes** associative array may include the following:

| Parameter     | Obligation      | Definition/Value                             |
| :------------ | :-------------- | :------------------------------------------- |
| affiliate\_id | Always returned | The affiliate id associated with the domain. |

***

## Example

```xml Request
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE OPS_envelope SYSTEM 'ops.dtd'>
<OPS_envelope>
  <header>
    <version> 0.9 </version>
  </header>
  <body>
    <data_block>
      <dt_assoc>
        <item key="protocol">XCP</item>
        <item key="object">DOMAIN</item>
        <item key="action">GET_DOMAIN_AFFILIATE_ID</item>
        <item key="attributes">
          <dt_assoc>
            <item key="domain">example.com</item>
          </dt_assoc>
        </item>
      </dt_assoc>
    </data_block>
  </body>
</OPS_envelope>
```
```xml Response: if affiliate_id exists
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
  <header>
    <version> 0.9 </version>
  </header>
  <body>
    <data_block>
      <dt_assoc>
        <item key="protocol">XCP</item>
        <item key="object">DOMAIN</item>
        <item key="action">REPLY</item>
        <item key="is_success">1</item>
        <item key="attributes">
          <dt_assoc>
            <item key="affiliate_id">AFFILIATE_ID</item>
          </dt_assoc>
        </item>
        <item key="response_code">200</item>
        <item key="response_text">Command Successful</item>
      </dt_assoc>
    </data_block>
  </body>
</OPS_envelope>
```
```xml Response: if affiliate_id does not exist
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
  <header>
    <version> 0.9 </version>
  </header>
  <body>
    <data_block>
      <dt_assoc>
        <item key="protocol">XCP</item>
        <item key="object">DOMAIN</item>
        <item key="action">REPLY</item>
        <item key="is_success">1</item>
        <item key="attributes">
          <dt_assoc>
            <item key="affiliate_id"></item>
          </dt_assoc>
        </item>
        <item key="response_code">200</item>
        <item key="response_text">Command Successful</item>
      </dt_assoc>
    </data_block>
  </body>
</OPS_envelope>
```