Get Card Info
GetCardInfo API Method
The GetCardInfo method is used to get the balance of the card. This information would be useful for Reload, customer balance inquiry.
Every request triggered should have a unique X-GD-RequestId value in the header.
Syntax
POST {baseUrl}/card/details
Example Request
Success Request
POST {baseUrl}/card/details
Authorization: bearer {token}
Content-Type: application/json
X-GD-RequestId: test101
{
"accountIdentifier": "",
"accountNumber": "5344560000816246",
"paymentProgramType": "Regular",
"transactionAmount": 20.00,
"metadata": {
"storeId": "CC970",
"merchantId": "FSCC0342",
"userId": "[email protected]",
"requestDateTime": "2023-09-28T00:56:25Z",
"registerId": "01"
}
}
Negative Request
POST {baseUrl}/card/details
Authorization: bearer {token}
Content-Type: application/json
X-GD-RequestId: test101
{
"accountNumber": "",
"accountIdentifier": "6287287e-b79f-4458-8830-cc5edd9d7378",
"paymentProgramType": "Regular",
"transactionAmount": 20.00,
"metadata": {
"storeId": "CC970",
"merchantId": "FSCC0342",
"userId": "[email protected]",
"requestDateTime": "2023-09-28T00:56:25Z",
"registerId": "01"
}
}
Request Parameters
Parameter | Required(Y/N) | Format/Data Type | Pattern | Description |
---|---|---|---|---|
X-GD-RequestId | Yes | String | MaxLength:50 | It is a unique transaction identifier that is generated by the retailer. |
requestDateTime | Yes | DateTime | 2023-08-08T12:34:56Z | Time 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 |
registerId | No | String | MaxLength: 20 | Register where the transaction occurred |
userId | Yes | String | MaxLength:50 | The unique ID of user generating the transaction. |
storeId | Yes | String | MaxLength: 20 | The store number associated with the retailer that sold the package. If not supplied, InvalidParameter (Code:100) error will be return. |
merchantId | Yes | String | MaxLength: 20 | The unique merchant Id. Defined by Green Dot – Merchant corresponding with Retailer. |
accountNumber | No | String | 16 digits PAN | Account Number (PAN) of the card. Note: Either AccountNumber or AccountIdentifier is required. |
accountIdentifier | No | GUID | e5843e05-d367-4bf1-a223-3af46ae18802 | Newly created unique identifier for sale card, should be using for all subsequent API calls Note: Either AccountNumber or AccountIdentifier is required |
transactionAmount | Yes | Decimal | 500.00 | Amount of money to be reloaded. Must be greater than zero. For example: Five Hundred Dollars is entered as 500.00. Twenty Dollars is entered as 20.00. |
paymentProgramType | Yes | Enum | Regular, CheckCashing | Type of payment option that customer selects. For example: The customer is paying with a check, then it will be “CheckCashing”. If they are paying by cash, or a combination of check and cash, PaymentProgramType will be “Regular”. |
Example Response
Success Response
HTTP/1.1 200 OK
Content-Type: application/json
X-GD-RequestId: test101
X-GD-ResponseId: a7ef836d-0ab3-49d1-8a03-f5788ba1a97f
X-GD-ResponseCode: 0
{
"availableBalance": "20.25",
"reloadFee": "0.00",
"maxAllowedAmount": null,
"metadata": {
"requestId": "test101",
"responseId": "a7ef836d-0ab3-49d1-8a03-f5788ba1a97f",
"responseDateTime": "2023-09-28T08:57:16.9632687Z",
"responseCode": 0,
"responseDescription": "Success"
}
}
Negative Response
HTTP/1.1 200 OK
Content-Type: application/json
X-GD-RequestId: test101
X-GD-ResponseId: c297f15c-def6-43ee-9189-b7bf411ba349
X-GD-ResponseCode: 110
{
"availableBalance": null,
"reloadFee": null,
"maxAllowedAmount": null,
"metadata": {
"requestId": "test101",
"responseId": "c297f15c-def6-43ee-9189-b7bf411ba349",
"responseDateTime": "2023-09-28T08:58:41.8784305Z",
"responseCode": 110,
"responseDescription": "Account Not Found."
}
}
Response Parameters
Parameter | Required(Y/N) | Format/Data Type | Pattern | Description |
---|---|---|---|---|
requestId | Yes | String | MaxLength:50 | The unique request ID from request. |
responseId | Yes | String | MaxLength:50 | The unique Response Identifier (generated by GreenDot). |
responseDateTime | Yes | DateTime | 2023-09-07T16:12:23.4541445+08:00 | Time 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 |
responseCode | Yes | Numeric | MaxLength:4 | Indicates success and failure of the response codes. It is in the numeric format. |
responseDescription | Yes | String | MaxLength:255 | Describes the Response Code in more detail. It is in the String format. |
availableBalance | Yes | String | 50.00 | Available balance on main account purse. If it doesn’t pass basic validation like metadata.userid validation, this field will be null. |
reloadFee | Yes | String | 3.95 | Reload fee for the card. If there’s no fee config in Greendot, the value will be null. |
maxAllowedAmount | Yes | String | “9500.00” | The max amount allowed to perform the reload based on load limit check. It has value only when the request fails the load limit validation. |
Response Cases
Code | CodeText | ResponseDescription | Description |
---|---|---|---|
0 | Success | Success | Success. |
100 | InvalidParameter | • RequestId is too long • The field RegisterId must be a string or array type with a maximum length of '20'. • UserId is too long • StoreId is too long • MerchantId is too long • RequestId is required • RequestDateTime is required • Either AccountNumber or AccountIdentifier is required • UserId is required • StoreId is required • MerchantId is required • TransactionAmount should be greater than zero • Invalid length of AccountNumber | Invalid parameter in the request. Examples: MerchantID not supplied, StoreID not supplied. |
110 | InvalidAccountNumber | • AccountStatus is Closed. • AccountStatus is Pending. • AccountStatus is Locked. • Account Status is Restricted • Account Not Found. • AccountNotFound • This account is in a restricted state that does not allow inbound or internal transfers. | Account is not found, account status is not valid or account is not reloadable for current partner |
130 | InvalidMerchant | InvalidMerchant | MerchantId in request has not been found/enabled in the system. |
600 | UnableToProcessRequest | N/A | Unable to process request due to fee split not set and downstream error. |
700 | LoadLimitValidationFailed | Exceeds account daily load limit | The transaction amount does not pass load limit verification. |
800 | InvalidStore | Store was not found | Store is not found; store is not for the partner or store does not support this operation. |
801 | StoreBlocked | The store is blocked | Store is blocked by GD store blocker rules. |
861 | RetailChainUserNotFound | User is not found. | UserID in request is not found in system. |
862 | RetailChainUserNotActive | User is not active. | UserId in request is not active. |
1000 | GeneralFailure | N/A | Service failure. |
Updated 7 months ago