メインコンテンツまでスキップ

Calculating Tax and Shipping for Shoppable Ads

Required for: API, CSV, URL, SFTP, EDI Catalog integration methods

When a shopper purchases your product through a Shoppable Ad, Rokt orchestrates the order in real time. Before the order is placed, Rokt calls your APIs to retrieve the applicable shipping rates (if desired) and tax amounts (required). Once the order is confirmed, Rokt delivers it to you via webhook for fulfillment.

The order flow for Rokt Shoppable Ads proceeds as follows:

  1. Shopper selects a product and initiates checkout.
  2. Rokt calls your endpoint to fetch available shipping cost and to calculate applicable tax.
  3. Shopper completes payment using secure payment forwarding with you as MoR.
  4. Rokt Catalog sends you an order with full order details.
  5. You fulfill the order and send tracking information back.

AuthenticationAuthentication への直接リンク

All API endpoints require the following authentication headers on every request:

Header NameTypeRequiredDescription
x-api-keystringYesAPI key provided during onboarding
x-api-secretstringYesAPI secret provided during onboarding
Content-TypestringYesMust be application/json

Shipping Rate APIShipping Rate API への直接リンク

By default, Shipping values can be set via Rokt Catalog for Brands as a flat rate for Shoppable Ads. We highly recommend offering free shipping ($0.00) as it is a strong incentive for conversion in placement. This can be set directly in Rokt Catalog for Brands.

If you want your shipping rates to be dynamic, you must expose and host this endpoint. Rokt calls your Shipping Rate endpoint during checkout to present real-time shipping options to the shopper. Provide the URL to your Rokt account manager during onboarding.


Request (Rokt → Your endpoint)Request (Rokt → Your endpoint) への直接リンク

Rokt sends a request to your Shipping Rate URL with the following payload:

Request BodyRequest Body への直接リンク

Field NameTypeRequiredDescription
originobjectYesWarehouse/origin address
destinationobjectYesShopper destination address
productsarrayYesArray of SKU and quantity
currencystringNoCurrency code, defaults to USD

origin / destination Objectorigin / destination Object への直接リンク

Field NameTypeRequiredDescription
address1stringYesPrimary street address
address2string | nullNoSecondary address line
citystringYesCity
stateCodestringYesState or province code (e.g. TX)
postalCodestringYesZIP or postal code
countrystringYesCountry code (e.g. US)

products Array Itemproducts Array Item への直接リンク

Field NameTypeRequiredDescription
skustringYesProduct SKU
quantityintegerYesQuantity ordered

Example RequestExample Request への直接リンク

Rokt sends a POST to your Shipping Rate URL (for example https://api.yourbrand.com/rokt/shipping-rates) with the following payload:

{
"origin": {
"address1": "123 Warehouse St",
"address2": null,
"city": "Memphis",
"stateCode": "TN",
"postalCode": "38101",
"country": "US"
},
"destination": {
"address1": "456 Shopper Ave",
"address2": null,
"city": "Austin",
"stateCode": "TX",
"postalCode": "78701",
"country": "US"
},
"products": [
{
"sku": "SHOE-8-BLK",
"quantity": 1
}
],
"currency": "USD"
}

Response (Your endpoint → Rokt)Response (Your endpoint → Rokt) への直接リンク

Return an array of the selected shipping rate. Rokt presents this option to the shopper at checkout:

Response BodyResponse Body への直接リンク

Field NameTypeDescription
ratesarrayArray of shipping rate options
rates[].service_namestringDisplay name (e.g. Standard Shipping)
rates[].service_codestringInternal code (e.g. STANDARD)
rates[].total_pricenumberShipping cost in decimal dollars (e.g. 7.99)
rates[].currencystringCurrency code
rates[].min_delivery_datestringEarliest delivery date (YYYY-MM-DD)
rates[].max_delivery_datestringLatest delivery date (YYYY-MM-DD)
successbooleantrue if rates returned successfully
errorMessagestringPresent only on failure

Example ResponseExample Response への直接リンク

{
"rates": [
{
"service_name": "Standard Shipping",
"service_code": "STANDARD",
"total_price": 7.99,
"currency": "USD",
"min_delivery_date": "2026-03-24",
"max_delivery_date": "2026-03-27"
}
],
"success": true
}
備考

Prices are in decimal dollars. total_price values must be expressed as decimal numbers (e.g. 7.99 = $7.99).


Error ResponsesError Responses への直接リンク

HTTP CodesuccesserrorMessage
200falseProduct {sku} is not available.
401falseUnauthorized: Invalid API key
400falseBad Request: products is missing.
400falseBad Request: shippingAddress is missing.
500falseUnexpected error: if the error persists, please contact an administrator.


Tax APITax API への直接リンク

You must expose and host this endpoint. Rokt calls your Tax endpoint during checkout to calculate the applicable tax for the order. Provide the URL to your Rokt account manager during onboarding.


Request (Rokt → Your endpoint)Request (Rokt → Your endpoint) への直接リンク

Request BodyRequest Body への直接リンク

Field NameTypeRequiredDescription
productsarrayYesArray of SKU and quantity
shippingAddressobjectYesShipping destination address

shippingAddress ObjectshippingAddress Object への直接リンク

Field NameTypeRequiredDescription
address1stringYesPrimary street address
address2string | nullNoSecondary address line
citystringYesCity
stateCodestringYesState or province code (e.g. TX)
postalCodestringYesZIP or postal code

products Array Itemproducts Array Item への直接リンク

Field NameTypeRequiredDescription
skustringYesProduct SKU
quantityintegerYesQuantity ordered

Example RequestExample Request への直接リンク

Rokt sends a POST to your Tax URL (for example https://api.yourbrand.com/rokt/tax) with the following payload:

{
"products": [
{
"sku": "SHOE-8-BLK",
"quantity": 1
}
],
"shippingAddress": {
"address1": "456 Shopper Ave",
"city": "Austin",
"stateCode": "TX",
"postalCode": "78701"
}
}

Response (Your endpoint → Rokt)Response (Your endpoint → Rokt) への直接リンク

Response BodyResponse Body への直接リンク

Field NameTypeDescription
successbooleantrue if tax calculated successfully
taxarrayPer-product tax breakdown
tax[].productIdstringSKU or product identifier
tax[].taxRatenumberTax rate as decimal (e.g. 0.0775 = 7.75%)
tax[].taxAmountnumberTax amount in decimal dollars (e.g. 2.44)
taxTotalnumberTotal tax across all products in decimal dollars
errorMessagestringPresent only on failure

Example ResponseExample Response への直接リンク

{
"success": true,
"tax": [
{
"productId": "SHOE-8-BLK",
"taxRate": 0.0625,
"taxAmount": 8.12
}
],
"taxTotal": 8.12
}
備考

Tax amounts are in decimal dollars. Consistent with the Shipping Rate API, taxAmount and taxTotal must be expressed as decimal numbers (e.g. 8.12 = $8.12), and taxRate as a decimal fraction (e.g. 0.0625 = 6.25%).


Error ResponsesError Responses への直接リンク

HTTP CodesuccesserrorMessage
200falseProduct {sku} is not available.
401falseUnauthorized: Invalid API key
400falseBad Request: products is missing.
400falseBad Request: shippingAddress is missing.
500falseUnexpected error: if the error persists, please contact an administrator.
この記事は役に立ちましたか?