Package Sale
Package Sale API Method
This method is used to sell a card or MoneyPak to a customer.
Every request triggered should have a unique X-GD-RequestId value in the header
Syntax
POST {baseUrl}/package/sale
Example Request
Success Request
POST {baseUrl}/package/sale
Authorization: bearer {token}
Content-Type: application/json
X-GD-RequestId: 123456789
{
"metadata": {
"merchantId": "15|118",
"registerId": "01001",
"storeId": "CC970",
"userId": "[email protected]",
"requestDateTime": "2013-09-18T10:53:07Z"
},
"externId": "3085033189"
"transactionAmount": 20.00,
"paymentProgramType": "Regular"
}
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. |
merchantId | Yes | String | MaxLength: 20 | The unique merchant Id. Defined by Green Dot – Merchant corresponding with Retailer. |
storeId | Yes | String | MaxLength: 20 | The store number associated with the retailer that sold the package. |
registerId | No | String | MaxLength: 20 | Register where the transaction occurred. |
userId | No | String | MaxLength:50 | The unique ID of the user generating the transaction. |
externId | Yes | string | Max:19 | The externId is the last 19 digits of the barcode on the package. |
transactionAmount | Yes | decimal | 500.00 | Amount of money to be loaded. |
paymentProgramType | Yes | Enum | Regular, | Type of payment option that customer selects. |
Example Response
Success Response
HTTP/1.1 200 OK
Content-Type: application/json
X-GD-RequestId: 201309181254
X-GD-ResponseId: 127d59fa-8851-444a-a639-716e81b2cecd
X-GD-ResponseCode: 0
{
"metadata": {
"requestId": "201309181254",
"responseCode": 0,
"responseDescription": "Success",
"responseDateTime": "2013-09-18T17:53:07.1411753Z",
"responseId": "127d59fa-8851-444a-a639-716e81b2cecd"
},
"receiptText":"Please wait 10 minutes to register your card at www.mygreendot.com or 1 (866) 785-6963. You need the temporary card number found on the card in your package. ... Keep this receipt for your records.",
“fundingDelaySeconds”: “60”
}
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. |
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. |
fundingDelaySeconds | Yes | String | “60” | The length of the funding delay in seconds. The transaction may be voided immediately after it had succeeded and up to FundingDelaySeconds. Please note that the actual delay the funds will be usable may be up to 2 minutes longer that this value due to some asynchronous processing in the backend system. Only successful reload will have fundingDelaySeconds value. |
receiptText | No | String | Max 1000 | Describes the receipt text. |
Response Codes
Code | Code Text | Response Description | Explanation of the Response Code |
---|---|---|---|
0 | Success | Success | Card is enrolled successfully. |
100 | InvalidParameter | • StoreId is required | Invalid parameter when validating the request value. Examples: MerchantID not supplied, StoreID not supplied. |
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 or store does not support this operation. |
861 | RetailChainUserNotFound | User is not found. | UserID in the request is not found in system. |
862 | RetailChainUserNotActive | User is not active. | UserId in request is not active. |
600 | UnableToProcessRequest | Package Id not found | Extern ID on the package was not found. |
1000 | GeneralFailure | GeneralFailure | Service failure. |
Updated about 24 hours ago