Replace Card

ReplaceCard API Method

This operation is used to replace the card for different reasons and replace it immediately with a temp/perso card in store.

📘

Every request triggered should have a unique X-GD-RequestId value in the header.

Syntax

POST {baseUrl}/card/replace

Example Request

Success Request

POST {baseUrl}/card/replace
Authorization: bearer {token}
Content-Type: application/json
X-GD-RequestId: test101
{
    "metadata": {
        "merchantId": "fscc0342",
        "registerId": "01",
        "requestDateTime": "2023-10-11T07:53:32Z",
        "storeId": "CC970",
        "userId": "[email protected]"
    },
  "replacementRequestType": "Lost",
  "externId": "",
  "deliveryType": "InstantIssue",
  "productMaterialType": "02",
  "accountNumber": "",
  "accountIdentifier": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 
}

Negative Request

POST {baseUrl}/card/replace
Authorization: bearer {token}
Content-Type: application/json
X-GD-RequestId: test101
{
    "metadata": {
        "merchantId": "fscc0342",
        "registerId": "01",
        "requestDateTime": "2023-11-10T10:22:22Z",
        "storeId": "CC970",
        "userId": "[email protected]"
    },
  "replacementRequestType": "Lost",
  "externId": "",
  "deliveryType": "InstantIssue",
  "productMaterialType": "08",
  "accountNumber": "",
  "accountIdentifier": "3fa85f64-5717-4562-b3fc-2c963f66afa6" 
}

Request Parameters

ParameterRequired (Y/N)Format/ Data TypePatternDescription
X-GD-RequestIdYesStringMaxLength:50It is a unique transaction identifier that is generated by the retailer.
requestDateTimeYesDateTime2023-08-08T12:34:56ZTime stamp at which transaction occurred.
The time stamp has to be in UTC time zone and follow the following date and time formats:
• YYYY-MM-DDTHh:mm:ssZ
registerIDNoStringMaxLength: 20Register where the transaction occurred.
userIDYesStringMaxLength:50The unique ID of the user generating the transaction.
If not supplied, InvalidParameter (Code:100) error will be return.
storeIDYesStringMaxLength: 20The store number associated with the retailer that sold the package.
If not supplied, InvalidParameter (Code:100) error will be return.
merchantIDYesStringMaxLength: 20Unique merchant Id. It is defined by Green Dot – Merchant corresponding with Retailer.
If not supplied, InvalidParameter (Code:100) error will be return.
accountNumberNoString16 digits PAN16 digits number of Card.
Either of AccountNumber / AccountIdentifier required.
replacementRequestTypeYesEnum• Lost
• Stolen
• Damaged
• NeverReceived
Replacement Request Type
externIdNoString001234567810 digit Green Dot internal reference number that is associated with the package. This is required when the card is being replaced with a replacement card in store. It is optional for instant issue cards.
deliveryTypeNoEnumInstantIssueDelivery Type of Perso Card.
accountIdentifierNoStringe5843e05-d367-4bf1-a223-3af46ae18802Newly created unique identifier for sale card, should be using for all subsequent API calls.
Either of AccountNumber / AccountIdentifier required.
ProductMaterialTypeNoString03Blank for original design, value for new design.
Please refer to Appendix B for detail.

Example Response

Success Response

HTTP/1.1 200 OK
Content-Type: application/json
X-GD-RequestId: test101
X-GD-ResponseId: c07cdd09-85a8-438b-97bc-9c50745d3631
X-GD-ResponseCode: 0

{
    "accountReferenceNumber ": "XXX123455",    
    "metadata": {
        "requestId": "test101",
        "responseId": "c07cdd09-85a8-438b-97bc-9c50745d3631",
        "responseDateTime": "2023-10-11T07:53:36.1198386Z",
        "responseCode": 0,
        "responseDescription": "Success"
    }
}

Negative Response

HTTP/1.1 200 OK
Content-Type: application/json
X-GD-RequestId: test101
X-GD-ResponseId: 5225d51b-12e6-4683-b6ae-23b5fecc92e9
X-GD-ResponseCode: 600

{
    "accountReferenceNumber": null,    
    "metadata": {
     "requestId": "test101",
     "responseId": "5225d51b-12e6-4683-b6ae-23b5fecc92e9",
     "responseDateTime": "2023-11-10T10:22:30.171817Z",
     "responseCode": 600,
     "responseDescription": "Invalid Product Material type"
    }
}

Response Parameters

ParameterFormat/Data TypePatternDescription
requestIdStringMaxLength:50The unique request ID generated from the request.
responseIdStringMaxLength:50The unique Response Identifier (generated by GreenDot).
responseDateTimeDateTime2023-09-07T16:12:23.4541445+08:00Time stamp at which transaction occurred.
The time stamp is in UTC time zone and follow the following date and time formats:
• YYYY-MM-DDTHH:mm:ssfffffffK
responseCodeNumericMaxLength:4Indicates success and failure of the response codes. It is in the numeric format.
responseDescriptionStringMaxLength:255Describes the Response Code in more detail. It is in the String format.
accountReferenceNumberStringABXX8768420This should be used to pass to Entrust for card data lookup – for in store replacement. Only success response contains accountReferenceNumber value.

Response Cases:

CodeCodeTextresponseDescriptionDescription
0SuccessSuccessSuccess.
100InvalidParameter• Either AccountNumber or AccountIdentifier is required
• Invalid length of AccountNumber
• ExternalId already used.
• ExternalId expired.
• RequestId is required
• UserId is required
• RequestDateTime is required
• StoreId is required
• MerchantId is required
• RequestId is too long
• UserId is too long
• StoreId is too long
• MerchantId is too long
Invalid parameter in the request. Examples: MerchantID not supplied, StoreID not supplied.
130InvalidMerchantInvalidMerchantMerchantId in request has not been found/enabled in the system.
800InvalidStore• Store was not found
• The replace feature is not enabled for this store
Store is not found; store is not for the partner or store does not support this operation.
861RetailChainUserNotFoundUser is not found.UserID in request is not found in system.
862RetailChainUserNotActiveUser is not active.UserId in request is not active.
110InvalidAccountNumber• Account Status is Closed
• Account Status is Locked
• Account Status is Restricted
• Account Status is Pending
• InvalidAccountNumber
• Account Not Found
Account is not found; account status is not valid.
600UnableToProcessRequest• The initial card is not activated
• Payment Instrument cannot be generated due to incorrect mailing address.
• Not received was made against a PAN/Instrument which is already activated.
• Invalid ProductMaterialType
• Package Id not found
• Fail
Error when process replace card in download stream services.
1000GeneralFailureGeneralFailureService failure.