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 of https://[stg.]api.bazaarvoice.com/**response**.The contentmanagement URL has been deprecated. However, Bazaarvoice will continue to support applications that use the contentmanagement URL until further notice.

Parameters

NameDescriptionRequired
Header
Content-Typeapplication/json.Yes
AuthorizationThe Authorization value will consist of the string Bearer followed by the OAuth2 access token. Refer to OAuth2 Integration for more information.Yes
Body
clientNameUnique identifier of the client.Yes
idThe Identifier for the transaction between the end customer and the client. The client provides this and Bazaarvoice does not create it.Yes
productsThis 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 detailsYes
products.idThe product identifier internal to the client.Yes
products.nameThe name of the product.Yes
products.moneyAn object representing the monetary value, including the amount and currency of the transactionYes
products.money.currencyThis is a 3-letter currency code as defined by ISO-4217. Eg. EURNo
products.money.amountThe price of the product.No
products.imageUrlThe URL of the image to be passed on and available in the notification.Yes
emailAddressThe email address of the end customer for whom we need to send notifications.Yes
transactionDateThe time at which the transaction was made at the client by the end customer.Yes
nicknameThe end customer username used during notifying the end customer.Yes
userIdThe end customer userId to be provided.Yes
localeThe locale data in bcp47 format to be provided.Yes
deploymentZoneThe deployment zone that this transaction should be processed at. E.g: main_site.Yes
transactionChannelThe preference channel over which you would like to notify the customer. E.g.: EMAIL.No

Limits

NameDescriptionLimit
Number of Transactionsrefers to the maximum allowable number of transactions that can be included in a single request.200
Request SizeThe 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."
}