-
Notifications
You must be signed in to change notification settings - Fork 12
/
api_cashReceipt.html
835 lines (827 loc) · 36.6 KB
/
api_cashReceipt.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>토스 현금영수증 API</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="https://static.toss.im/tds/favicon/favicon.ico" />
<link rel="icon" type="image/png" sizes="16x16" href="https://static.toss.im/tds/favicon/favicon-16x16.png" />
<link rel="icon" type="image/png" sizes="32x32" href="https://static.toss.im/tds/favicon/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="48x48" href="https://static.toss.im/tds/favicon/favicon-48x48.png" />
<link rel="icon" type="image/png" sizes="196x196" href="https://static.toss.im/tds/favicon/favicon-196x196.png" />
<link rel="apple-touch-icon" sizes="57x57" href="https://static.toss.im/tds/favicon/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="72x72" href="https://static.toss.im/tds/favicon/apple-touch-icon-72x72.png" />
<link
rel="apple-touch-icon"
sizes="114x114"
href="https://static.toss.im/tds/favicon/apple-touch-icon-114x114.png"
/>
<link
rel="apple-touch-icon"
sizes="120x120"
href="https://static.toss.im/tds/favicon/apple-touch-icon-120x120.png"
/>
<link
rel="apple-touch-icon"
sizes="144x144"
href="https://static.toss.im/tds/favicon/apple-touch-icon-144x144.png"
/>
<link
sizes="152x152"
href="https://static.toss.im/tds/favicon/apple-touch-icon-152x152.png"fdsffsdf
/>
<meta name="msapplication-TileImage" content="https://static.toss.im/tds/favicon/mstile-144x144.png" />
<!-- stylesheets -->
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"
integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ=="
crossorigin="anonymous"
/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="css/prism.css" />
<link rel="stylesheet" type="text/css" href="css/tossdev.css" />
<!-- javascript -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"
integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ=="
crossorigin="anonymous"
></script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body id="docs" data-spy="scroll" data-target="#guide">
<!-- Google Tag Manager -->
<noscript
><iframe
src="//www.googletagmanager.com/ns.html?id=GTM-TPTMLG"
height="0"
width="0"
style="display:none;visibility:hidden"
></iframe
></noscript>
<script>
(function(w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src = '//www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-TPTMLG');
</script>
<!-- End Google Tag Manager -->
<div id="guide">
<div class="logo">
<a href="index.html">
<img class="logo-img" src="https://static.toss.im/tds/icon/svg/logo-only-icon.svg" alt="">
<span>결제 연동 가이드</span>
</a>
</div>
<ul class="menu nav">
<h5>현금영수증 API</h5>
<li>
<a href="#intro">소개</a>
</li>
<h5>API 목록</h5>
<li>
<a href="#issue">현금 영수증 발급</a>
</li>
<li>
<a href="#revoke">현금 영수증 취소</a>
</li>
<li>
<a href="#info">현금 영수증 상태 확인 </a>
</li>
<li>
<a href="#popupUri">현금 영수증 팝업 주소 전달 </a>
</li>
<h5>유의할 점</h5>
<li>
<a href="#complete">현금영수증 처리 완료 일시</a>
</li>
<h5>현금영수증 에러코드</h5>
<li>
<a href="#error">현금영수증 에러 응답코드</a>
</li>
</ul>
</div>
<div id="api-docs">
<div id="methods">
<div class="languages">
<a class="language selected" data-lang="php" href="#">PHP</a>
<a class="language" data-lang="java" href="#">Java</a>
<a class="language" data-lang="curl" href="#">curl</a>
<a class="language" data-lang="python" href="#">Python</a>
<a class="language" data-lang="ruby" href="#">Ruby</a>
<a class="language" data-lang="aspnet" href="#">ASP</a>
</div>
<div class="method" id="intro">
<div class="method-section clearfix">
<div class="method-description">
<h3>토스 현금영수증 API 소개</h3>
<p>
본 문서는 토스페이 결제 가맹점에서 현금영수증을 발급하거나 취소, 상태 확인 및 현금영수증 이미지 주소를 얻고자 할 때 사용할 API 에 대한 가이드를 제공합니다.<br>
토스페이 결제 가맹점에서는 해당하는 현금영수증 API 를 이용하여 국세청으로 현금영수증을 등록 및 취소, 상태 확인 등을 할 수 있습니다.<br>
이를 위해 토스페이에서는 토스페이먼츠(PG)를 통해 가맹점에게 현금영수증 API 를 제공하고,<br>
토스페이먼츠(PG)를 통해 국세청으로 정상 등록이 되면 통상 2일 안에 국세청으로부터 동기화 과정을 거쳐서 현금영수증의 발급이 완료됩니다.
</p>
</div>
</div>
</div>
<div class="method" id="issue">
<div class="method-section clearfix">
<div class="method-description">
<h3>현금 영수증 발급</h3>
<p>
해당 결제가 status = PAY_COMPLETE 으로 완료되었을 때, 현금 영수증 발급이 가능합니다.<br>
<strong>* 주의 사항: 토스의 결제 금액과 현금영수증의 불일치를 막기 위해 - 발급 API 에서는 금액 정보를 파라미터로 받지 않습니다.<br>
이미 결제 처리가 되어 토스 시스템에 기록된 과세 항목, 비과세 항목 등의 값을 바탕으로 현금영수증 발급이 처리됩니다.</strong>
</p>
<div class="info">
<h4>endpoint</h4>
<div class="field clearfix">
<div class="key">
(POST)
</div>
<div class="desc">
https://pay.toss.im/api/v2/issue-cash-receipt
</div>
</div>
</div>
<div class="info">
<h4>parameters</h4>
<div class="field clearfix">
<div class="key">
apiKey
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">Max Length: 255 </span>
</div>
<div class="desc">
결제 가맹점의 apiKey<br/>
<span class="text-muted">apiKey 는 LIVE 값만 동작하며 TEST 값은 무시됩니다.
</div>
</div>
<div class="field clearfix">
<div class="key">
payToken
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">Max Length: 255 </span>
</div>
<div class="desc">
결제 토큰 <br/>
<span class="text-muted">현금영수증 발급 대상 결제는 결제 완료(status = PAY_COMPLETE) 상태여야 합니다.<br></span>
</div>
</div>
<div class="field clearfix">
<div class="key">
cashReceiptKey
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">Max Length: 255 </span>
</div>
<div class="desc">
발급 주체를 식별할 수 있는 key 값<br/>
<span class="text-muted">ex) 개인의 경우 - 휴대폰번호<br/>
사업장의 경우 - 사업자등록번호<br></span>
</div>
</div>
<div class="field clearfix">
<div class="key">
cashReceiptKeyType
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">Max Length: 255 </span>
</div>
<div class="desc">
현금영수증 keyType<br/>
<br/>
<table class="table">
<tr>
<td>PHONE</td>
<td>전화번호</td>
</tr>
<tr>
<td>CORPORATE</td>
<td>사업자등록번호</td>
</tr>
<tr>
<td>CARD</td>
<td>카드번호</td>
</tr>
</table>
</div>
</div>
<div class="field clearfix">
<div class="key">
cashReceiptPurpose
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">Max Length: 255 </span>
</div>
<div class="desc">
현금영수증 발급 목적<br/>
<br/>
<table class="table">
<tr>
<td>DEDUCTION</td>
<td>소득공제용</td>
</tr>
<tr>
<td>EVIDENCE</td>
<td>지출증빙용</td>
</tr>
</table>
</div>
</div>
<div class="field clearfix">
<div class="key">
needSelfIssue
<span class="type">boolean</span>
<span class="type">Max Length: 5 </span>
</div>
<div class="desc">
자진발급 처리 여부<br/>
<span class="text-muted">자진발급 처리를 희망하지 않을 경우, needSelfIssue 파라미터는 전달 하지 않습니다.(기본값 false)<br/>
* 단, cashReceiptKey, cashReceiptKeyType, cashReceiptPurpose 값들이 반드시 전달 되어야 합니다.<br></span>
<br/>
<span class="text-muted"> 자진발급 처리 여부를 true 로 전달 할 경우, 자진발급 처리를 진행 할 수 있으며, 아래와 같이 자동 발행(2021년 01월부터 실행된 현금영수증 의무발행 정보에 의거)<br/>
* 식별번호(cashReceiptKey): 01000001234<br/>
* 현금영수증 타입(cashReceiptKeyType): PHONE (전화번호)<br/>
* 발급목적(cashReceiptPurpose): DEDUCTION (소득공제용)<br></span>
<br/>
</div>
</div>
<div class="field clearfix">
<div class="key">
isCurrentCashReceiptKeyUsage
<span class="type">boolean</span>
<span class="type">Max Length: 5 </span>
</div>
<div class="desc">
토스 유저의 현재 현금영수증 식별번호로 발급 처리 여부<br/>
<span class="text-muted">해당 값을 true 로 전달 할 경우 식별번호를 보내지 않아도 토스가 저장하고 있는 유저의 현재 현금영수증 식별 번호로 발급 처리됩니다.(기본값 false)<br></span>
</div>
</div>
</div>
<div class="info">
<h4>response (JSON)</h4>
<div class="field clearfix">
<div class="key">
status
</div>
<div class="desc">
http status code
</div>
</div>
<div class="field clearfix">
<div class="key">
code
</div>
<div class="desc">
0 : 정상, 그 외 값은 에러
</div>
</div>
<div class="field clearfix">
<div class="key">
cashReceiptMgtKey
</div>
<div class="desc">
발급 요청된 현금영수증을 확인할 수 있는 관리번호 값
</div>
</div>
<div class="field clearfix">
<div class="key">
supplyCost
</div>
<div class="desc">
공급가액 = 과세 금액 + 비과세 금액 <br>
supplyCost = amountTaxable + amountTaxFree
</div>
</div>
<div class="field clearfix">
<div class="key">
tax
</div>
<div class="desc">
부가세 <br>
tax = amountVat
</div>
</div>
<div class="field clearfix">
<div class="key">
serviceFee
</div>
<div class="desc">
봉사료 <br>
serviceFee = amountServiceFee
</div>
</div>
</div>
</div>
<div class="method-example">
<div class="title">Definition</div>
<pre><code class="language-bash always-visible">POST https://pay.toss.im/api/v2/issue-cash-receipt</code></pre>
<div class="title">Example Request</div>
<pre><code class="language-javascript always-visible">{
"apiKey": "example_api_key",
"payToken": "example_payToken",
"cashReceiptKey": "01001230123",
"cashReceiptKeyType": "PHONE",
"cashReceiptPurpose": "DEDUCTION"
}
</code></pre>
<div class="title">Example Response</div>
<pre><code class="language-javascript always-visible">{
"status": 200,
"code": 0,
"cashReceiptMgtKey": "123456-123456",
"supplyCost": 909,
"tax": 91,
"serviceFee": 0
}
</code></pre>
</div>
</div>
</div>
<div class="method" id="revoke">
<div class="method-section clearfix">
<div class="method-description">
<h3>현금 영수증 취소</h3>
<p>
해당 결제가 status = PAY_COMPLETE 으로 완료되었고, 발급 요청된 현금 영수증이 있을 때에만 호출 가능합니다.<br>
<strong>* 주의 사항: 현금영수증 취소 API 의 경우에도 금액과 관련된 parameter 를 받지 않습니다.<br>
결제 환불 API 를 통해 토스 시스템에서 기록된 남은 금액을 바탕으로 현금영수증 취소를 처리합니다.<br>
따라서 전체 환불, 부분 환불의 구분 없이 취소 API 를 호출하면, 남은 결제 금액에 맞게 알아서 처리 됩니다. </strong>
</p>
<div class="info">
<h4>endpoint</h4>
<div class="field clearfix">
<div class="key">
(POST)
</div>
<div class="desc">
https://pay.toss.im/api/v2/revoke-cash-receipt
</div>
</div>
</div>
<div class="info">
<h4>parameter</h4>
<div class="field clearfix">
<div class="key">
apiKey
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">string</span>
<span class="type">Max Length: 30 </span>
</div>
<div class="desc">
결제 가맹점의 apiKey <br>
<span class="text-muted">apiKey 는 LIVE 값만 동작하며 TEST 값은 무시됩니다.</span>
</div>
</div>
<div class="field clearfix">
<div class="key">
payToken
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">string</span>
<span class="type">Max Length: 30 </span>
</div>
<div class="desc">
결제토큰 <br> 현금영수증 발급 대상 결제는 '결제 완료' 상태여야 합니다.<br>
status = PAY_COMPLETE <br>
</div>
</div>
<div class="info">
<h4>response (JSON)</h4>
<div class="field clearfix">
<div class="key">
status
</div>
<div class="desc">
http status code
</div>
</div>
<div class="field clearfix">
<div class="key">
code
</div>
<div class="desc">
0 : 정상, 그 외 값은 에러
</div>
</div>
<div class="field clearfix">
<div class="key">
cashReceiptMgtKey
</div>
<div class="desc">
발급 요청된 현금영수증을 확인할 수 있는 관리번호 값
</div>
</div>
</div>
</div>
</div>
<div class="method-example">
<div class="title">Definition</div>
<pre><code class="language-bash always-visible">POST https://pay.toss.im/api/v2/revoke-cash-receipt</code></pre>
<div class="title">Example Request</div>
<pre><code class="language-javascript always-visible">{
"apiKey": "example_api_key",
"payToken": "example_payToken"
}
</code></pre>
<div class="title">Example Response</div>
<pre><code class="language-javascript always-visible">{
"status": 200,
"code": 0,
"cashReceiptMgtKey": "123456-123456",
"supplyCost": 9090,
"tax": 910,
"serviceFee": 0
}
</code></pre>
</div>
</div>
</div>
<div class="method" id="info">
<div class="method-section clearfix">
<div class="method-description">
<h3>현금 영수증 상태 확인</h3>
<p></p>
<div class="info">
<h4>endpoint</h4>
<div class="field clearfix">
<div class="key">
(POST)
</div>
<div class="desc">
https://pay.toss.im/api/v2/cash-receipt-info
</div>
</div>
</div>
<div class="info">
<h4>parameter</h4>
<div class="field clearfix">
<div class="key">
apiKey
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">string</span>
<span class="type">Max Length: 30 </span>
</div>
<div class="desc">
결제 가맹점의 apiKey <br>
<span class="text-muted">apiKey 는 LIVE 값만 동작하며 TEST 값은 무시됩니다.</span>
</div>
</div>
<div class="field clearfix">
<div class="key">
payToken
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">string</span>
<span class="type">Max Length: 30 </span>
</div>
<div class="desc">
결제토큰 <br>
</div>
</div>
</div>
<div class="info">
<h4>response (JSON)</h4>
<div class="field clearfix">
<div class="key">
cashReceiptMgtKey
</div>
<div class="desc">
현금영수증 관리번호 값
</div>
</div>
<div class="field clearfix">
<div class="key">
customerName
</div>
<div class="desc">
현금영수증 신청 고객명
</div>
</div>
<div class="field clearfix">
<div class="key">
itemName
</div>
<div class="desc">
상품명
</div>
</div>
<div class="field clearfix">
<div class="key">
identityNum
</div>
<div class="desc">
현금영수증 발급 당시 사용한 고객 식별번호 <br>
ex) 휴대폰번호, 사업자등록번호 등 <br>
</div>
</div>
<div class="field clearfix">
<div class="key">
taxationType
</div>
<div class="desc">
과세형태 (과세 / 비과세)
</div>
</div>
<div class="field clearfix">
<div class="key">
totalAmount
</div>
<div class="desc">
현금영수증 발급 총액
</div>
</div>
<div class="field clearfix">
<div class="key">
tradeUsage
</div>
<div class="desc">
발급 목적 (소득공제용 / 지출증빙용)
</div>
</div>
<div class="field clearfix">
<div class="key">
tradeType
</div>
<div class="desc">
거래유형 (승인거래 / 취소거래)
</div>
</div>
<div class="field clearfix">
<div class="key">
status
</div>
<div class="desc">
현금영수증 상태<br>
<br>
<table class="table">
<tr>
<td>IN_PROGRESS</td>
<td>국세청 전송중</td>
</tr>
<tr>
<td>ISSUE_APPLIED</td>
<td>발급 신청 완료</td>
</tr>
<tr>
<td>ISSUE_COMPLETE</td>
<td>발급 완료</td>
</tr>
<tr>
<td>ISSUE_FAILED</td>
<td>발급 실패</td>
</tr>
</table>
</div>
</div>
<div class="field clearfix">
<div class="key">
tradeDate
</div>
<div class="desc">
등록 요청 날짜
</div>
</div>
<div class="field clearfix">
<div class="key">
confirmNum
</div>
<div class="desc">
발행승인번호
</div>
</div>
<div class="field clearfix">
<div class="key">
confirmTs
</div>
<div class="desc">
발행일시<br>
<span>ISO-8601 형식<br>
예시: 2019-03-21T14:02:49</span>
</div>
</div>
</div>
</div>
<div class="method-example">
<div class="title">Definition</div>
<pre><code class="language-bash always-visible">POST https://pay.toss.im/api/v2/cash-receipt-info</code></pre>
<div class="title">Example Request</div>
<pre><code class="language-javascript always-visible">{
"apiKey": "example_api_key",
"payToken": "example_payToken"
}
</code></pre>
<div class="title">Example Response</div>
<pre><code class="language-javascript always-visible">{
"cashReceiptMgtKey": "123456-123456",
"customerName": "김토스",
"itemName": "테스트 상품",
"identityNum": "01012341234",
"taxationType": "과세",
"totalAmount": "10000",
"tradeUsage": "소득공제용",
"tradeType": "승인거래",
"status": "ISSUE_APPLIED",
"tradeDate": "20180512"
}
</code></pre>
</div>
</div>
</div>
<div class="method" id="popupUri">
<div class="method-section clearfix">
<div class="method-description">
<h3>현금 영수증 팝업 주소 전달</h3>
<p>
토스 결제 가맹점을 이용한 고객이 현금영수증의 발급 및 취소된 것의 발급 이미지 등을 요구할 때, 해당 API 를 호출하여 리턴되는 팝업 Uri 값으로 대응이 가능합니다.
</p>
<div class="info">
<h4>endpoint</h4>
<div class="field clearfix">
<div class="key">
(POST)
</div>
<div class="desc">
https://pay.toss.im/api/v2/cash-receipt-popupUri
</div>
</div>
</div>
<div class="info">
<h4>parameter</h4>
<div class="field clearfix">
<div class="key">
apiKey
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">string</span>
<span class="type">Max Length: 30 </span>
</div>
<div class="desc">
결제 가맹점의 apiKey <br>
<span class="text-muted">apiKey 는 LIVE 값만 동작하며 TEST 값은 무시됩니다.</span>
</div>
</div>
<div class="field clearfix">
<div class="key">
payToken
<span class="type">string <font color=#c25300>필수</font></span>
<span class="type">string</span>
<span class="type">Max Length: 30 </span>
</div>
<div class="desc">
결제토큰
</div>
</div>
<div class="info">
<h4>response (JSON)</h4>
<div class="field clearfix">
<div class="key">
code
</div>
<div class="desc">
0 : 정상, 그 외 값은 에러
</div>
</div>
<div class="field clearfix">
<div class="key">
popupUri
</div>
<div class="desc">
발급 및 취소 상태인 현금영수증을 웹브라우저에서 직접 확인할 수 있는 팝업 Uri 값<br>
</div>
</div>
</div>
</div>
</div>
<div class="method-example">
<div class="title">Definition</div>
<pre><code class="language-bash always-visible">POST https://pay.toss.im/api/v2/cash-receipt-popupUri</code></pre>
<div class="title">Example Request</div>
<pre><code class="language-javascript always-visible">{
"apiKey": "example_api_key",
"payToken": "example_payToken"
}
</code></pre>
<div class="title">Example Response</div>
<pre><code class="language-javascript always-visible">{
"code": 0,
"popupUri": "https://pay.toss.im/payfront/web/external/cash-receipt?payToken=example_payToken&mgtKey=f017f18b-2356-bNpwieGeQp"
}
</code>
</pre>
</div>
</div>
</div>
<div class="method" id="complete">
<div class="method-section clearfix">
<div class="method-description">
<h3>현금영수증 처리 완료 일시</h3>
<p> ✓ 현금영수증 API 를 호출하더라도<br>
1) 국세청으로 전송<br>
2) 국세청에서 확인 후 승인 또는 거절 등의 단계를 거쳐 처리가 되므로, 현금영수증 API 호출 후 통상 2 ~ 3 일의 시일이 지나야 국세청에 등록이 완료됩니다.<br>
<p> ✓ 현금영수증 취소의 경우, 환불 시 별도의 원장에 기록된 현금영수증 취소 STANDBY가 환불과 동시에 생성되며 뒷단 배치에서 해당 STANDBY를 읽어 현금영수증 취소 처리 후 토스페이먼츠(PG)로 취소 요청이 전달됩니다.</p><br>
</div>
</div>
</div>
<div class="method" id="error">
<div class="method-section clearfix">
<div class="method-description">
<h3>현금영수증 에러 응답코드</h3>
<p> ✓ 토스페이 에러코드는 예고 없이 업데이트 될 수 있습니다. 추가되더라도 오류가 발생하지 않도록 연동 부탁드립니다.<br>
<p> ✓ 토스에서는 한 가지 에러코드에 상황별로 다른 오류 메시지를 전달합니다.<br>
여러 상황이 발생할 수 있으니 되도록이면 전달되는 오류 메시지 그대로를 처리해주세요.</p><br>
<table class="table table-bordered table-hover table-condensed">
<tr class="active">
<td width="50%"><strong>응답 코드(errorCode)</strong></td>
<td width="50%"><strong>사유(msg)</strong></td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_JOIN_MEMBER_FAIL</td>
<td width="50%">현금영수증 연동회원 신규가입이 실패하였습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_REGIST_ISSUE_FAIL</td>
<td width="50%">현금영수증을 발행하지 못했습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_ALREADY_ISSUE_FAIL</td>
<td width="50%">현금영수증이 이미 발행 되었습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_ALREADY_CANCEL_FAIL</td>
<td width="50%">현금영수증이 이미 취소 되었습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_ISSUE_IN_PROGRESS</td>
<td width="50%">현금영수증 발행 진행 중 입니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_CANCEL_ISSUE_FAIL</td>
<td width="50%">현금영수증 발행 취소를 하지 못했습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_REVOKE_REGIST_ISSUE_FAIL</td>
<td width="50%">취소 현금영수증을 발행하지 못했습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_GET_INFO_FAIL</td>
<td width="50%">현금영수증 정보 확인에 실패하였습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_NOT_EXIST</td>
<td width="50%">발급된 현금영수증이 존재하지 않습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_GET_POPUP_URI_FAIL</td>
<td width="50%">현금영수증 조회 링크를 가져오지 못했습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_UNKNOWN_STATUS_CODE</td>
<td width="50%">존재하지 않는 현금영수증 상태코드 입니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_CANNOT_ISSUE_CARD</td>
<td width="50%">카드 결제는 현금영수증을 발행할 수 없습니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_MAINTENANCE_TIME</td>
<td width="50%">현금 영수증 서비스 점검 시간입니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_INVALID_USER_INFO</td>
<td width="50%">잘못된 식별번호입니다.</td>
</tr>
<tr>
<td width="50%">CASH_RECEIPT_INVALID_PARAMETER</td>
<td width="50%">요청 값이 잘못되었습니다.</td>
</tr>
<tr>
<td width="50%">NOT_SUPPORTED_CASH_RECEIPT_AGENCY</td>
<td width="50%">지원하지 않는 현금영수증 발행처입니다.</td>
</tr>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
// language toggle
var $languages = $(".languages .language");
$languages.click(function (e) {
e.preventDefault();
var lang = $(this).data("lang");
$languages.removeClass("selected");
$(this).addClass("selected");
$("pre code").hide();
$("pre code." + lang).css("display", "block");
});
$("pre code." + $(".language.selected").data("lang")).css("display", "block");
});
</script>
<script src="js/prism.js"></script>
</body>
</html>