Real-time Virtual Prepaid Orders
Introduction
Real-time ordering allows you to place single orders for virtual prepaid accounts quickly. You are limited to placing a single order at a time but the virtual prepaid account is delivered more quickly and skips our internal order batching process.
Want to skip the details? Jump right to the full order JSON
With this option you will receive the virtual prepaid account redemption code and associated information that you can use to present in your own application experience.
When using the real-time APIs you can only order one item at a time for a single recipient.
Placing the Order for Code Delivery
To place the order we will be using submitRealTimeVirtualBulk
.
Method | Service Name | Service Type |
---|---|---|
POST | submitRealTimeVirtualBulk → Explore | Hybrid synchronous/asynchronous based on millisecondToWait parameter. |
HTTP Header
From our application we need to send the following parameters in the HTTP header:
Parameter | Description | Type | Required | Default Value |
---|---|---|---|---|
| The Merchant ID (MID) is a string identifier, provided to you by your account manager that varies based on the product type you are ordering. | String | Yes | None |
| A unique identifier for each order provided by you (the caller). The requestId must be unique with a maximum of 50 characters. | String | Yes | None |
| Provide a value between 0 - 30000 to indicate how long your application or service will wait for a response. Once this time is exceeded the request will become asynchronous. The minimum required value for real-time requests is | Integer | No | 2000 |
In our example we will be sending the following values in the header:
Content-Type: application/json
merchantId: 60300004707
requestId: 2019-07-02T17:30:10-0500
millisecondsToWait: 30000
Body Parameters
In the body of the POST request we need to send all the information needed to complete the order:
Parameter | Description | Type | Required | Allowed Values |
---|---|---|---|---|
| The client program number supplied by your Account Manager for the program you are placing your order under. | Integer | Yes | Must be a valid client program number / quote number assigned to you. |
| The financial account ID (FAID) specifies the financial account associated with your sub-organization to be used for the order. When a value is provided for the A value for | String | No | The value provided must match a valid financial account ID configured for your sub-organization |
| Specifies how you are going to pay for the order. This must be one of the specified allowed values. | String | Yes | ACH_DEBIT |
| The product you wish to order. | Object | Yes | |
| PO numbers must be 50 characters or less. | String | No | Digits 0-9, alpha (a-z, A-Z), space, period and hyphen. |
Providing the Order Details for Code Delivery
We will pass the details for the order in the orderDetails
object:
Parameter | Description | Type | Required | Allowed Values |
---|---|---|---|---|
| Unique client reference to identify duplicates. Must be 30 characters or less. | String | No | Digits 0-9, alpha (a-z, A-Z), space, period, comma, hyphen, forward slash (/) and apostrophe. |
| Must be 1 for real-time orders. | Integer | Yes | Digits 0-9 |
| Specify the value of the virtual prepaid account. | Number | Yes | Digits 0-9 and period. May not contain symbols and may have up to two digits after the decimal separator. Example: 25.00 |
In our example we're placing a single order for one $25 Virtual MasterCard® Prepaid Account, so our order details JSON will look like this:
{
"clientRefId": "123456",
"quantity": "1",
"amount": "25"
}
Submitting the Order
Now we will go ahead and put that information together to place our order.
To do that we will make an HTTP POST request to https://apipp.blackhawknetwork.com/rewardsOrderProcessing/v1/submitRealTimeVirtualBulk
, sending the header parameters as we outlined above, with the following JSON in the body of the request.
{
"clientProgramNumber": "43564408",
"paymentType": "ACH_CREDIT",
"poNumber": "2345",
"orderDetails": [{
"clientRefId": "123456",
"quantity": "1",
"amount": "25"
}]
}
The API will return a response to us containing an HTTP status code in the header and a JSON object in the body. This response will tell us if the order was successful and if it has been completed or not.
The following HTTP status codes may be returned in the response header.
HTTP Status Code | Meaning | Notes |
---|---|---|
201 | Operation Complete | If |
202 | Operation is in Process | If |
4XX | Invalid Request | Check the JSON error response provided. In most cases you will find the request had missing information or was formatted improperly. |
5XX | System Error | Blackhawk Network encountered an internal error trying to process your order. Reach out to your Account Manager for more information. |
Order has Completed Processing (Code Delivery)
Assuming our order was placed successfully we will receive the virtual prepaid account information directly in the JSON response.
{
"transactionId": "435LYTF8GAS6NCB3R9TLCXWY30",
"isCompleted": true,
"percentComplete": 100,
"success": true,
"orderNumber": "401087978",
"virtualItemList":[{
"code": "NN4QSHZSTNKF",
"amount": 50
}]
}
Updated about 17 hours ago