API Sales Order

From InfiniteERP Wiki
Revision as of 07:08, 3 February 2022 by Wikiadmin (talk | contribs)
Jump to: navigation, search

Introduction

Panduan menggunakan API Sales Order.


Sales Order Header

GET Sales Order Header API

https://HOST/infinite/org.openbravo.service.json.jsonrest/Order?_where=documentNo='TEST-WEBSTORE-001'

Contoh response data dari Query di atas klik di sini

POST Sales Order Header API

URL:

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

JSON format:

{
    "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"
        }
    ]
}

Daftar field wajid yang tidak boleh kosong ketika INSERT data:

Field Name Mandatory Type Value WEBSTORE Field Name
client Yes varchar(32) set default value to 0866093A2EEE4EE88399C8CE4E664858
organization Yes varchar(32) set default to 7F844AE4060B41CDB7E943F75B76F4B2
active Yes char(1) defaulted to "true"
businessPartner Yes varchar(32) set default to Webstore ID "1DF416E52D30419CBAF6C13C8DD27B95"
salesTransaction Yes char(2) defaulted to "true"
documentNo Yes varchar(32) nomor sales order
documentType Yes varchar(32) Tipe POS Order; Defaulted to "0"
documentStatus Yes char(2) set default to "DR" for testing only, for PRD will be informed later
partnerAddress Yes varchar(32) Defaulted to "80537B71C48742219669AF2EEA18DEE7"
orderReference Optional varchar(32) bebas di isi sebagai referensi
paymentTerms Yes varchar(32) Defaulted to "27BD0BB9FBBA4E5E86F978933FD7F6DC" (Cash Before Delivery)
priceList Yes varchar(32) Defaulted to "C8E96B73984E402285D8B0CFF856420C"
paymentMethod Yes varchar(32) Defaulted to "DACDC69551CF403D9ADBD00F63F8219F"
orderDate Yes Date sample "2022-02-02"
scheduledDeliveryDate Yes Date sample "2022-02-02"
accountingDate Yes Date sample "2022-02-02"
currency Yes varchar(32) Defaulted to "303" for IDR, mata uang hanya IDR Rupiah
creationDate Yes DateTime sample "2022-02-02T07:38:24+07:00"
createdBy Yes varchar(32) Defaulted to "92A2C4122CA0439984A4749910105FDE"
updated Yes DateTime sample "2022-02-02T07:38:24+07:00"
updatedBy Yes varchar(32) Defaulted to "92A2C4122CA0439984A4749910105FDE"
documentAction Yes varchar(2) defaulted to "CO"
processed Yes char(1) defaulted to "false"
invoiceTerms Yes varchar(32) defaulted to "I"
invoiceAddress Yes varchar(32) defaulted to "80537B71C48742219669AF2EEA18DEE7"
deliveryTerms Yes varchar(32) defaulted to "A"
freightCostRule Yes varchar(32) defaulted to "I"
deliveryMethod Yes varchar(32) defaulted to "S"
warehouse Yes varchar(32) defaulted to warehouse id "69B6CC4F386A4BEC93906C53C16C16E5" for S1-SRENGSENG
transactionDocument Yes varchar(32) defaulted to "5645CA0F00874F1D92502738D06B3BA7"
shippingCompany Yes varchar(32) di isi dengan ID Ekspedisi, contoh untuk JNE "984C01BD749B4C09B618021EB6A5A618", refer to this list Daftar ID Ekspedisi
deliveryNotes Yes varchar(255) Alamat kirim tujuan bisa disimpan di sini
description Yes varchar(255) Informasi Pembeli dari Webstore bisa disimpan di sini

Screen Reference

Sales Order Header

Yasmeera-westore-header1.png

Complete Sales Order

Yasmeera-westore-order1.png

Sales Order Line

GET Sales Order Line


Notes: Please always specify pagination filter with _startRow=0&_endRow=50& parameter

https://HOST/infinite/org.openbravo.service.json.jsonrest/OrderLine?_startRow=0&_endRow=50&_where=salesOrder='0E8FEF9276C04CDDA88053EF8C9432A5'

