Projects/Integration SabilaMall.co.id

From InfiniteERP Wiki
Jump to: navigation, search

Introduction

SM adalah lokal market place yang merupakan salah satu distributor di PT Rahmat Untuk Semua.
Integrasi ini akan menggunakan API untuk komunikasi antar sistem.

Web Services API

API main URL :

https://HOST/infinite/org.openbravo.service.json.jsonrest/END_POINT

Parameter umum penggunaan API yang tersedia:

Parameter Name Description
_org organization ID
_noCount count only
_onlyCount
_filter
_startRow mengambil jumlah baris record start (parameter wajib untuk setiap akses endpoint)
_endRow mengambil jumlah baris record akhir (parameter wajib untuk setiap akses endpoint)
_sortBy melakukan sorting berdasarkan field tertentu
_selectedProperties untuk menentukan field apa saja yang akan diquery, untuk melihat nama field tersedia, cukup lakukan GET tanpa parameter dan semua field akan tampil by default.
_where melakukan filter data untuk field tertentu, contoh: _where=currency.iSOCode='USD
https://HOST/infinite/org.openbravo.service.json.jsonrest/Country?_where=currency.iSOCode='USD
akan menghasilkan data nama negara yang memiliki mata uang USD

Cara menggunakan parameter:

http://HOST/infinite/org.openbravo.service.json.jsonrest/BusinessPartner?_startRow=10&_endRow=50&_sortBy=name&_selectedProperties=id,searchKey,name,description



JSON REST API yang bisa digunakan untuk integrasi ini:

API Name End Point Description
Sales Order /Order Sales Order Header adalah informasi transaksi penjualan terkait Pelanggan sebagai pembeli produk
Sales Order Line /OrderLine Sales Order Line, dapat berisi lebih dari satu record data product yang dibeli oleh pelanggan
Product /Product
Example Example Example
Example Example Example

Sales Order

Create Header

Contoh formas JSON untuk POST/PUT

{
    "data": [
        {
            "_entityName": "Order",
            "documentType": "0",
            "transactionDocument": "5645CA0F00874F1D92502738D06B3BA7",
            "businessPartner": "1DF416E52D30419CBAF6C13C8DD27B95",
            "partnerAddress": "80537B71C48742219669AF2EEA18DEE7",
            "invoiceAddress": "80537B71C48742219669AF2EEA18DEE7",
            "priceList": "C8E96B73984E402285D8B0CFF856420C",
            "documentNo": "TEST-POSTMAN-003",
            "documentStatus": "DR",
            "salesTransaction": "true",
            "active": "true",
            "delivered": "false",
            "scheduledDeliveryDate": "2022-02-02",
            "orderDate": "2022-02-02",
            "accountingDate": "2022-02-02",
            "currency": "303",
            "formOfPayment": "P",
            "paymentMethod": "DACDC69551CF403D9ADBD00F63F8219F",
            "paymentTerms": "27BD0BB9FBBA4E5E86F978933FD7F6DC",
            "invoiceTerms": "I",
            "organization": "7F844AE4060B41CDB7E943F75B76F4B2",
            "warehouse": "69B6CC4F386A4BEC93906C53C16C16E5",
            "deliveryMethod": "S",
            "shippingCompany": "984C01BD749B4C09B618021EB6A5A618",
            "description": "test dari postman"
        }
    ]
}

Create Lines

Contoh JSON untuk POST/PUT dengan 2 product

{
    "data": [
        {
            "_entityName": "OrderLine",
            "organization": "7F844AE4060B41CDB7E943F75B76F4B2",
            "salesOrder": "ABBA15BDB60848F99D31307677826CBE",
            "lineNo": 10,
            "product": "2782ECBAAD57441D9E27CB447048E9EE",
            "orderedQuantity": 2,
            "uOM": "E4D60A0ECD0E4BAA902D9A844327B46D",
            "unitPrice":90000,
            "priceLimit": 100000,
            "listPrice":100000,
            "discount": 10000,
            "lineNetAmount": 0,
            "currency": "303",
            "orderDate": "2022-05-28",
            "scheduledDeliveryDate": "2022-05-28",
            "tax": "F0EBB5B87F484A8298CE62FF87678DF8",
            "warehouse": "69B6CC4F386A4BEC93906C53C16C16E5",
            "description": "test dari postman"
        },
            {
            "_entityName": "OrderLine",
            "organization": "7F844AE4060B41CDB7E943F75B76F4B2",
            "salesOrder": "ABBA15BDB60848F99D31307677826CBE",
            "lineNo": 99,
            "product": "7BA4B0FE132B420DB3222D53F61DEF3F",
            "orderedQuantity": 1,
            "uOM": "E4D60A0ECD0E4BAA902D9A844327B46D",
            "unitPrice":200000,
            "priceLimit": 200000,
            "listPrice":200000,
            "discount": 0,
            "lineNetAmount": 0,
            "currency": "303",
            "orderDate": "2022-05-28",
            "scheduledDeliveryDate": "2022-05-28",
            "tax": "F0EBB5B87F484A8298CE62FF87678DF8",
            "warehouse": "69B6CC4F386A4BEC93906C53C16C16E5",
            "description": "test insert ONGKIR"
        }
    ]
}

