Keepup Store Docs
Home
  • Welcome
  • 💡Tutorials
    • Overview
    • Account Set Up
    • Sales
      • 💡How to Create a Quote, Invoice or Receipt
      • 💡How to Edit a Quote or an Invoice
      • 💡How to Record Payment for a Quote or an Invoice.
      • 💡How to Filter Sales
      • 💡How to Delete a Sale
      • 💡How to Print a Sale
    • Inventory
      • 💡How to Add a Product
      • 💡How to Edit a Product
      • 💡How to Filter Products
      • 💡How to Delete a Product
      • 💡How to Record Damaged or Lost Products
      • 💡How to Import Products
    • Orders
      • 💡How to Create an Order
      • 💡How to Update an Order
      • 💡How to Filter Orders
      • 💡How to Print Order Labels
      • 💡How to Delete an Order
    • Customers
      • 💡How to Add a Customer
      • 💡How to Import Customers
      • 💡How to Edit a Customer
      • 💡How to Filter Customers
      • 💡How to Delete Customers
      • 💡How to Message Customers
      • 💡How to View Customers Feedback
      • 💡How to Buy SMS/Email Bundle
    • Expenses
      • 💡How to Record an Expense
      • 💡How to Edit an Expense
      • 💡How to Record Payment for an Expense
      • 💡How to Filter Expenses
      • 💡How to Delete an Expense
      • 💡How to View Expenses Analytics
    • Subscription
      • 💡How to Renew Your Subscription
    • Storefront
      • 💡How to Set Up Your Storefront
      • 💡How to Publish and Unpublish Your Storefront
      • 💡How to Update Storefront Settings
      • 💡How to View Storefront Orders
      • 💡How to View Abandoned Carts
    • Purchase Order
      • 💡How to create a Purchase Order
      • 💡How to edit a Purchase Order
      • 💡How to filter Purchase Orders
      • 💡How to delete Purchase Orders
      • 💡How to update a Purchase Order status
      • 💡How to record payment for a Purchase Order
    • Business Settings
      • 💡How to Update Business Information
      • 💡How to Verify your Business
      • 💡How to Manage Your Business API
      • 💡How to Update Sale Settings
      • 💡How to Manage Your Tax Profiles
      • 💡How to Manage Your Delivery and Pick Up Locations
      • 💡How to Manage Your Online Payments Options
      • 💡How to Manage your Offline Payments Options
    • Raw Materials
      • 💡How to Add a Raw Material
      • 💡How to Edit a Raw Material
      • 💡How to Import Raw Materials
      • 💡How to Filter Raw Materials
      • 💡How to Delete a Raw Material
      • 💡How to Record Damaged or Lost Raw Materials
      • 💡How to Create a Manufacturing Order
      • 💡How to Edit a Manufacturing Order
      • 💡How to Filter Manufacturing Orders
      • 💡How to Update a Manufacturing Order Status
      • 💡How to Delete a Manufacturing Order
    • Team Members
      • 💡How to Add Team Members
      • 💡How to Update a Team Member's Permissions
      • 💡How to Filter Team Members
      • 💡How to Remove a Team Member
      • 💡How to View Team Members' Action Logs
    • Damages & Loss
      • 💡How to Filter Damages & Loss
      • 💡How to Edit a Damaged or Lost Item
      • 💡How to Delete a Damaged or Lost Item
    • How to Access Keepup Store Version 2.0
  • âš¡API
    • Introduction
    • Sales
      • âš¡List Sales
      • âš¡Fetch Sale
      • âš¡Add Sale
      • âš¡Edit Sale
      • âš¡Update Balance
      • âš¡Cancel Sale
      • âš¡Refund Sale
    • Products
      • âš¡List Products
      • âš¡Fetch Product
      • âš¡Add Product
      • âš¡Edit Product
Powered by GitBook
On this page
  • Endpoint
  • Headers
  • Body Parameters
  • Sample Requests
  • Sample Response
  1. API
  2. Products

Add Product

This endpoint allows for the addition of a new product to the inventory, including uploading images, setting pricing, stock levels, and other details.

Endpoint

POST https://api.keepup.store/v2.0/products/add

Headers

Authorization: Bearer API_KEY

Body Parameters

product_name

string

yes

Name of the product. Example: "Widget A"

description

string

optional

Detailed description of the product. Uses sanitized content.

cost_price

float

optional

Cost price of the product. Must be a valid monetary amount. Example: 15.75

selling_price

float

yes

Selling price of the product. Must be a valid monetary amount. Example: 20.00

previous_price

float

optional

Previous selling price, if any. Must be a valid monetary amount. Example: 18.00

quantity

