API/Services/CreateAccountDicountSubscription

From Emersion
Jump to: navigation, search

Purpose

This method is designed to allow the user a method to create an account discount subscription against their existing client.

Inputs

  <soapenv:Body>
     <ser:CreateAccountDiscountSubscription>
        <ser:AccountID>?</ser:AccountID>
        <ser:DiscountPlanID>?</ser:DiscountPlanID>
        <ser:DateEffective>?</ser:DateEffective>
     </ser:CreateAccountDiscountSubscription>
  </soapenv:Body>


Important notes: - AccountID needs to be the ID of the Account in the Emersion system - DiscountPlanID needs to be the ID of the Discount Plan in the Emersion system - DateEffective has to be a valid date, it’s an optional field

Example Validation Error:

 <SOAP-ENV:Body>
     <SOAP-ENV:Fault>
        <faultcode>SOAP-ENV:Client</faultcode>
        <faultstring>Validation Error</faultstring>
        <faultactor>http://emersion.com.au/Services</faultactor>
        <detail>Could not find Account ID!</detail>
     </SOAP-ENV:Fault>
  </SOAP-ENV:Body>

Validation rules:

- Account Exists

- Account is a direct child of the account calling the API

- Account Discount Plan Exists

- Account Discount Plan owner is the same as the account calling the API


Output

 <SOAP-ENV:Body>
     <ns1:CreateDiscountSubscriptionResponse>
        <ns1:AccountDiscountSubscriptionID>100013</ns1:AccountDiscountSubscriptionID>
     </ns1:CreateDiscountSubscriptionResponse>
  </SOAP-ENV:Body>

This Account Discount Subscription doesn't have a Start Date!

Error String:

- Invalid or Missing Account ID

- Invalid or Missing Discount Plan ID

- Could not find Account ID!

- You do not have permission to modify this Account!

- Account Discount Plan specified does not exist in the database!

- You do not have permission to modify this Account Discount Plan!