Create customer account request

Purpose
To allow a Glassboxx vendor website to pass customer details to Glassboxx.
Multiple customers can be passed to Glassboxx in a single call to createAccount.
As the Vendor website has handled the purchase transaction with the end customer, (if required) the Vendor website should send an account creation email to the end customer. Glassboxx does not send an account creation email for accounts received via the createAccount endpoint.
Pre-requisites
Token generated from token authentication request with token value included as Bearer in request header.
Request
| base URL + endpoint | glassboxxorder/createAccount |
| Method | POST |
Parameters
An JSON array consisting of the following elements:-
| Name | Type | Mandatory | Description |
| string | TRUE | The customer’s email address | |
| first_name | string | TRUE | The customer’s first name |
| last_name | string | TRUE | The customer’s last name |
| vendor_id | string | TRUE | The vendor id of the Glassboxx account (from the INTEGRATIONS / Vendor page in the Glassboxx Vendor Portal)./td> |
Responses
If the request has been successfully processed by Glassboxx, a response will be sent back with a Status parameter having the value ‘SUCCESS’.
401 (Unauthorized)You did not sign in correctly or your account is temporarily disabledAuthentication token not supplied or not valid
| Responses | Status/Message | Purpose/Reason/Resolution |
| 200 (OK) | Status SUCCESS Message [blank] |
Indicates the customer(s) was successfully created |
| 200 (OK) | Status ERROR</br/> Message “vendor_id is a required field” | Indicates the customer(s) was not successfully created, and giving the reason |
| 200 (OK) | Error creating customer: xxx , where xxx corresponds to:- “Error creating customer: \”Email\” is not a valid email address.””Error creating customer: \”First Name\” is a required value.” |
Indicates the customer was not created successfully. Please review and correct the input sent to the endpoint. |
| 400 (Bad request) | Message: “%fieldName is a required field.”,parameters: {fieldName: “customer” | The array has not been passed correctly to the endpoint |
| 400 (Bad request) | Message ‘Specified request cannot be processed.’ | Please check the layout of the full request being passed. |
| 503 (Service Unavailable) | Glassboxx Server not available due to maintenance. Please try later. |
Examples
1. Example request
https://server.glassboxx.co.uk/rest/V1/glassboxxorder/createAccount
with JSON body parameters:-
{"customer":
{
"email":"postmantest5@mailinator.com",
"first_name":"pm5",
"last_name":"pm5",
"vendor_id":20
}
}
2. Example success response
{
"status": "SUCCESS",
"message": ""
}
3. Example error response
{
"status": "ERROR",
"message": "vendor_id is a required field"
}