Update Product
Last updated: 04-Jan-2022
Rate this article:
Overview
The update_product call is used to update a product.
URL: https://www.2checkout.com/api/products/update_product
HTTP Method: POST
Input Parameters
Parameter | Description |
---|---|
product_id | ID of product to update. Required. |
name | Product Name. Required. |
price | Product Price. Required. |
vendor_product_id | Merchant Assigned Product ID. Optional. |
description | Product Short Description. Optional. |
long_description | Product Long Description. Optional. |
pending_url | Product Pending URL. Optional. |
approved_url | Product Approved URL. Optional. |
tangible | Tangible=1, Intangible=0. Optional. |
weight | Decimal value of weight. Required for tangible products. |
handling | Specifies handling charge if applicable. Required for tangible products. |
recurring | 1 = recurring, 0 = non-recurring. Required for recurring products. |
startup_fee | Specifies start up fee if applicable. Optional. |
recurrence | Specifies recurrence frequency (n Week |
duration | Specifies recurrence duration (n Week |
commission | 1 = commission, 0 = no commission. Required for affiliate products. |
commission_type | Sets commission type for product. Possible values: amount, percentage. Required for affiliate products. |
commission_amount | Sets commission value for product (based on commission_type). Required for affiliate products. |
option_id | Accepts single or multiple option IDs to assign to product. (multiple IDs would be &option_id=xxxxxxxxx repeated for each ID to assign, where xxxxxxxxx represents each ID value to assign.) Optional. |
category_id | Accepts single or multiple category IDs to assign product to. (multiple IDs would be &category_id=xxxxxxxxx repeated for each ID to assign, where xxxxxxxxx represents each ID value to assign.) Optional. |
Data Returned
Parameter | Description |
---|---|
response_code | Tells the user whether or not the operation was successful. |
response_message | Tells the user why the operation was or was not successful. |
Example API Call
curl -X POST https://www.2checkout.com/api/products/update_product \
-H 'Accept: application/json' -u 'username:password' \
-d 'name=test product' -d 'price=1.00' -d 'product_id=4691409938'
Example Successful Response
{
"assigned_product_id" : "2561",
"product_id" : "4691409938",
"response_code" : "OK",
"response_message" : "Product successfully updated"
}
Common Error Codes
Code | Description |
---|---|
PARAMETER_MISSING | Required parameter missing: |
PARAMETER_INVALID | Invalid value for parameter: |
RECORD_NOT_FOUND | Unable to find record. |
FORBIDDEN | Access denied to product. |
Rate this article: