• PXM Price Books/
    PXM Price Book Prices API/
    Update Product Price

    Update a Product Price in a Price Book

    You can update a product price in a price book.

    All currencies in the product price must be included in the update request or they will be removed from the product price.

    PUT Update a Product Price in a Price Book

    https://api.moltin.com/pcm/pricebooks/:id/prices/:priceId
    

    Parameters

    Path parameters

    NameRequiredTypeDescription
    idRequiredstringThe unique identifier of the price book.
    priceIdRequiredstringThe unique identifier of the product price.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token to grant the API access.

    Body

    Required. A ProductPrice object with the following attributes:

    NameRequiredTypeDescription
    idRequiredstringThe generated unique identifier of the product price resource. The product price ID not the same as its product ID, which might appear in multiple pricebooks with different prices.
    typeRequiredstringAlways: product-price
    attributes.product_idRequiredstringThe product ID that the prices belongs to.
    attributes.currenciesRequiredobjectA collection of one or more currencies: <key> objects.
    attributes.currencies: <key>RequiredstringWhere <key> is the three-letter ISO code for the currency associated with this price.
    attributes.currencies: <key>: amountRequiredintegerThe price in the lowest denomination for the specified currency.
    attributes.currencies: <key>: includes_taxOptionalbooleanWhether this price includes tax. Default is false.
    attributes.currencies: <key>: tiersOptionalobjectThe price tier that an item is eligible for based on the quantity purchased. Note: You cannot have conflicting tiers within the same currencies block.
    attributes.salesOptionalobjectThe sales price that an item is eligible for based on the price book. Note: You cannot have conflicting sales prices within the same block.

    Update request example

    curl -X PUT https://api.moltin.com/pcm/pricebooks/2cf0d38c-58aa-420d-8658-4385dccea609/prices/76c78677-a22a-4104-8fb7-11f1cfc3b146 \
         -H "Authorization: Bearer XXXX" \
         -H "Content-Type: application/json" \
         -d $'{
           "data": {
               "id": "76c78677-a22a-4104-8fb7-11f1cfc3b146",
                "type": "product-price",
                "attributes": {
                    "sku": "product-1"
                    "currencies": {
                        "USD": {
                            "amount": 100,
                            "includes_tax": false
                        },
                        "GBP": {
                            "amount": 75,
                            "includes_tax": true
                        },
                        "CAD": {
                            "amount": 125,
                            "includes_tax": false
                        }
                    },
                    "sales": {
                        "summer": {
                            "schedule": {},
                            "currencies": {
                                "USD": {
                                    "amount": 90,
                                    "includes_tax": false,
                                    "tiers": {
                                        "min_5": {
                                            "minimum_quantity": 5,
                                            "amount": 40
                                        }
                                    }
                                },
                                "CAD": {
                                    "amount": 117,
                                    "includes_tax": false,
                                    "tiers": {
                                        "min_10": {
                                            "minimum_quantity": 10,
                                            "amount": 80
                                        }
                                    }
                                },
                                "GBP": {
                                    "amount": 65,
                                    "includes_tax": true,
                                    "tiers": {
                                        "min_20": {
                                            "minimum_quantity": 20,
                                            "amount": 50
                                        }
                                    }
                                }
                            }
                        }
                    },
                }
           }
         }'
    

    Response example

    200 OK

    {
        "data": {
            "id": "76c78677-a22a-4104-8fb7-11f1cfc3b146",
            "attributes": {
                "sku": "product-1",
                "currencies": {
                    "CAD": {
                        "amount": 125,
                        "includes_tax": false,
                        "tiers": {
                            "min_10": {
                                "minimum_quantity": 10,
                                "amount": 50
                            }
                        }
                    },
                    "GBP": {
                        "amount": 75,
                        "includes_tax": true,
                        "tiers": {
                            "min_10": {
                                "minimum_quantity": 10,
                                "amount": 50
                            }
                        }
                    },
                    "USD": {
                        "amount": 100,
                        "includes_tax": false,
                        "tiers": {
                            "min_10": {
                                "minimum_quantity": 10,
                                "amount": 50
                            }
                        }
                    }
                },
                "sales": {
                    "summer": {
                        "schedule": {},
                        "currencies": {
                            "USD": {
                                "amount": 90,
                                "includes_tax": false,
                                "tiers": {
                                    "min_5": {
                                        "minimum_quantity": 5,
                                        "amount": 40
                                    }
                                }
                            },
                            "CAD": {
                                "amount": 117,
                                "includes_tax": false,
                                "tiers": {
                                    "min_10": {
                                        "minimum_quantity": 10,
                                        "amount": 80
                                    }
                                }
                            },
                            "GBP": {
                                "amount": 65,
                                "includes_tax": true,
                                "tiers": {
                                    "min_20": {
                                        "minimum_quantity": 20,
                                        "amount": 50
                                    }
                                }
                            }
                        }
                    }
                },
             },
            "meta": {
                "owner": "store"
            },
            "type": "product-price"
        },
        "links": {
            "self": "/pcm/pricebooks/2cf0d38c-58aa-420d-8658-4385dccea609/prices/76c78677-a22a-4104-8fb7-11f1cfc3b146"
        }
    }
    

    Bundle sale price update request example

    curl -X POST https://api.moltin.com/pcm/pricebooks/2cf0d38c-58aa-420d-8658-4385dccea609/prices \
         -H "Authorization: Bearer XXXX" \
         -H "Content-Type: application/json" \
         -d $'{
            "data": {
                "type": "product-price",
                "attributes": {
                    "currencies": {
                        "USD": {
                            "amount": 100,
                            "includes_tax": false,
                            "tiers": {
                                "min_5": {
                                    "minimum_quantity": 5,
                                    "amount": 50
                                }
                            }
                        },
                        "GBP": {
                            "amount": 73,
                            "includes_tax": true,
                            "tiers": {
                                "min_20": {
                                    "minimum_quantity": 20,
                                    "amount": 60
                                }
                            }
                        },
                        "CAD": {
                            "amount": 127,
                            "includes_tax": false,
                            "tiers": {
                                "min_10": {
                                    "minimum_quantity": 10,
                                    "amount": 100
                                }
                            }
                        }
                    },
                    "sales": {
                        "summer": {
                          "bundle_ids": [
                            "a3cacaa9-b5bb-4096-bb6b-af41394ca850"
                        ],
                            "schedule": {},
                            "currencies": {
                                "USD": {
                                    "amount": 100,
                                    "includes_tax": false,
                                    "tiers": {
                                        "min_5": {
                                            "minimum_quantity": 5,
                                            "amount": 40
                                        }
                                    }
                                },
                                "CAD": {
                                    "amount": 117,
                                    "includes_tax": false,
                                    "tiers": {
                                        "min_10": {
                                            "minimum_quantity": 10,
                                            "amount": 80
                                        }
                                    }
                                },
                                "GBP": {
                                    "amount": 65,
                                    "includes_tax": true,
                                    "tiers": {
                                        "min_20": {
                                            "minimum_quantity": 20,
                                            "amount": 50
                                        }
                                    }
                                }
                            }
                        }
                      }
                },
                "sku": "product-1"
              }'
    

    The includes_tax setting must be the same for all options in a bundle. If you include tax for an option in a component within a bundle, you must include tax for all options in the bundle. You cannot set includes_tax setting only for an individual option in a bundle.

    Response Example

    200 OK

    {
        "data": {
            "id": "76c78677-a22a-4104-8fb7-11f1cfc3b146",
            "attributes": {
                "currencies": {
                    "USD": {
                        "amount": 100,
                        "includes_tax": false,
                        "tiers": {
                            "min_5": {
                                "minimum_quantity": 5,
                                "amount": 50
                            }
                        }
                    },
                    "CAD": {
                        "amount": 127,
                        "includes_tax": false,
                        "tiers": {
                            "min_10": {
                                "minimum_quantity": 10,
                                "amount": 100
                            }
                        }
                    },
                    "GBP": {
                        "amount": 73,
                        "includes_tax": true,
                        "tiers": {
                            "min_20": {
                                "minimum_quantity": 20,
                                "amount": 60
                            }
                        }
                    }
                },
                "sales": {
                    "summer": {
                      "bundle_ids": [
                          "a3cacaa9-b5bb-4096-bb6b-af41394ca850"
                      ],
                        "schedule": {},
                        "currencies": {
                            "USD": {
                                "amount": 100,
                                "includes_tax": false,
                                "tiers": {
                                    "min_5": {
                                        "minimum_quantity": 5,
                                        "amount": 40
                                    }
                                }
                            },
                            "CAD": {
                                "amount": 117,
                                "includes_tax": false,
                                "tiers": {
                                    "min_10": {
                                        "minimum_quantity": 10,
                                        "amount": 80
                                    }
                                }
                            },
                            "GBP": {
                                "amount": 65,
                                "includes_tax": true,
                                "tiers": {
                                    "min_20": {
                                        "minimum_quantity": 20,
                                        "amount": 50
                                    }
                                }
                            }
                        }
                    }
                },
                "sku": "product-1"
             },
            "meta": {
                "owner": "store"
            },
            "type": "product-price"
        },
        "links": {
            "self": "/pcm/pricebooks/2cf0d38c-58aa-420d-8658-4385dccea609/prices/76c78677-a22a-4104-8fb7-11f1cfc3b146"
        }
    }
    

    Was this helpful?

    Previous
    Create Product Prices