Create Transaction

It creates the single transaction's record into the system.Bazaarvoice using this input will schedule Review Requests Notifications.

📘

Try out Create Transaction API reference here.

Request

Transactions API will be used to POST the transaction data to Bazaarvoice. Transactions request body contains details like customer email and product purchase details. Bazaarvoice using this input will schedule Review Requests Notifications.

📘

HTTP POST is required.

POST https://[stg].api.bazaarvoice.com/customer-transactions/transactions HTTP/1.1

Content-Type: application/json
Authorization: Bearer {ACCESS_TOKEN}

...
{
  "clientName": "test-client",
  "id": "transaction_1234",
  "products": [
    {
      "id": "product_5678",
      "name": "Example Product",
      "money": {
        "amount": 50.00,
        "currency": "EUR"
      },
      "imageUrl": "https://example.com/product.jpg"
    }
  ],
  "emailAddress": "[email protected]",
  "transactionDate": "2024-03-10T12:00:00.000Z",
  "nickname": "John Doe",
  "userId": "user_1111",
  "locale": "en_US",
  "deploymentZone": "main_site"
}

Ellipses (…) in the 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 transaction.Yes
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

Response

Header

HTTP status 202 indicates success.

Body

Below is an example of a successful creation of a transaction request:

{
  "responseMessage": "ACCEPTED"
}

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/transactions",
  "title": "Bad Request",
  "status": 400,
  "detail": "The required fields are missing. Ensure the Request Body has all required fields 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/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/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/transactions",
  "title": "Internal Error",
  "status": 500,
  "detail": "An unexpected error has occurred, please retry. Contact Bazaarvoice if the problem persists."
}