@@ -503,6 +503,50 @@ func setShippingZoneRateState(d *schema.ResourceData, shippingMethod *platform.S
503
503
return err
504
504
}
505
505
506
+ if len (shippingRate .Tiers ) != 0 {
507
+ tiers := []any {}
508
+
509
+ for _ , v := range shippingRate .Tiers {
510
+ switch shippingRateTier := v .(type ) {
511
+ case platform.CartClassificationTier :
512
+ tiers = append (tiers , map [string ]any {
513
+ "type" : string (platform .ShippingRateTierTypeCartClassification ),
514
+ "value" : shippingRateTier .Value ,
515
+ "price" : []any {
516
+ map [string ]any {
517
+ "currency_code" : shippingRateTier .Price .CurrencyCode ,
518
+ "cent_amount" : shippingRateTier .Price .CentAmount ,
519
+ },
520
+ },
521
+ })
522
+ case platform.CartScoreTier :
523
+ tiers = append (tiers , map [string ]any {
524
+ "type" : string (platform .ShippingRateTierTypeCartScore ),
525
+ "score" : shippingRateTier .Score ,
526
+ "price" : []any {
527
+ map [string ]any {
528
+ "currency_code" : shippingRateTier .Price .CurrencyCode ,
529
+ "cent_amount" : shippingRateTier .Price .CentAmount ,
530
+ },
531
+ },
532
+ })
533
+ case platform.CartValueTier :
534
+ tiers = append (tiers , map [string ]any {
535
+ "type" : string (platform .ShippingRateTierTypeCartValue ),
536
+ "minimum_cent_amount" : shippingRateTier .MinimumCentAmount ,
537
+ "price" : []any {
538
+ map [string ]any {
539
+ "currency_code" : shippingRateTier .Price .CurrencyCode ,
540
+ "cent_amount" : shippingRateTier .Price .CentAmount ,
541
+ },
542
+ },
543
+ })
544
+ }
545
+ }
546
+
547
+ d .Set ("shipping_rate_price_tier" , tiers )
548
+ }
549
+
506
550
if typedPrice , ok := shippingRate .Price .(platform.CentPrecisionMoney ); ok {
507
551
price := map [string ]any {
508
552
"currency_code" : string (typedPrice .CurrencyCode ),
0 commit comments