Referral Program

Method Description

Invoked with a POST request. Operation name and input fields can be set up via Maestra framework. Details of method invocation can be found here.

POST https://api.maestra.io/v3/operations/{synch/asynch operation}?endpointId={unique ID of site/mobile app/etc.}&operation={operation name}&deviceUUID={unique device ID}

Accept: application/xml
Content-Type: application/xml
Authorization: SecretKey {Secret Key, check with the manager if it's mandatory}

<operation>
  <customer>
    <ids>
      <webSiteUserId>{invited customer ID}</webSiteUserId>
      <referralCode>{referral code for the invited customer to pass on further}</referralCode>
    </ids>
    <email>{invited customer email}</email>
    <mobilePhone>{invited customer mobile phone}</mobilePhone>
    <lastName>{invited customer last name}</lastName>
    <firstName>{invited customer first name}</firstName>
    <birthDate>{invited customer date of birth as YYYY-MM-DD}</birthDate>
    <area>
      <ids>
        <externalId>{invited customer area ID}</externalId>
      </ids>
    </area>
    <subscriptions>
      <subscription>
        <pointOfContact>{communication channel, email/SMS/etc.}</pointOfContact>
        <topic>{emailing topic}</topic>
        <isSubscribed>{subscription status, true/false}</isSubscribed>
        <valueByDefault>{subscription default value, true/false</valueByDefault>
      </subscription>
    </subscriptions>
    <customFields>
      <customField>{custom field value}</customField>
    </customFields>
  </customer>
  <referencedCustomer>
    <ids>
      <referralCode>{referral code of inviting customer}</referralCode>
      <customerId>{Maestra customer ID}</customerId>
      <webSiteUserId>{website ID of inviting customer}</webSiteUserId>
    </ids>
    <email>{email of inviting customer}</email>
    <mobilePhone>{mobile phone of inviting customer}</mobilePhone>
  </referencedCustomer>
</operation>

Use 'referencedCustomer' to pass an existing customer. Use 'customer' to pass a customer you want to add. This doesn't depend on whether the customer is signing up with or without an invitation.

Referral codes are generated by the client. You just need to pass the referral code on customer sign-up. You can use any customer ID or even his contact as the code.

Sample Operations

POST https://api.maestra.io/v3/operations/async?endpointId=Maestra&operation=RegistartionByReferrealCode

Accept: application/xml
Content-Type: application/xml
Authorization: SecretKey 2a4wVO

<operation>
  <customer>
    <ids>
      <referralCode>ASDFG</referralCode>
    </ids>
    <email>[email protected]</email>
    <mobilePhone>5552368</mobilePhone>
    <lastName>Smith</lastName>
    <firstName>John</firstName>
  </customer>
  <referencedCustomer>
    <ids>
      <referralCode>QWERTY</referralCode>
    </ids>
  </referencedCustomer>
</operation>
POST https://api.maestra.io/v3/operations/async?endpointId=Maestra&operation=InviteFriend

Accept: application/xml
Content-Type: application/xml
Authorization: SecretKey 2a4wVO

<operation>
  <customer>
    <email>[email protected]</email>
    <firstName>John</firstName>
  </customer>
  <referencedCustomer>
    <ids>
      <customerId>12345</customerId>
    </ids>
  </referencedCustomer>
</operation>

Response

<result>
    <status>Success</status>
    <customer>
    	<processingStatus>Created</processingStatus>
    </customer>
    <referencedCustomer>
    	<processingStatus>Found</processingStatus>
    </referencedCustomer>
</result>
<result>
    <status>Success</status>
    <customer>
    	<processingStatus>NotProcessed</processingStatus>
    </customer>
    <referencedCustomer>
    	<processingStatus>NotFound</processingStatus>
    </referencedCustomer>
</result>