首页 > 解决方案 > 在结帐时更新折扣代码时出现 Shopify 400 错误

问题描述

我正在使用 shopify python api 在结帐时更新折扣代码。以下是步骤 -

#Retrieve the checkout using
checkout = shopify.Checkout.find('6ad53674ac258e67cac363921af7d6c2')

#update the discount code,
checkout.discount_code = 'CADAD12'

#Save the checkout
checkout.save()

保存结帐时出现以下错误,

响应(code=400,body="{"errors":{"credit_card":"must be a hash"}}")

请帮助解决这个问题。

另外,如果有任何其他方法可以使用 shopify_python_api 将折扣代码应用于结帐,请告诉我

标签: shopifyshopify-api

解决方案


推荐阅读