customerMyVariantPrice
Requires a customer (portal or buyer app) session.
Returns the signed-in customer's price for a variant at a quantity, in the unit of measure given, or the variant's base unit when none is given.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query CustomerMyVariantPrice($variantId: String!) {
customerMyVariantPrice(variantId: $variantId) {
currencyCode
customerTierName
automaticDiscountAmount
automaticDiscountPercent
convertedAtRate
convertedFromBaseUnitPrice
appliedDiscounts {
id
code
name
type
discountAmount
fixedAmount
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CustomerMyVariantPrice($variantId: String!) {\n customerMyVariantPrice(variantId: $variantId) {\n currencyCode\n customerTierName\n automaticDiscountAmount\n automaticDiscountPercent\n convertedAtRate\n convertedFromBaseUnitPrice\n appliedDiscounts {\n id\n code\n name\n type\n discountAmount\n fixedAmount\n }\n }\n}",
"variables": {
"variantId": "string"
}
}
EOF
Variables:
{
"variantId": "string"
}
Response:
{
"data": {
"customerMyVariantPrice": {
"currencyCode": "string",
"customerTierName": "string",
"automaticDiscountAmount": 0,
"automaticDiscountPercent": 0,
"convertedAtRate": 0,
"convertedFromBaseUnitPrice": 0,
"appliedDiscounts": [
{
"id": "string",
"code": "string",
"name": "string",
"type": "string",
"discountAmount": 0,
"fixedAmount": 0
}
]
}
}
}
customerMyVariantPrice(
quantity: Int
uomId: String
variantId: String!
): CustomerVariantPrice!
Arguments
customerMyVariantPrice.quantity ● Int scalar
How many units to price. Defaults to 1 when omitted or not above zero.
customerMyVariantPrice.uomId ● String scalar
The ID of the unit of measure to price the variant in.
customerMyVariantPrice.variantId ● String! non-null scalar
The ID of the variant.
Type
CustomerVariantPrice object
The resolved single price for a variant (per selected UOM + qty), plus automatic-discount breakdown and the P1d line-pricing exposure.