Get Transaction History

GetTransactionHistory API Method

This operation is used to get transaction history of the card.

📘

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

Syntax

POST {baseUrl}/card/transaction-history

Example Request

Success Request

POST {baseUrl}/card/transaction-history
Authorization: bearer {token}
Content-Type: application/json
X-GD-RequestId: test101
{
    "metadata": {
        "merchantId": "fscc0342",
        "registerId": "01",
        "requestDateTime": "2023-10-31T08:07:36Z",
        "storeId": "CC970",
        "userId": "[email protected]"
    },
 "startDate": "2023-01-30",
  "endDate": "2023-10-31",
  "accountNumber": "",
  "accountIdentifier": "06e33e98-5c40-4c1a-967b-930f28f509a4"
}

Negative Request:

POST {baseUrl}/card/transaction-history
Authorization: bearer {token}
Content-Type: application/json
X-GD-RequestId: test101
{
    "metadata": {
        "merchantId": "fscc0342",
        "registerId": "01",
        "requestDateTime": "2023-10-31T08:10:23Z",
        "storeId": "CC970",
        "userId": "[email protected]"
    },
  "startDate": "2023-01-30T06:27:09Z",
  "endDate": "2023-10-31T06:27:09Z",
  "accountNumber": "",
  "accountIdentifier": "88e33e98-5c40-4c1a-967b-930f28f509a4"
}

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 the user generating the transaction.
If not supplied, InvalidParameter (Code:100) error will be return.

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

Unique merchant Id. It is defined by Green Dot – Merchant corresponding with Retailer.
If not supplied, InvalidParameter (Code:100) error will be return.

accountNumber

No

String

16 digits PAN

16 digits number.
For Insight partners, it can pass in registration id instead of PAN.
Either of AccountNumber / AccountIdentifier required.

startDate

Yes

Date

2023-01-01

The start UTC date of transaction history.

endDate

Yes

Date

2023-10-10

The end UTC date of transaction history.

accountIdentifier

No

String

e5843e05-d367-4bf1-a223-3af46ae18802

Newly created unique identifier for sale card, should be using for all subsequent API calls.

Either of AccountNumber / AccountIdentifier required

Example Response

Success Response

HTTP/1.1 200 OK
Content-Type: application/json
X-GD-RequestId: test101
X-GD-ResponseId: ca42d529-6459-440f-84a9-acb909af9dda
X-GD-ResponseCode: 0

{
    "beginningBalance": 0.0000,
    "endingBalance": 70.2500,
    "transactions": [
        {
            "transactionIdentifier": "99f21446-395a-99bd-4614-f2995a39bd99",
            "transactionType": "Swipe Reload",
            "transactionStatus": "completed",
            "authorizationDate": null,
            "authorizationAmount": 50.0000,
            "category": null,
            "merchantID": ”CC970”,
            "merchantName": ”ABC Financial”,
            "merchantCity": null,
            "merchantState": null,
            "merchantZipCode": null,
            "merchantCategory": null,
            "mCCCode": null,
            "runningBalance": 70.2500,
            "creditPosted": 50.0000,
            "debitPosted": 0.0,
            "transactionDescription": null,
            "transactionCode": "0548",
            "postedDate": "2023-09-28T16:24:22.279263+00:00",
            "declinedCode": null,
            "declinedCodeDescription": null,
            "declineReasonDescription": null
        },
        {
            "transactionIdentifier": "62af30f2-02a4-6714-f230-af62a4021467",
            "transactionType": "Swipe Reload",
            "transactionStatus": "completed",
            "authorizationDate": null,
            "authorizationAmount": 20.2500,
            "category": null,
            "merchantID": ”abctest001”,
            "merchantName": ”ABC Test Store 001”,
            "merchantCity": ”Woodward”,
            "merchantState": ”IA”,
            "merchantZipCode": null,
            "merchantCategory": null,
            "mCCCode": null,
            "runningBalance": 20.2500,
            "creditPosted": 20.2500,
            "debitPosted": 0.0,
            "transactionDescription": null,
            "transactionCode": "0548",
            "postedDate": "2023-09-26T07:50:28.536644+00:00",
            "declinedCode": null,
            "declinedCodeDescription": null,
            "declineReasonDescription": null
        }
    ],
    "metadata": {
        "requestId": "test101",
        "responseId": "ca42d529-6459-440f-84a9-acb909af9dda",
        "responseDateTime": "2023-10-31T08:07:38.9765093Z",
        "responseCode": 0,
        "responseDescription": "Success"
    }
}

