Table of Contents
Overview
The Gateway's Product Manager service empowers users to efficiently manage preset products within their Merchant Gateway Account. This functionality allows merchants to define products by setting their SKU, descriptions, and pricing. Through the Payment API, integrations can seamlessly create, update, and delete products directly from the Product Manager.
This article guides you through the process of managing products within the Product Manager via the Payment API.
Adding a Product
When incorporating a new product into the Product Manager via the Payment API, integrations must initiate an API request to the designated Payment API endpoint, which may be found within the Payment API documentation section of the Integration Portal. This request will need to include the following required variables:
| Variables | Description |
|---|---|
| security_key |
API Security Key assigned to a merchant account. New keys can be generated from the merchant control panel in Settings > Security Keys |
| products | Add a product to the Product Manager. Value: “add_product“ |
| product_sku | The unique SKU for this product. An error will be returned if the SKU is already in use by another product. Examples: “000001” or “324-6323-0005“ |
| product_description | The user-facing name of the product. Examples: “1 Gallon Milk” or “Phone Case” |
| product_cost | The cost of the product before any tax or discounts. Must be greater than 0.00. |
| product_currency | The currency for the product’s price. Examples: “USD” or “EUR” |
All variables provided within the table above are required in order to add a new product to the Product Manager. Additional variables may be passed, to find a full list of variables please review the Integration Portal Documentation for the Payment API.
Here is an example request which utilizes all required parameters and will add a new product to the Product Manager:
POST: /api/transact.php
PARAMS:
[
security_key : your_security_key
products : add_product
product_sku : 0011
product_description : Phone case
product_cost : 15.00
product_currency : USD
]
The above example will create a phone case product worth $15.00, with the sku 0011. Once the request is submitted it will create the product and return a product_id. This product_id should be stored as any changes you wish to make to the product will require you to pass the product_id.
Update a Product
Once a product has been added to the Product Manager, should you need to update anything within the product you may utilize the update_product feature with the Payment API. This will allow you to make changes to any of the settings/conditions you submitted within the original request. To do so you will need to include the following required parameters within your request:
| Variables | Description |
|---|---|
| security_key |
API Security Key assigned to a merchant account. New keys can be generated from the merchant control panel in Settings > Security Keys |
| products |
Update a product already in the Product Manager. Value: “update_product“ |
| product_id |
The automatically generated ID for the product. This was returned in the add_product API response, or can be found in the UI under the Product Details page in the Product Manager. Example: “5538585252” |
The product_id variable is needed as this will direct the Payment API to update the appropriate product once the request has been submitted. Once the required parameters have been set within the request you can now pass additional parameters such as product_cost and product_description to make changes to the specified fields within the product in the Product Manager. Here is an example request where we update both the cost and description of the product:
POST: /api/transact.php
PARAMS:
[
security_key : your_security_key
products : update_product
product_id : "Your Product Id Here"
product_description : Colorful Phone case
product_cost : 20.00
]
The above request will update the specified product within the Product Manager with any information passed within the request. For example with this request we will be changing the product description to now state "Colorful Phone case" rather than the previous "Phone case" description set at the time of the product's creation.
Delete a Product
Should a merchant discontinue a product or decide to no longer offer a specific product, you may utilize the Payment API in order to delete the product from the Product Manager. To do so the integration will need to utilize the delete_product feature within the Payment API request. To delete a product from the Product Manager the integration will also need to include the following required parameters:
| Variables | Description |
|---|---|
| security_key |
API Security Key assigned to a merchant account. New keys can be generated from the merchant control panel in Settings > Security Keys |
| products |
Delete a product to the Product Manager. This action can not be undone. Value: “delete_product“ |
| product_id |
The automatically generated ID for the product. This was returned in the add_product API response, or can be found in the UI under the Product Details page in the Product Manager. Example: “5538585252” |
The parameters shown within the table above will be the only needed variables for this specific request. When submitting these variables within the Payment API request, the API will locate the specified product_id and delete the product directly from the Product Manager. Here is an example request which will delete a specified product from the Product Manager:
POST: /api/transact.php
PARAMS:
[
security_key : your_security_key
products : delete_product
product_id : "Your Product Id Here"
]