1. Autoschedules
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
  • Autoschedules
    • Get autoschedules
      GET
    • Add autoschedule(s)
      POST
    • Get autoschedule by ID
      GET
    • Update autoschedule by ID
      PATCH
    • Delete autoschedule by ID
      DELETE
    • Get autoschedules of a team
      GET
    • Replace autoschedules of a team
      PUT
    • Get autoschedules of a customer
      GET
    • Replace autoschedules of a customer
      PUT
  • Schemas
    • Customer
    • Product
    • Ext Order
    • Webhook External Order
    • Autoschedule
    • Autoschedule Input
    • Error
  1. Autoschedules

Replace autoschedules of a customer

PUT
/extapi/v1.0/customers/{id}/autoschedules
Mengganti seluruh daftar autoschedule customer ini dengan isi body (array). Jadwal yang sama persis (customer, team, frequency, hari/tanggal, week_offset) dengan salah satu item tetap dipertahankan beserta id-nya; item yang belum ada dibuat; jadwal lain customer ini dihapus. Array kosong menghapus semuanya. Semua atau tidak sama sekali: bila ada item tidak valid, tidak ada yang disimpan dan result.errors berisi {index, reason}.
ordering yang tidak diisi: jadwal lama tetap pada urutannya, jadwal baru ditaruh paling akhir.
Jangan isi customer_id / ext_cust_no di item (customer diambil dari URL). team_id bila tidak diisi = team dari team token.
API ini membutuhkan team_token sebagai parameter dan Bearer Token sebagai authentification.

Request

Authorization
or
Path Params

Query Params

Body Params application/json

Example
[
    {
        "customer_id": 123456,
        "team_id": 24728,
        "frequency": "every_3_weeks",
        "day_of_week": "wed",
        "week_offset": 0
    }
]

Request Code 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 PUT 'https://api.salesmania.id/extapi/v1.0/customers//autoschedules?team_token=eyJkYl9pZCI6Mjk4MSwidGVhbV9pZCI6MjQ3Mjh9.LpZ9LEpy123lwzYjzypStjdk123' \
--header 'Content-Type: application/json' \
--data '[
    {
        "customer_id": 123456,
        "team_id": 24728,
        "frequency": "every_3_weeks",
        "day_of_week": "wed",
        "week_offset": 0
    }
]'

Responses

🟢200
application/json
Bodyapplication/json

Example
{
    "result": {
        "autoschedules": [
            {
                "id": 0,
                "customer": {
                    "id": 0,
                    "name": "string",
                    "ext_cust_no": "string"
                },
                "team": {
                    "id": 0,
                    "name": "string"
                },
                "frequency": "weekly",
                "day_of_week": "mon",
                "day_of_month": 1,
                "week_offset": 0,
                "ordering": 0,
                "summary": "Wednesday every 3 weeks, week_offset 1",
                "next_dates": [
                    "2026-11-18",
                    "2026-12-09",
                    "2026-12-30"
                ]
            }
        ],
        "created": 0,
        "updated": 0,
        "unchanged": 0,
        "deleted": 0
    },
    "status": "SUCCESS",
    "status_code": 1
}
🟠400
🟠401
🟠403
🟠404
Modified at 2026-11-03 04:12:15
Previous
Get autoschedules of a customer
Next
Customer
Built with