Negative Response

HTTP/1.1 200 OK
Content-Type: application/json
X-GD-RequestId: test101
X-GD-ResponseId: 1f81b469-a49d-4c73-8534-e1fd254bbaf4
X-GD-ResponseCode: 600

{
    "beginningBalance": 0.0,
    "endingBalance": 0.0,
    "transactions": null,   
    "metadata": {
     "requestId": "test101",
     "responseId": "1f81b469-a49d-4c73-8534-e1fd254bbaf4",
     "responseDateTime": " 2023-10-31T08:10:25.0819427Z",
     "responseCode": 600,
     "responseDescription": "Account not found"
    }
}

Response Parameters

Parameter

Format/Data Type

Pattern

Description

requestId

String

MaxLength:50

The unique request ID generated from the request.

responseId

String

MaxLength:50

The unique Response Identifier (generated by GreenDot).

responseDateTime

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

Numeric

MaxLength:4

Indicates success and failure of the response codes. It is in the numeric format.

responseDescription

String

MaxLength:255

Describes the Response Code in more detail. It is in the String format.

beginningBalance

Decimal

100.86

Beginning balance of the card. Will be 0.0 if basic validation fails or no transaction found.

endingBalance

Decimal

968.77

Ending balance of the card. Will be 0.0 if it fails request validation or no transaction found.

transactions

Array

{ 1, … }

The collection of transactions. Will be null if there’s no data.

transactionIdentifier

String

f694f421-5028-41f2-81f9-22bf1dd93e4f

Newly created unique identifier for transaction.

transactionType

String

"Swipe Reload"

Transaction type.

transactionStatus

String

"completed"
"reversed"
"declined"
"pending"

Transaction Status (completed, reversed, declined or pending).

authorizationDate

DateTime

2023-10-31T07:15:25.0003+00:00

Authorization Date.

authorizationAmount

Decimal

11.0000

Authorization Amount.

category

String

"Financial institutions - automated cash disbursements"

Category.

merchantID

String

"123456789000000"

Merchant ID.

merchantName

String

"MSR MERCHANT"

Merchant Name.

merchantCity

String

"CHICAGO"

Merchant City.

merchantState

String

"IL"

Merchant State.

merchantZipCode

String

"60131"

Merchant ZipCode.

merchantCategory

String

"Miscellaneous Stores"

Merchant Category.

mCCCode

String

"5999"

MCC Code.

runningBalance

Decimal

0.0

Running Balance.

creditPosted

Decimal

0.0

Credit Posted.

debitPosted

Decimal

11.0000

Debit Posted.

transactionDescription

String

Transaction Description.

transactionCode

String

"2202"

Transaction Code.

postedDate

DateTime

"2023-10-31T07:15:25.0003+00:00"

Posted Date.

declinedCode

String

"2031"

Declined Code.

declinedCodeDescription

String

"NUMBER OF TIMES USED LIMIT EXCEEDED"

Declined Code Description.

declineReasonDescription

String

"NUMBER OF TIMES USED LIMIT EXCEEDED"

Decline Reason Description.

Response Cases

Code

CodeText

ResponseDescription

Description

0

Success

• Success
• No transactions found

Success.

100

InvalidParameter

• Invalid Date
• The EndDate field is required.
• The StartDate field is required.
• Either AccountNumber or AccountIdentifier is required
• RequestId is required
• StoreId is required
• MerchantId is required
• UserId is required
• RequestDateTime is required
• RequestId is too long
• UserId is too long
• StoreId is too long
• MerchantId is too long
• Invalid length of AccountNumber

Invalid parameter in the request. Examples: MerchantID is required, StoreID is required,
StartDate > EndDate.

130

InvalidMerchant

InvalidMerchant

MerchantId in request has not been found/enabled in the system.

800

InvalidStore

Store was not found

Store is not found; store is not for the partner.

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.

110

InvalidAccountNumber

This account is closed

Invalid accountNumber provided. If account is closed, customer can not trieve account history.

600

UnableToProcessRequest

• Start date or End date not formatted correctly
• Account not found

Error when retrieving records in downstream.

1000

GeneralFailure

GeneralFailure

Service failure.