Set Activation Codes

Introduction

This API allows you to set the activation code for one or more cards.

Method

Service

API Name

API Type

POST

cards

set-activation-codes

Synchronous

URI: {baseUrl}/cards/v1/set-activation-codes

Header Elements

The header must contain the elements needed to authenticate the request.

Parameter

Description

Type

Required

Authorization

This is where you will send your encoded JWT auth token you obtained from Get Auth Token.

Must be in the form: Authorization: Bearer {auth-token-string}

String

Yes

Request Elements

The request must be sent as an array of JSON objects containing the following attributes.

Name

Description

Type

Required

quoteNumber

The client program number the card you are setting an activation code for is part of.

Number

Yes

proxyNumber

The proxy number for the card you are setting the activation code for.

Number

Yes

activationCode

The activation code to be set for the card.

Validation Requirements

  • Length: 4 - 16 characters
  • Alpha numeric only
  • No special characters

Regex: [A-Za-z0-9]{4,16}

String

Yes

🚧

Activation codes are case sensitive and will need to be entered by the cardholder in the same case as set in this API call.

Sample Request

[
    {
        "quoteNumber":"95000000",
        "proxyNumber":"6039530407033839166",
        "activationCode":"123456"
    }, 
    {
        "quoteNumber":"95000000",
        "proxyNumber":"6039530407041188598",
        "activationCode":"654321"
    } 
]

🚧

We recommend a maximum of 1,000 codes in a single request. If you need to set more than 1,000 codes send multiple requests.

Response

Upon success the service will respond with an HTTP status code 200 and provide a JSON payload containing the following attributes.

Name

Description

Type

status

Status of the response. This will match the HTTP Status Code in the header of the response.

Example: 200

String

success

Boolean indicator for success.

Possible values:

  • true
  • false

Boolean String

message

Detailed message for the result of the operation. If there was an error this will describe the error in detail.

String

❗️

WARNING: No Partial Processing

This service does not support partial processing. If validation errors are found in any records, or in the payload format, the entire request will be rejected and no records will be processed.

Sample Response

Sample response payloads for success, validation errors and an internal server error are shown below. All response will return with the appropriate HTTP status code in the header (as indicated in the tab name and status attribute).

{
   "status": 200,
   "success": true,
   "message": "All records have been saved successfully"
}
{
    "status": 400,
    "error": "Bad Request",
    "message": "JSON parse error: Unexpected character ('{' (code 123)): was expecting comma to separate Array entries; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('{' (code 123)): was expecting comma to separate Array entries\n at [Source: (PushbackInputStream); line: 3, column: 2]",
    "path": "/cards/v1/submitActivationCodes"
}
{
    "status": 400,
    "success": false,
    "message": "Invalid Input - Proxy Number is missing in one of the record with Quote Number 1234"
}
{
    "status": 400,
    "success": false,
    "message": "Invalid Input - Quote Number is missing in one of the record with Proxy Number 454577"
}
{
    "status": 400,
    "success": false,
    "message": "Invalid Input - Activation Code is missing in one of the record with Quote Number 5689"
}
{
    "status": 400,
    "success": false,
    "message": "Invalid Input - Activation code 123 is not a valid value. Minimum 4 and maximum 16 digits only"
}
{
    "status": 500,
    "success": false,
    "message": "Generic error while creating activation codes, please try again"
}

Did this page help you?