Agent Object Error Codes
This document provides a comprehensive reference for validation errors related to the agent object in the Convenient Checkout API. These errors help identify issues with agent data in API requests and guide you in resolving them.
- For Customer object validation errors, see the Customer Object Error Codes
- For Payment object validation errors, see the Payment Object Error Codes
- For Session-level errors, see the Sessions API Error Codes
Error Codes Summary
Error Code Summary
| Error Title Reference | Error Title | HTTP Status | Detail Message | Scenario | Resolution |
|---|---|---|---|---|---|
| First Name Validation | INVALID_REQUEST | 400 BAD REQUEST | agent.firstName cannot be more than 50 characters | When first name exceeds 50 characters | Ensure the agent's first name is 50 characters or less |
| INVALID_REQUEST | 400 BAD REQUEST | agent.firstName is required | When first name is empty or null (in APIs where it's required) | Provide a non-empty value for the agent's first name | |
| Last Name Validation | INVALID_REQUEST | 400 BAD REQUEST | agent.lastName cannot be more than 50 characters | When last name exceeds 50 characters | Ensure the agent's last name is 50 characters or less |
| INVALID_REQUEST | 400 BAD REQUEST | agent.lastName is required | When last name is empty or null (in APIs where it's required) | Provide a non-empty value for the agent's last name | |
| User ID Validation | INVALID_REQUEST | 400 BAD REQUEST | agent.userId is required | When agent user ID is missing, null or empty | Include a valid agent.userId in the request |
Error Codes Details
First Name Validation
Character Limit Exceeded
Scenario: The agent's first name cannot exceed 50 characters.
Sample Request:
{
"agent": {
"firstName": "ThisFirstNameExceedsFiftyCharactersAndWillTriggerAnError",
"lastName": "Smith",
"userId": "msid123"
}
}
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "agent.firstName cannot be more than 50 characters"
}
First Name Required
Scenario: The first name is optional for most APIs, but if the agent object is included for Sessions APIs, it cannot be empty or null.
Sample Request (empty):
{
"agent": {
"firstName": "",
"lastName": "Smith",
"userId": "msid123"
}
}
Sample Request (null):
{
"agent": {
"firstName": null,
"lastName": "Smith",
"userId": "msid123"
}
}
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "agent.firstName is required"
}
Last Name Validation
Character Limit Exceeded
Scenario: The agent's last name cannot exceed 50 characters.
Sample Request:
{
"agent": {
"firstName": "John",
"lastName": "ThisLastNameExceedsFiftyCharactersAndWillTriggerAnError",
"userId": "msid123"
}
}
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "agent.lastName cannot be more than 50 characters"
}
Last Name Required
Scenario: The last name is optional for most APIs, but if the agent object is included for Sessions API, it cannot be empty or null.
Sample Request (empty):
{
"agent": {
"firstName": "John",
"lastName": "",
"userId": "msid123"
}
}
Sample Request (null):
{
"agent": {
"firstName": "John",
"lastName": null,
"userId": "msid123"
}
}
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "agent.lastName is required"
}
User ID Validation
User ID Required
Scenario: The agent's user ID is required if the agent object is included in any API request.
Sample Request:
{
"agent": {
"firstName": "John",
"lastName": "Smith"
// userId is missing
}
}
Sample Error Response:
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "agent.userId is required"
}
Additional Notes
- The agent object is optional for most APIs, but if included, all required fields must be valid.
- Refer to the specific API reference documentation for details on when the agent object is required.