Contoh response data dari Query di atas klik di sini

POST Sales Order Line

URL:

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

Jika POST success maka response status seperti berikut akan diterima:

{
    "response": {
        "status": 0,
        "data": [
        .............. truncated text

JSON format:

{
    "data": [
        {
            "_entityName": "OrderLine",
            "organization": "7F844AE4060B41CDB7E943F75B76F4B2",
            "salesOrder": "0E8FEF9276C04CDDA88053EF8C9432A5",
            "businessPartner": "1DF416E52D30419CBAF6C13C8DD27B95",
            "partnerAddress": "80537B71C48742219669AF2EEA18DEE7",
            "lineNo": 90,
            "product": "A7E42D4501F14215A7EC9A1BCDADC780",
            "orderedQuantity": 2,
            "uOM": "E4D60A0ECD0E4BAA902D9A844327B46D",
            "unitPrice": 1000,
            "priceLimit": 1000000,
            "listPrice":1000000,
            "discount": 0,
            "lineNetAmount": 0,
            "currency": "303",
            "orderDate": "2022-02-02",
            "scheduledDeliveryDate": "2022-02-02",
            "tax": "F0EBB5B87F484A8298CE62FF87678DF8",
            "warehouse": "69B6CC4F386A4BEC93906C53C16C16E5",
            "description": "test dari postman"
        }
    ]
}

Daftar field mandatory:

Field Name Mandatory Type Remark
_entityName Yes varchar(32) nama object entity model, gunakan "OrderLine"
organization Yes varchar(32) set default to 7F844AE4060B41CDB7E943F75B76F4B2
lineNo Yes numeric nomor urut line pada sales order
salesOrder Yes varchar(32) Sales Order Header ID
businessPartner Yes varchar(32) defaulted to "1DF416E52D30419CBAF6C13C8DD27B95"
partnerAddress Yes varchar(32) defaulted to "80537B71C48742219669AF2EEA18DEE7"
product Yes varchar(32) kode product ID
orderedQuantity Yes numeric jumlah quantity yang dibeli pelanggan
uOM Yes numeric defaulted to "E4D60A0ECD0E4BAA902D9A844327B46D" for "PCS"
unitPrice Yes numeric harga jual nett ke pelanggan
priceLimit Yes numeric
listPrice Yes numeric
discount Yes numeric
lineNetAmount No numeric ERP akan menghitung otomatis meskipun tidak di isi yaitu orderedQuantity X unitPrice
currency Yes varchar(32) defaulted to "303" for IDR
orderDate Yes Date disamakan dengan tanggal pada Order Header
scheduledDeliveryDate Yes Date disamakan dengan tanggal pada Order Header
tax Yes varchar(32) defaulted to "F0EBB5B87F484A8298CE62FF87678DF8" for NON TAX
warehouse Yes varchar(32) Warehouse ID

Screen Reference

Sales Order Lines Details

Yasmeera-westore-line-detail-1.png

Shipping Company (Ekspedisi)

GET the list of Shipping Company

URL:

https://HOST/infinite/org.openbravo.service.json.jsonrest/ShippingShippingCompany?_where=client='0866093A2EEE4EE88399C8CE4E664858'

Daftar Ekspedisi

Daftar ini mungkin akan berubah sesuai kebutuhan dan dapat di akses dengan API berikut:

https://HOST/infinite/org.openbravo.service.json.jsonrest/ShippingShippingCompany?_where=client='0866093A2EEE4EE88399C8CE4E664858'
Name ID
BARAKA E162D7C547DF45ADABB9F1C9E6313DFD
JNE 984C01BD749B4C09B618021EB6A5A618
SICEPAT EFDAC9B812BF4C399A18DAAB24351037
SAJIRA B5F1003E587E4A9FAF01539D877EC6AC
LION PARCEL 7E2EBE2037AA4552B85D6340163000F8

Daftar Ekspedisi ( Shipping Company )
Yasmeera-shipping-company.png