Billing - up1/soa_group2 GitHub Wiki

Get a list of purchase orders.

Request Format

GET /purchaseorder

Header

  • Accept : "application/json"

Response Format

Header

  • content-type: "application/json"
  • status: 200

Body

[
    {
        "id" : "1",
        "buyer" : "supphawit",
        "totalPrice" : "70000",
        "buyDate" : "123213231",
        "paidDate" : "123213231",
        "payScheduled" : "123299631",
        "buyProducts" : [
            {
                "id" : "213",
                "name" : "Iphone 7 Plus 64 GB",
                "detail" : "Lastest Apple's Product. I just use it for 7 days",
                "price" : "30000",
                "amount" : "1",
                "owner" : "kanathips",
                "saleDate" : "123213231",
                "editDate" : "123123123",
                "category" : {"current" : "Smart Phone", "parent" : ["IT"] }
            },
            {
                "id" : "214",
                "name" : "Iphone 8 Plus 128 GB",
                "detail" : "Lastest Apple's Product. I just use it for 7 days",
                "price" : "40000",
                "amount" : "1",
                "owner" : "kanathips",
                "saleDate" : "123213231",
                "editDate" : "123123123",
                "category" : { "current" : "Smart Phone", "parent" : ["IT"] }
            } 
        ],
        "deliveryAddress" : "87 หมู่ 10 ตำบลนครปฐม อำเภอเมือง จังหวัด นครปฐม 73000",
        "payStatus" : 1,
        "tel" : "0832926881",
        "email" : "[email protected]"
    },
    {
        "id" : "2",
        "buyer" : "supphawit",
        "totalPrice" : "70000",
        "buyDate" : "123299631",
        "paidDate" : "123299631",
        "payScheduled" : "123811200",
        "buyProducts" : [
            {
                "id" : "214",
                "name" : "Iphone 8 Plus 128 GB",
                "detail" : "Lastest Apple's Product. I just use it for 7 days",
                "price" : "40000",
                "amount" : "1",
                "owner" : "kanathips",
                "saleDate" : "123213231",
                "editDate" : "123123123",
                "category" : { "current" : "Smart Phone", "parent" : ["IT"] }
            } 
        ],
        "deliveryAddress" : "87 หมู่ 10 ตำบลนครปฐม อำเภอเมือง จังหวัด นครปฐม 73000",
        "payStatus" : 1,
        "tel" : "0832926881",
        "email" : "[email protected]"
    }

]

Get a selected purchase order's information

Request Format

GET /purchaseorder/{id}

Header

  • Accept: "application/json

Response Format

Header

  • Content-type: "application/json"
  • Status: 200

Body

{
    "id" : "2",
    "buyer" : "supphawit",
    "totalPrice" : "40000",
    "buyDate" : "123299631",
    "paidDate" : "123299631",
    "payScheduled" : "123811200",
    "buyProducts" : [
        {
            "id" : "214",
            "name" : "Iphone 8 Plus 128 GB",
            "detail" : "Lastest Apple's Product. I just use it for 7 days",
            "price" : "40000",
            "amount" : "1",
            "owner" : "kanathips",
            "saleDate" : "123213231",
            "editDate" : "123123123",
            "category" : { "current" : "Smart Phone", "parent" : ["IT"] }
        } 
    ],
    "deliveryAddress" : "87 หมู่ 10 ตำบลนครปฐม อำเภอเมือง จังหวัด นครปฐม 73000",
    "payStatus" : 0,
    "tel" : "0832926881",
    "email" : "[email protected]"
}

Update a selected purchase order

Request Format

PUT /purchaseorder/{id}

Header

  • Content-type: "application/json"

Body

{
    "totalPrice" : "80000",
    "buyProducts" : 
    [
        {
            "id" : "214",
            "name" : "Iphone 8 Plus 128 GB",
            "detail" : "Lastest Apple's Product. I just use it for 7 days",
            "price" : "40000",
            "amount" : "2",
            "owner" : "kanathips",
            "saleDate" : "123213231",
            "editDate" : "123123123",
            "category" : { "current" : "Smart Phone", "parent" : ["IT"] }
        } 
    ],
    "deliveryAddress" : "40/63 หมู่ 5 แขวงกระทุ่มราย เขตหนองจอก กทม. 10530",
    "tel" : "0951140289",
    "email" : "[email protected]"
}

Response Format

Header

  • Content-type: "text/plain; charset=utf-8"
  • Status: 200

Body

// Purchase order's id
2

Cancel a selected purchase order

Request Format

PATCH /purchaseorder/{id}/cancel

Header

  • Accpet: "text/plain; charset=utf-8"

Response Format

Header

  • Content-type: "text/plain; charset=utf-8"
  • Status: 200

Body

// Purchase order's id
2

Create new a purchase order from a given cart

Request Format

POST /purchaseorder

Header

  • Content-type: "application/json"

Body

{
    "buyer" : "salinee",
    "buyProducts" : [
        {
            "id" : "213",
            "name" : "Iphone 7 Plus 64 GB",
            "detail" : "Lastest Apple's Product. I just use it for 7 days",
            "price" : "30000",
            "amount" : "1",
            "owner" : "kanathips",
            "saleDate" : "123213231",
            "editDate" : "123123123",
            "category" : {"current" : "Smart Phone", "parent" : ["IT"] }
        },
    ],
    "deliveryAddress" : "40/63 หมู่ 5 แขวงกระทุ่มราย เขตหนองจอก กทม. 10530",
    "tel" : "0949582504",
    "email" : "[email protected]"
}

