Add Membership to Account
This request creates a membership record and attaches it to an existing Account. It also creates a payment record, which is attached to the membership. To create a payment, you’ll need to know the tender type. Prior to making this request, you’ll need to know the ID of the account to which you want to attach this membership, and the ID of the Membership Term.
REST
Request
https://api.neoncrm.com/neonws/services/api/membership/addMembershipToAccount?userSessionId=T1361083726537&membership.membershipTerm.termInfo.id=505&membership.accountId=123958&membership.autoRenewal=false&membership.source.id=51&membership.customFieldDataList.customFieldData.fieldId=625&membership.customFieldDataLIst.fieldValue=a test purchase&payment.amount=360&payment.note=for membership term 507&payment.tenderType.id=4&payment.creditCardOnlinePayment.cardNumber=4757077614429236&payment.creditCardOnlinePayment.expirationMonth=9&payment.creditCardOnlinePayment.expirationYear=15&payment.creditCardOnlinePayment.cardType.name=visa&payment.creditCardOnlinePayment.CVV2=201&payment.creditCardOnlinePayment.billingAddressLine1=14/349 Geoge Street&payment.creditCardOnlinePayment.city=Chicago&payment.creditCardOnlinePayment.state.code=IL&payment.creditCardOnlinePayment.country.id=1&payment.creditCardOnlinePayment.zipCode=60009&payment.creditCardOnlinePayment.cardHolder=Dark Smith
Response
{
"addMembershipToAccountResponse": {
"operationResult": "SUCCESS",
"responseMessage": "Membership created.",
"responseDateTime": "2013-02-17T14:37:11.115-06:00",
"membershipId": 6581,
"transaction": {
"transactionId": 55571,
"transactionStatus": "Succeed",
"payments": {
"payment": {
"paymentId": 44075,
"amount": 360,
"paymentStatus": "Succeed",
"note": "for membership term 507",
"tenderType": {
"id": 4,
"name": "Credit Card(Online)"
},
"creditCardOnlinePayment": {
"cardNumber": ************9236,
"expirationMonth": 9,
"expirationYear": 15,
"cardType": {
"code": "v",
"name": ""
},
"cardHolder": "Dark Smith",
"billingAddressLine1": "14/349 Geoge Street",
"city": "Chicago",
"state": {
"code": "IL"
},
"country": {
"id": 1,
"name": "United States"
},
"zipCode": 60009
}
}
}
}
}
}
SOAP
Request
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:neon="http://www.z2systems.com/schemas/neonws/">
<soapenv:header>
<soapenv:body>
<neon:addmembershiptoaccountrequest>
<usersessionid>[session id]</usersessionid>
<membership>
<accountid>123958</accountid>
<membershipterm>
<terminfo>
<id>505</id>
</terminfo>
</membershipterm>
<autorenewal>false</autorenewal>
<source>
<id>51</id>
<name></name>
<customfielddatalist>
<customfielddata>
<fieldid>625</fieldid>
<fieldvalue>customer field 1</fieldvalue>
</customfielddata>
</customfielddatalist>
</membership>
<payment>
<amount>360</amount>
<note>cash payment</note>
<tendertype>
<id>1</id>
</tendertype>
</payment>
</neon:addmembershiptoaccountrequest>
</soapenv:body>
</soapenv:header>
</soapenv:envelope>
Response
<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:body>
<ns2:addmembershiptoaccountresponse xmlns:ns2="http://www.z2systems.com/schemas/neonws/">
<operationresult>SUCCESS</operationresult>
<responsemessage>Membership created.</responsemessage>
<responsedatetime>2013-02-16T17:16:26.175-06:00</responsedatetime>
<membershipid>6576</membershipid>
<transaction>
<transactionid>55566</transactionid>
<transactionstatus>Succeed</transactionstatus>
<payments>
<payment>
<paymentid>44070</paymentid>
<amount>360.0</amount>
<paymentstatus>Succeed</paymentstatus>
<note>cash payment</note>
<tendertype>
<id>1</id>
<name>Cash</name>
</tendertype>
</payment>
</payments>
</transaction>
</ns2:addmembershiptoaccountresponse>
</soap:body>
</soap:envelope>
Request Parameters
Name | Required | Description |
---|---|---|
membership.accountId | Yes | The account to which this membership is being added. |
membership.membershipTerm.termInfo.id | Yes * | Membership Term ID. Possible values can be retrieved from List Membership Terms method. Required if termInfo.name is not provided. |
membership.membershipTerm.termInfo.name | Yes * | Membership Term Name. Possible values can be retrieved from List Membership Terms method. Required if termInfo.id is not provided. |
membership.autoRenewal | Should this membership term automatically renew? Possible values: true, false | |
membership.source.id | Possible values can be retrieved from List Sources method. | |
membership.source.name | Possible values can be retrieved from List Sources method. | |
membership.customFieldDataList.customFieldData.fieldId | Membership custom fields can be populated. Possible values can be retrieved from List Custom Fields method. This field can be repeated. | |
membership.customFieldDataList.customFieldData.fieldName | Membership custom fields can be populated. Possible values can be retrieved from List Custom Fields method. This field can be repeated. | |
membership.customFieldDataList.customFieldData.fieldOptionId | Membership custom fields can be populated. Possible values can be retrieved from List Custom Fields method. This field can be repeated. | |
sendAcknowledgeEmail | Determines whether this operation triggers the default system email. Value must be TRUE or FALSE. FALSE is the default value if the parameter is not provided. | |
Payments | ||
payment.amount | Yes | Payment amount |
payment.tenderType.id | Yes * | Possible values can be retrieved from List Tenders method. Required if tenderType.name is not provided. |
payment.tenderType.name | Yes * | Possible values can be retrieved from List Tenders method. Required if tenderType.id is not provided. |
payment.note | ||
Credit Card Online Payment | ||
The following fields are applicable if tenderType = 4 (credit card online). | ||
Payment.creditCardOnlinePayment.cardNumber | Yes * | Required for third-party gateways. See Payments for further documentation. |
Payment.creditCardOnlinePayment.token | Yes * | Required if using NeonPay or Neon Payment Processing. See Payments for further documentation. |
Payment.creditCardOnlinePayment.expirationMonth | Yes | |
Payment.creditCardOnlinePayment.expirationYear | Yes | |
Payment.creditCardOnlinePayment.cardType.id | Yes * | Possible values can be retrieved from List Credit Card Types method. Required when cardType.name is not provided. |
Payment.creditCardOnlinePayment.cardType.name | Yes * | Possible values can be retrieved from List Credit Card Types method. Required when cardType.id is not provided. |
Payment.creditCardOnlinePayment.CVV2 | Yes | |
Payment.creditCardOnlinePayment.cardHolder | Yes | Name of credit card holder, as shown on the card. |
Payment.creditCardOnlinePayment.cardHolderEmail | Yes * | Required if using Neon Payment Processing. |
Payment.creditCardOnlinePayment.billingAddressLine1 | ||
Payment.creditCardOnlinePayment.billingAddressLine2 | ||
Payment.creditCardOnlinePayment.city | ||
Payment.creditCardOnlinePayment.state.code | Possible values can be retrieved from the List States method. Required when state.name is not provided. | |
Payment.creditCardOnlinePayment.state.name | Possible values can be retrieved from the List States method. Required when state.code is not provided. | |
Payment.creditCardOnlinePayment.province | ||
Payment.creditCardOnlinePayment.country.id | Possible values can be retrieved from the List Countries method. Required when country.name is not provided. | |
Payment.creditCardOnlinePayment.country.name | Possible values can be retrieved from the List Countries method. Required when country.id is not provided. | |
Payment.creditCardOnlinePayment.zipCode | ||
Payment.creditCardOnlinePayment.zipCodeSuffix | ||
Credit Card Offline Payment | ||
The following fields are applicable if tenderType = 2 (credit card offline, on-site credit card machine) | ||
Payment.creditCardOfflinePayment.cardNumber | ||
Payment.creditCardOfflinePayment.expirationMonth | ||
Payment.creditCardOfflinePayment.expirationYear | ||
Payment.creditCardOfflinePayment.cardType.id | Possible values can be retrieved from List Credit Card Types method. Required when cardType.name is not provided. | |
Payment.creditCardOfflinePayment.cardType.name | Possible values can be retrieved from List Credit Card Types method. Required when cardType.id is not provided. | |
Payment.creditCardOfflinePayment.CVV2 | ||
Payment.creditCardOfflinePayment.cardHolder | ||
Payment.creditCardOfflinePayment.billingAddressLine1 | ||
Payment.creditCardOfflinePayment.billingAddressLine2 | ||
Payment.creditCardOfflinePayment.city | ||
Payment.creditCardOfflinePayment.state.code | Possible values can be retrieved from the List States method. Required when state.name is not provided. | |
Payment.creditCardOfflinePayment.state.name | Possible values can be retrieved from the List States method. Required when state.code is not provided. | |
Payment.creditCardOfflinePayment.province | ||
Payment.creditCardOfflinePayment.country.id | Possible values can be retrieved from the List Countries method. Required when country.name is not provided. | |
Payment.creditCardOfflinePayment.country.name | Possible values can be retrieved from the List Countries method. Required when country.id is not provided. | |
Payment.creditCardOfflinePayment.zipCode | ||
Payment.creditCardOfflinePayment.zipCodeSuffix | ||
eCheck / ACH Payment | ||
The following fields are applicable if tenderType = 12 (E-Check/ACH) | ||
Payment.echeckPayment.institution | ||
Payment.echeckPayment.routingNumber | Yes | |
Payment.echeckPayment.accountNumber | Yes | |
Payment.echeckPayment.accountOwner | ||
Payment.echeckPayment.CheckNumber | ||
Payment.echeckPayment.accountType | Possible values: Checking, Saving | |
Check Payment | ||
The following fields are applicable if tenderType = 3 (Check) | ||
Payment.checkPayment.institution | ||
Payment.checkPayment.routingNumber | ||
Payment.checkPayment.accountNumber | ||
Payment.checkPayment.accountOwner | ||
Payment.checkPayment.CheckNumber | ||
Payment.checkPayment.accountType | Possible values: Checking, Saving |
Response Parameters
Name | Required | Description |
---|---|---|
membershipId | Yes | The ID of the membership transaction (not the account). |
paymentId | Yes | Payment ID |
transaction.transactionId | Yes | Transaction ID |
transaction.transactionStatus | Yes | Possible values: Pending, Processing, Succeed, Declined, Error, Scheduled, Cancelled, Deferred |
payments.payment | Yes | Transaction details of the payment |
Error Codes
Code | Text | Description |
---|---|---|
50 | CustomField id is required. | |
51 | CustomField id is invalid. | |
52 | CustomField option value is required. | |
53 | CustomField option id is required. | |
54 | CustomField option id is invalid. | |
55 | CustomField option id is duplicated. | |
56 | CustomField id is duplicated. | |
101 | Payment amount is required. | |
102 | Tender type id or name is required. | |
103 | Tender type id or name is invalid. | |
104 | Echeck routing number is required. | |
105 | Echeck account number is required. | |
106 | Echeck account owner is required. | |
107 | Credit card number is required. | |
108 | Credit card expiration date is required. | |
109 | Credit card CVV2 is required. | |
110 | Credit card type is invalid. | |
111 | Billing Address state id or name is invalid. | |
112 | Billing Address country id or name is invalid. | |
150 | Unable to process payment. | |
151 | Payment id is invalid. | |
152 | Payment id is required. | |
153 | Succeed credit card online or e-check payment cannot be reprocessed. | |
10014 | Source id or name is invalid. | |
10131 | Account id is required. | |
10132 | Account id is invalid. | |
13000 | Membership term id or name is required. | |
13001 | Membership term id or name is invalid. | |
13003 | Payment amount must be the same as membership fee. | |
13020 | Child membership term is not allowed here. To purchase any child membership terms. please refer to addItemToShoppingCart under store api. |