Get Price Adjustment
1 min
POST
https://api.upstartcommerce.com/v1/promotion/priceadjustments
Header Parameters
- x-upstart-tenantstringrequiredDescription
- x-upstart-sitestringrequiredDescription
Body Parameters
- bodyCartPromotionRequestrequiredDescription
- couponIdsstring[]Description
- currencystringrequired
- idstring<uuid>requiredFormatuuid
- itemsCartItem[]requiredDescription
- catalogItemIdstringrequiredDescription
- idstring<uuid>requiredFormatuuid
- quantityinteger<int32>requiredFormatint32
- productItemSkuIdstringrequired
- promotionIdstringDescription
- shipmentIdstring<uuid>ExampleDescriptionFormatuuid
- pricingCartItemPricingrequiredDescription
- basePriceBasePricerequiredDescription
- listPricenumber
- pricenumberrequired
- typestringrequired
- zonestringrequired
- promotionPriceAdjustmentsPromotionPriceAdjustment[]requiredDescription
- descriptionstring
- idstringrequired
- namestring
- valuenumberrequired
- taxCodestringDescription
- locationIdstringrequiredDescription
- pricenumberExample
- timezoneIdstringExampleDescription
- cartShipmentsCartShipment[]Description
- idstring<uuid>requiredExampleDescriptionFormatuuid
- shippingMethodIdstring<uuid>requiredExampleDescriptionFormatuuid
- pricingobjectrequiredDescription
- basePricenumberExampleDescription
- promotionPriceAdjustmentsPromotionPriceAdjustment[]Description
- descriptionstring
- idstringrequired
- namestring
- valuenumberrequired
- taxCodestringDescription
- taxPriceAdjustmentTaxPriceAdjustmentDescription
- taxCodestringrequired
- valuenumber
Responses
200
- CartPromotionResponseDescription
- couponsCartCoupon[]requiredDescription
- appliedbooleanrequiredExample
- applyStatusstring
- idstringrequiredDescription
- promotionIdstringDescription
- currencystringrequired
- idstring<uuid>requiredDescriptionFormatuuid
- itemsCartItem[]requiredDescription
- catalogItemIdstringrequiredDescription
- idstring<uuid>requiredFormatuuid
- quantityinteger<int32>requiredFormatint32
- productItemSkuIdstringrequired
- promotionIdstringDescription
- shipmentIdstring<uuid>ExampleDescriptionFormatuuid
- pricingCartItemPricingrequiredDescription
- basePriceBasePricerequiredDescription
- listPricenumber
- pricenumberrequired
- typestringrequired
- zonestringrequired
- promotionPriceAdjustmentsPromotionPriceAdjustment[]requiredDescription
- descriptionstring
- idstringrequired
- namestring
- valuenumberrequired
- taxCodestringDescription
- promotionPriceAdjustmentsCartPromotionPriceAdjustment[]requiredDescription
- descriptionstring
- idstringrequired
- namestring
- valuenumberrequired
- itemIdsstring[]required
- taxCodestringDescription
- cartShipmentsCartShipment[]Description
- idstring<uuid>requiredExampleDescriptionFormatuuid
- shippingMethodIdstring<uuid>requiredExampleDescriptionFormatuuid
- pricingobjectrequiredDescription
- basePricenumberExampleDescription
- promotionPriceAdjustmentsPromotionPriceAdjustment[]Description
- descriptionstring
- idstringrequired
- namestring
- valuenumberrequired
- taxCodestringDescription
- taxPriceAdjustmentTaxPriceAdjustmentDescription
- taxCodestringrequired
- valuenumber
400
- ValidationErrorResponseDescription
- namestringrequired
- codestringrequired
- detailstring
401
- ErrorResponseDescription
- namestringrequired
- codestringrequired
- detailstringrequired
- reasonstring
curl
curl --request POST \
--url https://api.upstartcommerce.com/v1/promotion/priceadjustments \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-upstart-tenant: string' \
--header 'x-upstart-site: string' \
--data '{
"currency": "",
"id": "",
"items": [
{
"catalogItemId": "",
"id": "",
"quantity": "",
"productItemSkuId": "",
"pricing": {
"basePrice": {
"price": "",
"type": "",
"zone": ""
},
"promotionPriceAdjustments": [
{
"id": "",
"value": ""
}
]
}
}
],
"locationId": "",
"cartShipments": [
{
"id": "A9CA1B7E-7BDE-4285-937E-B81A38DEAEEC",
"shippingMethodId": "537ED6DF-9DE2-47DE-8C0C-A47022B6F940",
"pricing": {
"promotionPriceAdjustments": [
{
"id": "",
"value": ""
}
],
"taxPriceAdjustment": {
"taxCode": ""
}
}
}
]
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("x-upstart-tenant", "string");
myHeaders.append("x-upstart-site", "string");
var raw = JSON.stringify({
"currency": "",
"id": "",
"items": [
{
"catalogItemId": "",
"id": "",
"quantity": "",
"productItemSkuId": "",
"pricing": {
"basePrice": {
"price": "",
"type": "",
"zone": ""
},
"promotionPriceAdjustments": [
{
"id": "",
"value": ""
}
]
}
}
],
"locationId": "",
"cartShipments": [
{
"id": "A9CA1B7E-7BDE-4285-937E-B81A38DEAEEC",
"shippingMethodId": "537ED6DF-9DE2-47DE-8C0C-A47022B6F940",
"pricing": {
"promotionPriceAdjustments": [
{
"id": "",
"value": ""
}
],
"taxPriceAdjustment": {
"taxCode": ""
}
}
}
]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.upstartcommerce.com/v1/promotion/priceadjustments", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.upstartcommerce.com/v1/promotion/priceadjustments")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request["x-upstart-tenant"] = "string"
request["x-upstart-site"] = "string"
request.body = JSON.dump({
"currency": "",
"id": "",
"items": [
{
"catalogItemId": "",
"id": "",
"quantity": "",
"productItemSkuId": "",
"pricing": {
"basePrice": {
"price": "",
"type": "",
"zone": ""
},
"promotionPriceAdjustments": [
{
"id": "",
"value": ""
}
]
}
}
],
"locationId": "",
"cartShipments": [
{
"id": "A9CA1B7E-7BDE-4285-937E-B81A38DEAEEC",
"shippingMethodId": "537ED6DF-9DE2-47DE-8C0C-A47022B6F940",
"pricing": {
"promotionPriceAdjustments": [
{
"id": "",
"value": ""
}
],
"taxPriceAdjustment": {
"taxCode": ""
}
}
}
]
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.upstartcommerce.com/v1/promotion/priceadjustments"
payload = json.dumps({
"currency": "",
"id": "",
"items": [
{
"catalogItemId": "",
"id": "",
"quantity": "",
"productItemSkuId": "",
"pricing": {
"basePrice": {
"price": "",
"type": "",
"zone": ""
},
"promotionPriceAdjustments": [
{
"id": "",
"value": ""
}
]
}
}
],
"locationId": "",
"cartShipments": [
{
"id": "A9CA1B7E-7BDE-4285-937E-B81A38DEAEEC",
"shippingMethodId": "537ED6DF-9DE2-47DE-8C0C-A47022B6F940",
"pricing": {
"promotionPriceAdjustments": [
{
"id": "",
"value": ""
}
],
"taxPriceAdjustment": {
"taxCode": ""
}
}
}
]
})
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'x-upstart-tenant': 'string',
'x-upstart-site': 'string'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Success-price adjustment calculated and returned.
{
"coupons": [
{
"applied": true,
"applyStatus": "",
"id": "",
"promotionId": ""
}
],
"currency": "",
"id": "",
"items": [
{
"catalogItemId": "",
"id": "",
"quantity": "",
"productItemSkuId": "",
"promotionId": "",
"shipmentId": "A9CA1B7E-7BDE-4285-937E-B81A38DEAEEC",
"pricing": {
"basePrice": {
"listPrice": 0,
"price": 0,
"type": "",
"zone": ""
},
"promotionPriceAdjustments": [
{
"description": "",
"id": "",
"name": "",
"value": 0,
"taxCode": ""
}
]
}
}
],
"promotionPriceAdjustments": [
{
"description": "",
"id": "",
"name": "",
"value": 0,
"itemIds": [
""
],
"taxCode": ""
}
],
"cartShipments": [
{
"id": "A9CA1B7E-7BDE-4285-937E-B81A38DEAEEC",
"shippingMethodId": "537ED6DF-9DE2-47DE-8C0C-A47022B6F940",
"pricing": {
"basePrice": 199.99,
"promotionPriceAdjustments": [
{
"description": "",
"id": "",
"name": "",
"value": 0,
"taxCode": ""
}
],
"taxPriceAdjustment": {
"taxCode": "",
"value": 0
}
}
}
]
}400
// The request contained information that the server was unable to process. Appropriate errors are provided in the response body.
{
"name": "",
"code": "",
"detail": ""
}401
// The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.
{
"name": "",
"code": "",
"detail": "",
"reason": ""
}