Create Bulk Transactions
It creates transactions' records into the system.Bazaarvoice using this input will schedule Review Requests Notifications.
Try out Bulk Transaction API reference here.
Request
The Bulk Transactions API facilitates the submission of multiple transaction records in a single request to Bazaarvoice. Each batch of transactions is identified by a unique batch Id, allowing for easier tracking and management. Additionally, the API now includes a status field to indicate the current processing status of each batch.
HTTP POST is required.
POST https://[stg].api.bazaarvoice.com/customer-transactions/bulk-transactions HTTP/1.1
Content-Type: application/json
Authorization: Bearer {ACCESS_TOKEN}
...
{
"clientName": "client-1",
"transactions": [
{
"id": "transactionId-1234",
"products": [
{
"id": "apple-iphone-14-pro",
"name": "Apple Iphone 14 pro",
"money": {
"amount": 1099,
"currency": "EUR"
},
"imageUrl": "https://test-client.com/eu/images/apple-iphone-14-pro-1"
}
],
"emailAddress": "[email protected]",
"transactionDate": "2023-06-06T08:47:51.792Z",
"nickname": "John Doe",
"userId": "john_doe_1",
"locale": "en_US",
"deploymentZone": "main_site"
},
{
"id": "transactionId-5678",
"products": [
{
"id": "test-product-id",
"name": "test product",
"money": {
"amount": 1999,
"currency": "EUR"
},
"imageUrl": "https://test-client.com/eu/images/test-product-id"
}
],
"emailAddress": "[email protected]",
"transactionDate": "2023-06-06T08:47:51.792Z",
"nickname": "Sarah Lee",
"userId": "sarah_lee",
"locale": "en_US",
"deploymentZone": "main_site"
}
]
}
Ellipses (…) in above example indicate that your application may generate other headers.
Older applications may be using
https://[stg.]api.bazaarvoice.com/**contentmanagement**
as the base URL for the Response API, instead ofhttps://[stg.]api.bazaarvoice.com/**response**
.Thecontentmanagement
URL has been deprecated. However, Bazaarvoice will continue to support applications that use thecontentmanagement
URL until further notice.
Parameters
Name | Description | Required |
---|---|---|
Header | ||
Content-Type | application/json. | Yes |
Authorization | The Authorization value will consist of the string Bearer followed by the OAuth2 access token. Refer to OAuth2 Integration for more information. | Yes |
Body | ||
clientName | Unique identifier of the client. | Yes |
id | The Identifier for the transaction between the end customer and the client. The client provides this and Bazaarvoice does not create it. | Yes |
products | This is an array of product details that are part of the transaction. For example, in a transaction, if a customer purchases 2 products this array will be populated with both the product details | Yes |
products.id | The product identifier internal to the client. | Yes |
products.name | The name of the product. | Yes |
products.money | An object representing the monetary value, including the amount and currency of the transaction | Yes |
products.money.currency | This is a 3-letter currency code as defined by ISO-4217. Eg. EUR | No |
products.money.amount | The price of the product. | No |
products.imageUrl | The URL of the image to be passed on and available in the notification. | Yes |
emailAddress | The email address of the end customer for whom we need to send notifications. | Yes |
transactionDate | The time at which the transaction was made at the client by the end customer. | Yes |
nickname | The end customer username used during notifying the end customer. | Yes |
userId | The end customer userId to be provided. | Yes |
locale | The locale data in bcp47 format to be provided. | Yes |
deploymentZone | The deployment zone that this transaction should be processed at. E.g: main_site. | Yes |
transactionChannel | The preference channel over which you would like to notify the customer. E.g.: EMAIL. | No |
Limits
Name | Description | Limit |
---|---|---|
Number of Transactions | refers to the maximum allowable number of transactions that can be included in a single request. | 200 |
Request Size | The Request Size Limit defines the maximum allowable size for the entire request payload. | 256 KiB |
Response
Header
HTTP status 207 indicates the submission of multiple transactions.
Body
Below is an example of a successful creation of a transaction request:
{
"batchId": "unique_batch_id",
"batchStatus": "ACCEPTED",
"items":[
{
"transactionId":"transactionId-1234",
"occurredAt":"2024-02-20T13:54:33.338998+05:30",
"status":"ACCEPTED",
"message":"Accepted."
},
{
"transactionId":"transactionId-5678",
"occurredAt":"2024-02-20T13:54:33.339009+05:30",
"status":"FAILURE",
"message":"An unexpected error has occurred, please retry. Contact Bazaarvoice if the problem persists."
}
]
}
Errors
For a detailed description and solution to Response API errors, refer to Troubleshooting.
The following lists specific errors that may be encountered when creating a new client response request:
clientId must not be empty
The required parameter clientId
is not included in the request.
{
"type": "/problems/bad-request",
"instance": "/customer-transactions/bulk-transactions",
"title": "Bad Request",
"status": 400,
"detail": "The required fields are missing. Ensure the Request Body has all required fields and try again."
}
The number of transactions exceeded.
The number of transactions in the request must be less or equal to the max-defined limit.
{
"type": "/problems/bad-request",
"instance": "/customer-transactions/transactions",
"title": "Bad Request",
"status": 400,
"detail": "The number of transactions in the request exceeds the maximum allowed limit. Please reduce the number of transactions and try again."
}
Request size exceeded.
The size of the request must not exceed the maximum allowed limit.
{
"type": "/problems/bad-request",
"instance": "/customer-transactions/transactions",
"title": "Bad Request",
"status": 400,
"detail": "The size of the request exceeds the maximum allowed limit. Please reduce the size of the request payload and try again."
}
Valid AccessToken must be provided.
The required parameter AccessToken
is not included in the request or expired:
{
"type": "/problems/unauthorized",
"instance": "/customer-transactions/bulk-transactions",
"title": "Unauthorized",
"status": 401,
"detail": "Request lacks valid authentication credentials for this resource."
}
Provided client details in the header must be correct.
The client details are invalid:
{
"type": "/problems/forbidden",
"instance": "/customer-transactions/bulk-transactions",
"title": "Forbidden",
"status": 403,
"detail": "Credentials lack the permission to perform this action with this resource."
}
Something unexpected occurs.
Unexpected network issue occurs:
{
"type": "/problems/internal-error",
"instance": "/customer-transactions/bulk-transactions",
"title": "Internal Error",
"status": 500,
"detail": "An unexpected error has occurred, please retry. Contact Bazaarvoice if the problem persists."
}
Updated 8 months ago