SalesMania
  1. Orders
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. Orders

Add new order

Developing
POST
/extapi/v1.0/orders
Menambahkan order baru untuk tanggal, customer dan team yang tercantum di parameter. Lengkap dengan item-item yang di-order.

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
date
string <date>
required
Example:
2024-01-01
customer_id
integer 
required
team_id
integer 
optional
If omitted, will create visit for the current API user team
description
string 
optional
ordered_products
array [object {8}] 
required
product_id
integer 
required
qty
number 
required
unit
string 
required
Example:
PCS
price
number 
required
item_disc_percent
string 
optional
Optional: either this or item_disc_amount
Examples:
55.05+3
item_disc_amount
number 
optional
Optional: either this or item_disc_percent
description
string 
optional
ext_order_line_id
integer 
optional
Your order line id as reference
disc_percent
string 
optional
Optional: either this or disc_amount
Examples:
55.05+3
disc_amount
number 
optional
Optional: either this or disc_percent
total_paid
number 
optional
Total of payments already made for this order
status
enum<string> 
optional
Optional: if omitted, default to 'Baru'
Allowed values:
BaruDiprosesTerkirimLunasBatal
visit_status
string 
optional
Optional: if omitted, default to first Visit Status with type Order
Example:
Order
ext_order_no
string 
optional
Your internal order number
ext_order_status_name
string 
optional
Your internal order status
Example
{
    "date": "2024-01-01",
    "customer_id": 0,
    "team_id": 0,
    "description": "string",
    "ordered_products": [
        {
            "product_id": 0,
            "qty": 0,
            "unit": "PCS",
            "price": 0,
            "item_disc_percent": "5",
            "item_disc_amount": 0,
            "description": "string",
            "ext_order_line_id": 0
        }
    ],
    "disc_percent": "5",
    "disc_amount": 0,
    "total_paid": 0,
    "status": "Baru",
    "visit_status": "Order",
    "ext_order_no": "string",
    "ext_order_status_name": "string"
}

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/orders?team_token=eyJkYl9pZCI6Mjk4MSwidGVhbV9pZCI6MjQ3Mjh9.LpZ9LEpy123lwzYjzypStjdk123' \
--header 'Content-Type: application/json' \
--data-raw '{
    "date": "2024-01-01",
    "customer_id": 0,
    "team_id": 0,
    "description": "string",
    "ordered_products": [
        {
            "product_id": 0,
            "qty": 0,
            "unit": "PCS",
            "price": 0,
            "item_disc_percent": "5",
            "item_disc_amount": 0,
            "description": "string",
            "ext_order_line_id": 0
        }
    ],
    "disc_percent": "5",
    "disc_amount": 0,
    "total_paid": 0,
    "status": "Baru",
    "visit_status": "Order",
    "ext_order_no": "string",
    "ext_order_status_name": "string"
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2024-12-19 09:36:24
Previous
Add new visit
Next
Get order by ID
Built with