Account Create

Description

This call allows you to create a new account for a user in the OGF system.

As with all OGF REST calls, you need to pass the session Id on the query string. You must then POST your request XML and then you will get the response XML.

Version

2011-02-02

URI

REST URI [POST]:
/v11.02/Account.svc/Create?SessionId={SessionId}

Content-Type: Application/xml

Example

Request POST
http://wsdev.onegreatfamily.com/v11.02/Account.svc/Create?SessionId=gl4q23cwofpshi55sg1dvc3o
Request Headers
Content-Type: Application/xml
Request Payload
<Account xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<AccountId>0</AccountId>
	<Address>
		<Address1>1492 columbus road</Address1>
		<Address2></Address2>
		<City>Provo</City>
		<Country>United States</Country>
		<PostalCode>84606</PostalCode>
		<StateProvince>Utah</StateProvince>
	</Address>
	<CreditCard>
		<BillingAddress>
			<Address1>1492 columbus road</Address1>
			<Address2></Address2>
			<City>Provo</City>
			<Country>United States</Country>
			<PostalCode>84606</PostalCode>
			<StateProvince>Utah</StateProvince>
		</BillingAddress>
		<CVV2>123</CVV2>
		<CardExpiration>201301</CardExpiration>
		<CardNumber>4111111111111111</CardNumber>
		<NameOnCard>Joe Cardmember</NameOnCard>
	</CreditCard>
	<EmailAddress>joe@myemail.com</EmailAddress>
	<FirstName>FirstName</FirstName>
	<LastName>LastName</LastName>
	<Password>Password</Password>
	<PhoneNumber>123-456-7890</PhoneNumber>
	<ProductId>OGF_YEARLY_SUBSCRIBER_7495</ProductId>
	<UserName>username</UserName>
</Account>
Success Response Payload
<CreateAccountResult xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<AccountId>1234567</AccountId> 
	<ErrorCode>0</ErrorCode>
	<Message>Success</Message>
	<Status>SUCCESS</Status>
</CreateAccountResult>
Failed Response Payload
<CreateAccountResult xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<AccountId>0</AccountId> 
	<ErrorCode>19406</ErrorCode>
	<Message>An account already exists for the provided email address</Message>
	<Status>CURRENT_PAID_ACCOUNT_ALREADY_EXISTS</Status>
</CreateAccountResult>
Fault Response Payload
<RestFault xmlns="http://schemas.datacontract.org/2004/07/OGF.WS.Data">
	<ErrorCode>551</ErrorCode>
	<FaultMessage>An unhandled exception has occurred</FaultMessage>
</RestFault>

Query String Parameters

Name Description Required

SessionId

The current session Id

Type: string

Default: None

Yes

POST Payload

Name Description Required

Account

The account aggregate to create

Type: Account

Default: None

Constraints: Must be a valid account aggregate.

Yes

Response Elements

Name Description

CreateAccountResult

This operation returns a CreateAccountResult aggregate upon success. Otherwise an error is returned.

Type: CreateAccountResult

HTTP Status Code

The Web Server returns a status code which indicates if the operation was successful. Anything other than 200 should be regarded as a failure.

HTTP Status Code of 417

The Web Server threw an exception and contains a RestFault aggregate. Retrieve the RestFault from the Webexception response property.