Contoh Document Approval Sales Order

Contoh penggunaan Document Approval API untuk merubah Document Status di window Sales Order dapat dilihat pada link berikut:

Document Approval API for Sales Order(Sample)

Stock by Storage Bin

Error Result

Jika terjadi error, API akan memberikan standard HTTP ERROR code

HTTP Error Codes

The following HTTP error codes are used to flag different error situations:

  • 400: the request uri or parameters are incorrect, for example the request uri did not have a valid entity name.
  • 409: the JSON content is invalid
  • 404: the object could not be found (applies when a uri points to a single object and that single object can not be found
  • 401: if a security exception occurs
  • 500: is used for all other exceptions

Contoh situasi umum ketika error terjadi dapat dilihat disini

Integration Scenario

User Story: SM push order to ERP

  1. Pembeli melakukan Check Out di SM
  2. Pembeli menyelesaikan pembayaran
  3. SM membuat Sales Order Header di ERP dan mendapatkan response Order ID jika sukses terbentuk. Order ID ini akan digunakan selanjutnya untuk membuat Order Lines
  4. SM membuat Order Lines satu per satu atau sekaligus. SM akan mendapatkan response berupa Order Line ID jika sukses.
    1. Kode Unik, Diskon dan Ongkir juga dimasukkan ke Order Line di ERP. Product ID untuk ketiganya dapat berbeda di environment DEV dan LIVE
  5. Setelah data order terbentuk sukses di ERP, SM memanggil endpoint Document Approval untuk merubah Document Status menjadi COMPLETED sebagai tanda bagi user ERP untuk memproses pengiriman.
    1. Contoh Document Approval : Document Approval API for Sales Order(Sample)

User Story: ERP push Goods Shipment to SM

User Story: ERP push product baru ke SM

User Story: ERP push stock ke SM

Meeting Agreement

Minutes Of Meeting

Meeting Kamis, 19 Mei 2022

Integrasi

  • SM push order baru ke ERP secara realtime.
  • Order dari SM memiliki beberapa status:
    • Booking
    • Terbayar
    • Cancel
  • ERP push Goods Shipment ke SM
    • Cetak Shipment Label dilakukan langsung dari ERP menggunakan ukuran label yang ada saat ini dengan beberapa modifikasi berikut:
    • Penambahan Kode Booking dan Resi berbentuk barcode
    • Penambahan Product SKU dan Jumlah ( saat ini sudah dibuat )
    • Tulisan Disclaimer dibagian bawah "pembeli membuat video unboxing"
  • ERP push product baru ke SM
    • Product baru yang push ke SM harus di setup and assigned ke BP Sabila Mall
    • SM akan menyediakan kolom untuk menampung Product ID dari ERP yang memiliki Lenght 32 digit (data berupa UUID)
  • ERP push stock ke SM.
    • Stock yang dikirim stock onhand setelah dikurangi stock di PACKING AREA

Struktur data order dari SM:

Header

  • Pembeli
    • Nama
    • Nomor Kontak
    • Alamat | Kelurahan | Kecamatan | Kota | Propinsi | Kode Pos
  • Agen
    • Nama Agen | Alamat | Nomor Kontak
  • Ekspedisi
    • Nama Ekpedisi | Kode Booking (jika ada)

Line

  • Product SKU | Jumlah | Harga
  • Ongkos Kirim: Nilai ongkos kirim bagian dari Order Line

Glossary

  • SM = SabilaMall.co.id
  • ERP = Software ERP yang digunakan oleh PT RAHMAT UNTUK SEMUA (RAHNEM)
  • BP = Business Partner, istilah master data Customer/Vendor di ERP

End