integer

yes

Available quantity of the product. Required if stock_limit is 'limited'. Example: 50

restock_level

integer

optional

Level at which the product should be restocked. Example: 10

stock_limit

string

yes

Whether stock is limited or unlimited. Accepts 'limited' or 'unlimited'.

show_on_storefront

string

optional

Whether to show the product on the storefront. Accepts 'yes' or 'no'. Default is 'no'.

featured_product

string

optional

Whether the product is featured. Accepts 'yes' or 'no'. Default is 'no'.

category

string

optional

Category of the product. Example: "Electronics"

tags

JSON

optional

Tags associated with the product, in JSON format. Example: ["Electronics", "Gadget"]

SKU

string

optional

Stock Keeping Unit, unique identifier for each product variant. Example: "SKU12345"

barcode

string

optional

Barcode of the product. Example: "0123456789012"

product_location

string

optional

Storage location of the product within the business. Example: "Aisle 3, Shelf 5"

Sample Requests

const axios = require('axios');

const productData = {
  business_id: 'bus123',
  product_name: 'Product A',
  description: 'High-quality gadget',
  cost_price: 15.75,
  selling_price: 20.00,
  quantity: 50,
  restock_level: 10,
  stock_limit: 'limited',
  show_on_storefront: 'yes',
  featured_product: 'no',
  category: 'Electronics',
  tags: JSON.stringify(["Electronics", "Gadget"]),
  SKU: 'SKU12345',
  barcode: '0123456789012',
  product_location: 'Aisle 3, Shelf 5',
  expirations: JSON.stringify([{
    batch_number: "batch123",
    expiration_date: "2024-12-31",
    alert_date: "2024-12-01"
  }]),
  primary_product_image_index: 0
};

const config = {
  method: 'post',
  url: 'https://api.keepup.store/v2.0/products/add',
  headers: {
    'Authorization': 'Bearer API_KEY',  // Replace YOUR_ACCESS_TOKEN with your actual access token
    'Content-Type': 'application/json'
  },
  data: JSON.stringify(productData)
};

axios(config)
.then(function (response) {
  console.log('Product added successfully:', response.data);
})
.catch(function (error) {
  console.error('Failed to add product:', error);
});
<?php
$curl = curl_init();

$filePath = '/path/to/file.jpg';
$cfile = new CURLFile($filePath, 'image/jpeg', 'file.jpg');

$postData = array(
    'product_name' => 'Widget A',
    'description' => 'High-quality gadget',
    'cost_price' => '15.75',
    'selling_price' => '20.00',
    'quantity' => '50',
    'restock_level' => '10',
    'show_on_storefront' => 'yes',
    'featured_product' => 'no',
    'category' => 'Electronics',
    'tags' => json_encode(["Electronics", "Gadget"]),
    'SKU' => 'SKU12345',
    'barcode' => '0123456789012',
    'product_location' => 'Aisle 3, Shelf 5',
    'expirations' => json_encode([{ "batch_number": "batch123", "expiration_date": "2024-12-31", "alert_date": "2024-12-01" }]),
);

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.keepup.store/v2.0/products/add',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $postData,
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer API_KEY' // Replace 'API_KEY' with your actual API key
  ),
));

$response = curl_exec($curl);

if ($response === false) {
    echo 'Curl error: ' . curl_error($curl);
}

curl_close($curl);
echo $response;

?>

import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder

m = MultipartEncoder(
    fields={
        'product_name': 'Widget A',
        'description': 'High-quality gadget',
        'cost_price': '15.75',
        'selling_price': '20.00',
        'quantity': '50',
        'restock_level': '10',
        'show_on_storefront': 'yes',
        'featured_product': 'no',
        'category': 'Electronics',
        'tags': json.dumps(["Electronics", "Gadget"]),
        'SKU': 'SKU12345',
        'barcode': '0123456789012',
        'product_location': 'Aisle 3, Shelf 5',
        'expirations': json.dumps([{"batch_number": "batch123", "expiration_date": "2024-12-31", "alert_date": "2024-12-01"}]),
        'primary_product_image_index': '0',
    }
)

response = requests.post('https://api.keepup.store/v2.0/products/add', 
                         data=m, 
                         headers={'Authorization': 'Bearer API_KEY', 'Content-Type': m.content_type})  # Replace YOUR_ACCESS_TOKEN with your actual access token

print(response.text)

Sample Response

{
    "status": 200,
    "message": "product added",
    "data": {
        "product_id": 19845
    }
}
{
    "status": 401,
    "error": "Authentication invalid"
}
PreviousFetch ProductNextEdit Product

Last updated 8 months ago

âš¡
âš¡