정산 생성
curl --request POST \
--url https://openapi.pluuug.com/v1/settlement \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Signature: <api-key>' \
--data '
{
"title": "<string>",
"amount": 1,
"additionalAmount": 1,
"vat": 1,
"contract": {
"id": 123
},
"type": {
"id": 123
},
"settlementRound": 2,
"dueDate": "2023-12-25",
"settledDate": "2023-12-25",
"isTaxInvoiceIssued": false,
"isTaxInvoiceNeeded": false,
"taxInvoiceIssuedDate": "2023-12-25",
"taxInvoiceIssueDueDate": "2023-12-25",
"inChargeSet": [
{
"id": 123
}
]
}
'import requests
url = "https://openapi.pluuug.com/v1/settlement"
payload = {
"title": "<string>",
"amount": 1,
"additionalAmount": 1,
"vat": 1,
"contract": { "id": 123 },
"type": { "id": 123 },
"settlementRound": 2,
"dueDate": "2023-12-25",
"settledDate": "2023-12-25",
"isTaxInvoiceIssued": False,
"isTaxInvoiceNeeded": False,
"taxInvoiceIssuedDate": "2023-12-25",
"taxInvoiceIssueDueDate": "2023-12-25",
"inChargeSet": [{ "id": 123 }]
}
headers = {
"X-API-Key": "<api-key>",
"X-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Key': '<api-key>',
'X-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: '<string>',
amount: 1,
additionalAmount: 1,
vat: 1,
contract: {id: 123},
type: {id: 123},
settlementRound: 2,
dueDate: '2023-12-25',
settledDate: '2023-12-25',
isTaxInvoiceIssued: false,
isTaxInvoiceNeeded: false,
taxInvoiceIssuedDate: '2023-12-25',
taxInvoiceIssueDueDate: '2023-12-25',
inChargeSet: [{id: 123}]
})
};
fetch('https://openapi.pluuug.com/v1/settlement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.pluuug.com/v1/settlement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'amount' => 1,
'additionalAmount' => 1,
'vat' => 1,
'contract' => [
'id' => 123
],
'type' => [
'id' => 123
],
'settlementRound' => 2,
'dueDate' => '2023-12-25',
'settledDate' => '2023-12-25',
'isTaxInvoiceIssued' => false,
'isTaxInvoiceNeeded' => false,
'taxInvoiceIssuedDate' => '2023-12-25',
'taxInvoiceIssueDueDate' => '2023-12-25',
'inChargeSet' => [
[
'id' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.pluuug.com/v1/settlement"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"amount\": 1,\n \"additionalAmount\": 1,\n \"vat\": 1,\n \"contract\": {\n \"id\": 123\n },\n \"type\": {\n \"id\": 123\n },\n \"settlementRound\": 2,\n \"dueDate\": \"2023-12-25\",\n \"settledDate\": \"2023-12-25\",\n \"isTaxInvoiceIssued\": false,\n \"isTaxInvoiceNeeded\": false,\n \"taxInvoiceIssuedDate\": \"2023-12-25\",\n \"taxInvoiceIssueDueDate\": \"2023-12-25\",\n \"inChargeSet\": [\n {\n \"id\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("X-Signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.pluuug.com/v1/settlement")
.header("X-API-Key", "<api-key>")
.header("X-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"amount\": 1,\n \"additionalAmount\": 1,\n \"vat\": 1,\n \"contract\": {\n \"id\": 123\n },\n \"type\": {\n \"id\": 123\n },\n \"settlementRound\": 2,\n \"dueDate\": \"2023-12-25\",\n \"settledDate\": \"2023-12-25\",\n \"isTaxInvoiceIssued\": false,\n \"isTaxInvoiceNeeded\": false,\n \"taxInvoiceIssuedDate\": \"2023-12-25\",\n \"taxInvoiceIssueDueDate\": \"2023-12-25\",\n \"inChargeSet\": [\n {\n \"id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.pluuug.com/v1/settlement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["X-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"amount\": 1,\n \"additionalAmount\": 1,\n \"vat\": 1,\n \"contract\": {\n \"id\": 123\n },\n \"type\": {\n \"id\": 123\n },\n \"settlementRound\": 2,\n \"dueDate\": \"2023-12-25\",\n \"settledDate\": \"2023-12-25\",\n \"isTaxInvoiceIssued\": false,\n \"isTaxInvoiceNeeded\": false,\n \"taxInvoiceIssuedDate\": \"2023-12-25\",\n \"taxInvoiceIssueDueDate\": \"2023-12-25\",\n \"inChargeSet\": [\n {\n \"id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"title": "<string>",
"amount": 1,
"additionalAmount": 1,
"vat": 1,
"typeAlias": "<string>",
"created": "2023-11-07T05:31:56Z",
"contract": {
"id": 123,
"title": "<string>",
"amount": 123,
"startDate": "2023-12-25",
"endDate": "2023-12-25"
},
"dueDate": "2023-12-25",
"settledDate": "2023-12-25"
}{
"nonField": [
"<string>"
],
"title": [
"<string>"
],
"amount": [
"<string>"
],
"additionalAmount": [
"<string>"
],
"vat": [
"<string>"
],
"settlementRound": [
"<string>"
],
"dueDate": [
"<string>"
],
"settledDate": [
"<string>"
],
"isTaxInvoiceIssued": [
"<string>"
],
"isTaxInvoiceNeeded": [
"<string>"
],
"taxInvoiceIssuedDate": [
"<string>"
],
"taxInvoiceIssueDueDate": [
"<string>"
],
"contract": {
"id": [
"<string>"
]
},
"type": {
"id": [
"<string>"
]
},
"inChargeSet": [
"<string>"
]
}정산
정산 생성
새 정산을 생성합니다.
필수 관계: contract.id(계약 ID), type.id(정산 형태 ID, 미수금 OUTSTANDING_PAYMENT는 사용 불가).
정산 형태에 따라 단일 결제/정기 결제 등 정산 흐름이 결정됩니다. 정산 상태 변경 이력은 정산 상세/수정 API의 부수효과로 자동 기록됩니다.
POST
/
v1
/
settlement
정산 생성
curl --request POST \
--url https://openapi.pluuug.com/v1/settlement \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Signature: <api-key>' \
--data '
{
"title": "<string>",
"amount": 1,
"additionalAmount": 1,
"vat": 1,
"contract": {
"id": 123
},
"type": {
"id": 123
},
"settlementRound": 2,
"dueDate": "2023-12-25",
"settledDate": "2023-12-25",
"isTaxInvoiceIssued": false,
"isTaxInvoiceNeeded": false,
"taxInvoiceIssuedDate": "2023-12-25",
"taxInvoiceIssueDueDate": "2023-12-25",
"inChargeSet": [
{
"id": 123
}
]
}
'import requests
url = "https://openapi.pluuug.com/v1/settlement"
payload = {
"title": "<string>",
"amount": 1,
"additionalAmount": 1,
"vat": 1,
"contract": { "id": 123 },
"type": { "id": 123 },
"settlementRound": 2,
"dueDate": "2023-12-25",
"settledDate": "2023-12-25",
"isTaxInvoiceIssued": False,
"isTaxInvoiceNeeded": False,
"taxInvoiceIssuedDate": "2023-12-25",
"taxInvoiceIssueDueDate": "2023-12-25",
"inChargeSet": [{ "id": 123 }]
}
headers = {
"X-API-Key": "<api-key>",
"X-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Key': '<api-key>',
'X-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: '<string>',
amount: 1,
additionalAmount: 1,
vat: 1,
contract: {id: 123},
type: {id: 123},
settlementRound: 2,
dueDate: '2023-12-25',
settledDate: '2023-12-25',
isTaxInvoiceIssued: false,
isTaxInvoiceNeeded: false,
taxInvoiceIssuedDate: '2023-12-25',
taxInvoiceIssueDueDate: '2023-12-25',
inChargeSet: [{id: 123}]
})
};
fetch('https://openapi.pluuug.com/v1/settlement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.pluuug.com/v1/settlement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'amount' => 1,
'additionalAmount' => 1,
'vat' => 1,
'contract' => [
'id' => 123
],
'type' => [
'id' => 123
],
'settlementRound' => 2,
'dueDate' => '2023-12-25',
'settledDate' => '2023-12-25',
'isTaxInvoiceIssued' => false,
'isTaxInvoiceNeeded' => false,
'taxInvoiceIssuedDate' => '2023-12-25',
'taxInvoiceIssueDueDate' => '2023-12-25',
'inChargeSet' => [
[
'id' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.pluuug.com/v1/settlement"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"amount\": 1,\n \"additionalAmount\": 1,\n \"vat\": 1,\n \"contract\": {\n \"id\": 123\n },\n \"type\": {\n \"id\": 123\n },\n \"settlementRound\": 2,\n \"dueDate\": \"2023-12-25\",\n \"settledDate\": \"2023-12-25\",\n \"isTaxInvoiceIssued\": false,\n \"isTaxInvoiceNeeded\": false,\n \"taxInvoiceIssuedDate\": \"2023-12-25\",\n \"taxInvoiceIssueDueDate\": \"2023-12-25\",\n \"inChargeSet\": [\n {\n \"id\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("X-Signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.pluuug.com/v1/settlement")
.header("X-API-Key", "<api-key>")
.header("X-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"amount\": 1,\n \"additionalAmount\": 1,\n \"vat\": 1,\n \"contract\": {\n \"id\": 123\n },\n \"type\": {\n \"id\": 123\n },\n \"settlementRound\": 2,\n \"dueDate\": \"2023-12-25\",\n \"settledDate\": \"2023-12-25\",\n \"isTaxInvoiceIssued\": false,\n \"isTaxInvoiceNeeded\": false,\n \"taxInvoiceIssuedDate\": \"2023-12-25\",\n \"taxInvoiceIssueDueDate\": \"2023-12-25\",\n \"inChargeSet\": [\n {\n \"id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.pluuug.com/v1/settlement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["X-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"amount\": 1,\n \"additionalAmount\": 1,\n \"vat\": 1,\n \"contract\": {\n \"id\": 123\n },\n \"type\": {\n \"id\": 123\n },\n \"settlementRound\": 2,\n \"dueDate\": \"2023-12-25\",\n \"settledDate\": \"2023-12-25\",\n \"isTaxInvoiceIssued\": false,\n \"isTaxInvoiceNeeded\": false,\n \"taxInvoiceIssuedDate\": \"2023-12-25\",\n \"taxInvoiceIssueDueDate\": \"2023-12-25\",\n \"inChargeSet\": [\n {\n \"id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"title": "<string>",
"amount": 1,
"additionalAmount": 1,
"vat": 1,
"typeAlias": "<string>",
"created": "2023-11-07T05:31:56Z",
"contract": {
"id": 123,
"title": "<string>",
"amount": 123,
"startDate": "2023-12-25",
"endDate": "2023-12-25"
},
"dueDate": "2023-12-25",
"settledDate": "2023-12-25"
}{
"nonField": [
"<string>"
],
"title": [
"<string>"
],
"amount": [
"<string>"
],
"additionalAmount": [
"<string>"
],
"vat": [
"<string>"
],
"settlementRound": [
"<string>"
],
"dueDate": [
"<string>"
],
"settledDate": [
"<string>"
],
"isTaxInvoiceIssued": [
"<string>"
],
"isTaxInvoiceNeeded": [
"<string>"
],
"taxInvoiceIssuedDate": [
"<string>"
],
"taxInvoiceIssueDueDate": [
"<string>"
],
"contract": {
"id": [
"<string>"
]
},
"type": {
"id": [
"<string>"
]
},
"inChargeSet": [
"<string>"
]
}🚫 제한사항
- 계약
- 계약은 시작일과 종료일이 모두 지정되어 있어야 합니다.
- 중단된 계약에 대해서는 정산을 생성할 수 없습니다.
- 정산 형태
- 다차수 생성을 허용하지 않는 정산 형태는 같은 형태로 여러개 생성할 수 없습니다. (추가 정산, 미수 정산 제외)
Authorizations
HMAC-SHA256 방식으로 body를 secret key로 해싱하여 생성한 서명을 넣어야 합니다. 서버는 X-API-Key와 대응되는 secret key로 서명을 검증합니다.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
정산 제목
Required string length:
1 - 128정산 금액
Required range:
x >= 0추가 금액
Required range:
x >= 0부가세
Required range:
x >= 0계약
Show child attributes
Show child attributes
정산 형태
Show child attributes
Show child attributes
정산 차수
Required range:
x >= 1지급 예정일
지급 완료일
세금 계산서 발행 여부
세금 계산서 발행 필요 여부
세금 계산서 발행 날짜
세금 계산서 발행 예정 날짜
담당자
Show child attributes
Show child attributes
Response
정산 제목
Maximum string length:
128정산 상태
C- 정산 예정D- 정산 지연S- 정산 완료P- 정산 중단
Available options:
C, D, S, P 정산 금액
Required range:
x >= 0추가 금액
Required range:
x >= 0부가세
Required range:
x >= 0정산 형태
생성일시
계약
Show child attributes
Show child attributes
지급 예정일
지급 완료일
⌘I