# Affiliate Account Postbacks

*Article Topics:* [*Sites*](/getting-started/common-topics/sites.md)*,* [*Affiliates*](/getting-started/common-topics/affiliates.md)

NATS has to ability to post information to a script of your choice for new affiliate signups as well as affiliate account changes. These postbacks can be enabled from the Configuration admin.&#x20;

For other postback examples, please see [Postbacks and Post URLs](/nats-admin/sites/further-reading/postbacks-and-post-urls.md).

## Configuration Admin

If you would like to enable these postbacks, go to the [Configuration Admin ](/nats-admin/configuration.md)and select "Postback" from the Current Section drop-down menu. You will then see the following configurations under the "Affiliate Account Postback" sub-section

* POST\_ACCOUNT\_SIGNUP - Receive a postback when a new affiliate signs up.
* POST\_ACCOUNT\_CHANGES - Receive a postback when an existing affiliate updates their account information.

### Postback Logging Script

The following example script allows you to log the contents of a postback

{% hint style="warning" %}
**Please Note:** Make sure that the log is NOT in a web accessible folder.
{% endhint %}

```
<?php

	$file = '/path/to/nats4/logs/postback_logs.txt';
	// Open the file to get existing content
	$post = print_r($_REQUEST, TRUE);
	file_put_contents($file, $post, FILE_APPEND);
 
?>
```

## Account Signup Postback Format

Here is an example log of the POST\_ACCOUNT\_SIGNUP:

```
Array
(
    [loginid] => 77
    [username] => afftest72
    [deleted] => 0
    [type] => 0
    [skinid] => 102
    [payvia_type_id] => 1
    [status] => 0
    [join_date] => 1437757101
    [inhouse] => 0
    [tmmid] => 0
    [origin] => 0
    [payout_period_id] => 0
    [firstname] => nick
    [lastname] => test
    [email] => afftest72@gmail.com
    [date_posted] => 1437757101
    [join_ip] => 168430111
    [reviewed] => 0
    [minimum_payout] => 50
    [bonus] => 0
    [bonus_used] => 0
    [unencoded] => 0
    [startpage] => internal.php
    [rep_baseline] => 0
    [company] => tmm
    [url] => AFFTEST.COM
    [address1] => 123+address
    [address2] => addresscont
    [city] => testcity
    [state] => nj
    [country] => US
    [zip_code] => 12345
    [invoicer] => 0
    [req_docs] => 0
    [w9] => 0
    [mailok] => 1
    [trust_level] => 0
    [new_notification] => 0
    [latest_news] => 0
    [default_campaign] => 0
    [default_program] => 0
    [default_site] => 0
    [pv_instant] => 0
    [payout_approval] => 0
    [access_preset] => 0
    [custom1] => 0
    [custom2] => 0
    [custom3] => 0
    [custom4] => 0
    [custom5] => 0
    [remote_access] => 0
    [remote_payment] => 0
    [remote_adtool] => 0
    [allow_subscription_passthrough] => 0
    [allow_option_force] => 0
    [affiliate_referral] => Array
        (
            [loginid] => 4
            [username] => AccountRep1
        )
    [Address] => 123+address
    [Address_2] => addresscont
    [City] => testcity
    [Country] => United States
    [Pay_To] => nopay
    [State] => nj
    [Zip_Code] => 12345
)
```

## Account Changes Postback Format

NATS will postback the loginid, and only the fields that have changed for your affiliate. Here is an exmaple log from the POST\_ACCOUNT\_CHANGES postback when changing first name, last name, address, and city for loginid 3:

```
Array
(
    [firstname] => testname
    [lastname] => testlast
    [address1] => 123+test
    [city] => testcity
    [loginid] => 3
)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.toomuchmedia.com/nats-admin/sites/further-reading/postbacks-and-post-urls/affiliate-account-postbacks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
