Welcome‎ > ‎Version 3‎ > ‎Publisher Api‎ > ‎Methods‎ > ‎2 - Consumer Related‎ > ‎

Create Consumer

Creates a consumer in the Group Commerce system.  Consumers are uniquely identified by the userKey field.

Method: POST /api/v3/publisher/consumer/{userKey}

Authentication: oauth

URL Parameters
  userKey - the consumer's userKey (a unique identifier).

Post
Required Form Name Data Type Explanation
No
ConsumerType string The type of consumer record.  One of { Unknown, Visitor, Account }.
Yes*
Email
string The consumer's email that will be the target for transactional emails.  *If NoEmail is true (if the consumer does not have an email), this field is not required.
Yes FirstName string The consumer's first name.
Yes LastName string The consumer's last name.
No NoEmail bool Whether or not this consumer has an associated email address.
No PreferredIsoCurrencyCode string The preferred ISO currency code (3 characters) for the consumer (e.g. USD, CAD).
No ReferredByUserKey string The userKey of the consumer who referred the newly created consumer to the website.
No SendEmail bool Whether or not to send a welcome email to the newly created consumer.

Returns
success - Whether or not the consumer was successfully created in the system.


Sample Request:

POST http://api.groupcommerce.com/api/v3/consumer/testuserkey

Form: ConsumerType=Account&Email=testing123%40groupcommerce.com&FirstName=Ray&LastName=Lewis&NoEmail=False&PreferredIsoCurrencyCode=USD&ReferredByUserKey=gsadowski%40groupcommerce.com&SendEmail=True

OAuth oauth_signature="gcPIGjCQgG4z9D1jnKXuoNDGg9o%3D", oauth_nonce="3483438", oauth_timestamp="1359502839", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"


Sample JSON Response:

{
    "errors":[],
    "lastPublished":"/Date(1359502839458)/",
    "success":true,
    "version":"3"
}


Sample XML Response:

<createConsumerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <errors/>
    <lastPublished>2013-01-29T23:53:25.7986597Z</lastPublished>
    <success>true</success>
    <version>3</version>
</createConsumerResponse>
Comments