SalesMania
  1. Products
SalesMania
  • Authentication & Select Database
    • Get bearer token from Basic Auth
      GET
    • Get list of databases
      GET
    • Get team token for a selected database
      GET
  • Customers
    • Get customers
      GET
    • Add new customer
      POST
    • Get customer by ID
      GET
    • Update customer by ID
      PATCH
    • Delete customer by ID
      DELETE
  • Products
    • Get products
      GET
    • Add new product
      POST
    • Get product by ID
      GET
    • Update product by ID
      PATCH
    • Delete product by ID
      DELETE
  • Visits
    • Get visits
      GET
    • Add new visit
      POST
  • Orders
    • Add new order
      POST
    • Get order by ID
      GET
    • Update order by ID
      PATCH
  • Team
    • Get teams
      GET
  1. Products

Add new product

POST
/extapi/v1.0/products
Menambahkan produk baru ke database SalesMania.
API ini membutuhkan team_token sebagai parameter dan Bearer Token sebagai authentification.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Query Params
team_token
string 
required
Team token from api /extapi/v1.0/team_token
Example:
eyJkYl9pZCI6Mjk4MSwidGVhbV9pZCI6MjQ3Mjh9.LpZ9LEpy123lwzYjzypStjdk123
Body Params application/json
name
string 
required
<= 200 characters
description
string 
optional
sku
string 
optional
tags
array[string]
optional
status
boolean 
optional
status, default: true (active)
ext_product_code
string 
optional
Your internal product code
default_disc
string 
optional
Examples:
55.55+3
qty_on_hand
number 
required
product_units
array [object {3}] 
required
At least one product_unit with ratio = 1 is expected
name
string 
required
<= 50 characters
price
number 
required
ratio
integer 
required
>= 1
Example
{
    "name": "string",
    "description": "string",
    "sku": "string",
    "tags": [
        "string"
    ],
    "status": true,
    "ext_product_code": "string",
    "default_disc": "5",
    "qty_on_hand": 0,
    "product_units": [
        {
            "name": "string",
            "price": 0,
            "ratio": 1
        }
    ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.salesmania.id/extapi/v1.0/products?team_token=eyJkYl9pZCI6Mjk4MSwidGVhbV9pZCI6MjQ3Mjh9.LpZ9LEpy123lwzYjzypStjdk123' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "string",
    "description": "string",
    "sku": "string",
    "tags": [
        "string"
    ],
    "status": true,
    "ext_product_code": "string",
    "default_disc": "5",
    "qty_on_hand": 0,
    "product_units": [
        {
            "name": "string",
            "price": 0,
            "ratio": 1
        }
    ]
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2024-11-01 09:57:18
Previous
Get products
Next
Get product by ID
Built with