Non-Authenticated

REGISTRATION

Add Member

Mobile API Path: /add
Web API Path: /member/add

JSON body


“phone”: <string>,

“sms_opt_in”: <boolean>,
“password”: <string> ,
“email”: <string>,

“email_opt_in”: <boolean>,
“first_name”:<string> (optional),
“last_name”:<string> (optional),
“dob”: <date string> (YYYY-MM-DD format optional),
“gender”: <string> (optional - “M” | “F”),
“marital_status”: <string> (optional - “Single” | “Married” |  “Divorced” | “Domestic Partner”),

“street”: <string> (optional),
“city”: <string> (optional),
“state”: <string> (optional),
“zip”: <string> (optional),
“favorite_store_id”: <number>,
“addtl_info: [{     (optional)

“name”: <string>,
“value”: <string>

}, {
..
}],

“send_welcome_email”: <boolean> (optional) - default is false,
“email_validated”: <boolean> - default is false
}

If the user’s email is not validated, will return status 202 and the user sent an email to validate. Once email is validated by user, the member is added.

If email is validated already, and user added returns a HTTP status code of 200 with

Response JSON body

{
“spendgo_id”: <string>,
“username”: <string>
}

Returns HTTP status code 409 if the member already exists.

 

Look-Up Member

Mobile API Path: /lookup
Web API Path: /lookup

REQUEST JSON body

For lookup based on email address entry

{
"email":"<string>" (Email Address),
"check_email_validated_status":<boolean> (optional)
}

For lookup based on phone number entry

{
"phone":"<string>" (Phone Number),
"check_email_validated_status":<boolean> (optional) [NOTE: Currently we do not support lookup of users in “Waiting for Email Validation” status by phone number. Use email address to lookup such users.]
}

 

RESPONSE JSON body

{
"status":"<string>"
}

 

Valid Status Responses

{"status":"Activated"}

{"status":"NotFound"}

{"status":"InvalidEmail"}

{"status":"StarterAccount"}

{"status":"WatingForEmailValidation"} NOTE: This status will only be returned if “check_email_validated_status” flag is set to true. This is supported only when searching users with email address.

 

Example

Email Request:

{
email":"user10@spendgo.com"
}

Phone Request:

{
"phone":"5555550010"
}

 

 

Forgot Password

Allows for a forgot password link to send an email with a link to reset user’s password. The resetpassword_link with arguments - token is used in the email sent to user. For example if the link is “https://www.test.com/forgotpassword” then a HTTP get method with

“https://www.test.com/forgotpassword?token=xxxx” will be used in the email. The token argument passed can be used to call the resetpassword REST call.

 

Mobile API Path: /forgotPassword
Web API Path: /forgotPassword

JSON body

{
“email”: <string>,
“program_name”: <string>,  (optional) // Name of the loyalty program. Used in the email text “resetpassword_link”:<String>  (optional) // Url of the branded reset password url.
}

On success returns a HTTP status code of 200.

If email is invalid/does not exist within spendgo - 400 bad request is returned.

 

Reset Password

Reset user’s password to the given password. A token argument passed in the previous call - forgotPassword is needed to reset password. The token is valid for 3 hours.

Mobile API Path: This is not applicable / not available via Mobile.
Web API Path: /member/resetPassword

JSON body

{
“token”: <string>,
“password”: <string>
}

On success returns a HTTP status code of 200 and JSON body contains:

{
“username”: <string>   // phone number of the user whose password was reset
}

If the token is invalid, a status code of 400 is returned.

If the token is expired, a status code of 408 is returned.


 

Verify Reset Password Token

Function to verify if the reset password token is valid.

Mobile API Path: This is not applicable / not available via Mobile.
Web API Path: /member/verifyResetToken

JSON body

{
“token”: <string>
}

On success returns a HTTP status code of 200.

If the token is invalid, a status code of 400 is returned.

If the token is expired, a status code of 408 is returned.


MERCHANT RELATED

Get nearest Stores

Mobile API Path: /nearestStores
Web API Path: /nearestStores

JSON body

{
“zip”: <string>,
“distance”: <Double>   // Distance from zip in miles
}

On success returns a HTTP status code of 200 with

JSON body [{

“id”: <Integer>,   // Store id
“name”: <string>, // Store name
"code": <string>,  // Store Code
“street”: <string>,
“city”: <string>,
“state”: <string>,
“zip”: <string>,
"phone":  <string>,
"hours":  <string>,
"latitude":<number>,
"longitude": <number>

}, {
..
}]


 

Member Completed Survey

Function to indicate that a member completed a survey

Mobile API Path: This is not applicable / not available via Mobile.
Web API Path: /member/surveycompleted

JSON body

{
“phone”: <string>
}