How to create affiliates through api and capture all information of affiliates through api?

How to create affiliates through api and capture all information of affiliates through api php?

You can use the data object with the api to reference the affiliate table:
https://developer.infusionsoft.com/docs/table-schema/

You’ll want to also look at the Referral table which defines the relationship between contact/client and the affiliate.