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 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 |
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."
}
Updated 7 months ago