Response Format

Header

  • Content-type: "text/plain; charset=utf-8"
  • Status: 201

Body

// Purchase order's id
3

Get list of non-pays purchase order

Request Format

GET /payslip/unpaid

Header

  • Accept: "application/json"

Response Format

Header

  • Content-type: "application/json"
  • Status: 200

Body

[
    {
        "id": 3,
        "buyer": "kanathip",
        "buyDate" : "1491233159 ",
        "paidDate" : null,
        "totalPrice" : "80000",
        "buyProducts" : 
        [
            {
                "id" : "214",
                "name" : "Iphone 8 Plus 128 GB",
                "detail" : "Lastest Apple's Product. I just use it for 7 days",
                "price" : "40000",
                "amount" : "2",
                "owner" : "kanathips",
                "saleDate" : "123213231",
                "editDate" : "123123123",
                "category" : { "current" : "Smart Phone", "parent" : ["IT"] }
            } 
        ],
        "deliveryAddress" : "40/63 หมู่ 5 แขวงกระทุ่มราย เขตหนองจอก กทม. 10530",
        "payStatus" : 0,
        "tel" : "0951140289",
        "email" : "[email protected]"
    }
]

Get list of paid pays slip

Request Format

GET /payslip/paid

Header

  • `Accept: "application/json"

Response Format

Header

  • Content-type: "application/json"
  • Status: 200

Body

[
    {
        "id" : "1",
        "buyer" : "supphawit",
        "totalPrice" : "70000",
        "buyDate" : "123213231",
        "paidDate" : "123213231",
        "payScheduled" : "123299631",
        "buyProducts" : [
            {
                "id" : "213",
                "name" : "Iphone 7 Plus 64 GB",
                "detail" : "Lastest Apple's Product. I just use it for 7 days",
                "price" : "30000",
                "amount" : "1",
                "owner" : "kanathips",
                "saleDate" : "123213231",
                "editDate" : "123123123",
                "category" : {"current" : "Smart Phone", "parent" : ["IT"] }
            },
            {
                "id" : "214",
                "name" : "Iphone 8 Plus 128 GB",
                "detail" : "Lastest Apple's Product. I just use it for 7 days",
                "price" : "40000",
                "amount" : "1",
                "owner" : "kanathips",
                "saleDate" : "123213231",
                "editDate" : "123123123",
                "category" : { "current" : "Smart Phone", "parent" : ["IT"] }
            } 
        ],
        "deliveryAddress" : "87 หมู่ 10 ตำบลนครปฐม อำเภอเมือง จังหวัด นครปฐม 73000",
        "payStatus" : 1,
        "tel" : "0832926881",
        "email" : "[email protected]"
    },
    {
        "id" : "2",
        "buyer" : "supphawit",
        "totalPrice" : "70000",
        "buyDate" : "123299631",
        "paidDate" : "123299631",
        "payScheduled" : "123811200",
        "buyProducts" : [
            {
                "id" : "214",
                "name" : "Iphone 8 Plus 128 GB",
                "detail" : "Lastest Apple's Product. I just use it for 7 days",
                "price" : "40000",
                "amount" : "1",
                "owner" : "kanathips",
                "saleDate" : "123213231",
                "editDate" : "123123123",
                "category" : { "current" : "Smart Phone", "parent" : ["IT"] }
            } 
        ],
        "deliveryAddress" : "87 หมู่ 10 ตำบลนครปฐม อำเภอเมือง จังหวัด นครปฐม 73000",
        "payStatus" : 1,
        "tel" : "0832926881",
        "email" : "[email protected]"
    }

]

Get a list of pay slip that out of time

Request Format

GET /payslip/outoftime

Header

  • Accept: "application/json

Response Format

Header

  • Content-type: "application/json"
  • Status: 200

Body

[
    {
        "id": 3,
        "buyer": "kanathip",
        "buyDate" : "1491233159 ",
        "paidDate" : null,
        "totalPrice" : "80000",
        "buyProducts" : 
        [
            {
                "id" : "214",
                "name" : "Iphone 8 Plus 128 GB",
                "detail" : "Lastest Apple's Product. I just use it for 7 days",
                "price" : "40000",
                "amount" : "2",
                "owner" : "kanathips",
                "saleDate" : "123213231",
                "editDate" : "123123123",
                "category" : { "current" : "Smart Phone", "parent" : ["IT"] }
            } 
        ],
        "deliveryAddress" : "40/63 หมู่ 5 แขวงกระทุ่มราย เขตหนองจอก กทม. 10530",
        "payStatus" : 2,
        "tel" : "0951140289",
        "email" : "[email protected]"
    },
]

Get pay slip file

Request Format

GET /payslip/{poNumber}

Header

Response Format

Header

  • Content-type: "application/pdf"
  • Status: 200

body

Pay Slip PDF

Paid the pay slip

Request Format

PATCH /payslip/paid/{poNumber}

Header

  • Accpet: "text/plain; charset=utf-8"

Response Format

Header

  • Content-type: "text/plain; charset=utf-8"
  • Status: 200

body

// Purchase order's id
3