Updates the payment rules for a product: whether the product limits which payment methods can be used, and which methods those are.
Before you begin#
- The API token needs
ProductPaymentRules_Update, either assigned directly under Functions or through a group. See Create an API token. - Requests must be signed if the token requires it. See Make a signed request with HMAC.
- You need the product’s
Product_ID,Product_Code,Edit_ProductorProduct_SKU.
Example requests#
Limit the product to one payment method#
Limits the product to a single payment method.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "ProductPaymentRules_Update",
"Product_Code": "{{Product_Code}}",
"LimitPaymentMethods": true,
"PaymentMethods": [
{
"module_code": "cod",
"method_code": "COD"
}
]
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
Product_IDProduct_CodeEdit_ProductProduct_SKU |
Number String String String |
The product to update payment rules for. | |
LimitPaymentMethods |
Boolean | No | Whether the product is limited to specific payment methods. |
PaymentMethods |
Array | Replaces the product’s payment methods. Each element has a module_code (up to 50 characters) and method_code (up to 100 characters), or a paymentcard_type instead. Payment card types need MivaPay enabled. |
Example response#
{
"success": 1
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
success |
Boolean | Boolean value for if the request was successful. |
Related functions#
| Function | Use it to |
|---|---|
ProductShippingRules_Update |
Change a product’s shipping rules |
InventoryProductSettings_Update |
Change a product’s inventory settings |
Product_Update |
Change a product |
ProductList_Load_Query |
Find products |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Products > ProductPaymentRules_Update. See Set Up Postman.