-
Notifications
You must be signed in to change notification settings - Fork 137
/
checkout_orders_v1.json
2012 lines (2012 loc) · 76.5 KB
/
checkout_orders_v1.json
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
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.0.3",
"info": {
"title": "Orders",
"description": "Partners can use the Orders API to create, show details for, authorize, and capture payment for orders.<blockquote><strong>Orders API integration note:</strong> The PayPal Commerce Platform is a limited-release solution aimed at partners, crowd funding, and multi-party commerce platforms. To use Orders API for Partners, see <a href=\"/docs/multiparty/\">Multiparty Payments</a>. v1 of the API will be deprecated soon. A new version is available at <a href=\"/docs/api/orders/v2/\">Orders API v2</a>.</blockquote>",
"version": "1.1",
"contact": {}
},
"servers": [
{
"url": "https://api-m.sandbox.paypal.com",
"description": "PayPal Sandbox Environment"
},
{
"url": "https://api-m.paypal.com",
"description": "PayPal Live Environment"
}
],
"tags": [
{
"name": "orders",
"description": "Use the `/checkout/orders` resource to create, cancel, and show details for orders."
},
{
"name": "orders-payment-actions",
"description": "Use the `/checkout/orders` resource with the `/pay` action to pay for an order. When you [create an order](#orders_create), the response includes an approval URL. Redirect the customer to this approval URL."
}
],
"externalDocs": {
"url": "https://developer.paypal.com/docs/api/orders/v1/"
},
"paths": {
"/v1/checkout/orders": {
"post": {
"summary": "Create order",
"description": "Creates an order.",
"operationId": "orders.create",
"responses": {
"200": {
"description": "A successful request returns the HTTP `200 OK` status code and a JSON response body that includes the PayPal-generated order ID, an array of purchase unit objects, payment details, customer information, metadata, and order status.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/order"
}
}
}
},
"default": {
"description": "The error response.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"parameters": [
{
"$ref": "#/components/parameters/paypal_partner_attribution_id"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/order"
},
"examples": {
"order": {
"value": {
"purchase_units": [
{
"reference_id": "store_mobile_world_order_1234",
"description": "Mobile World Store order-1234",
"amount": {
"currency": "USD",
"details": {
"subtotal": "1.09",
"shipping": "0.02",
"tax": "0.33"
},
"total": "1.44"
},
"payee": {
"email": "[email protected]"
},
"items": [
{
"name": "NeoPhone",
"sku": "sku03",
"price": "0.54",
"currency": "USD",
"quantity": "1"
},
{
"name": "Fitness Watch",
"sku": "sku04",
"price": "0.55",
"currency": "USD",
"quantity": "1"
}
],
"shipping_address": {
"line1": "2211 N First Street",
"line2": "Building 17",
"city": "San Jose",
"country_code": "US",
"postal_code": "95131",
"state": "CA",
"phone": "(123) 456-7890"
},
"shipping_method": "United Postal Service",
"partner_fee_details": {
"receiver": {
"email": "[email protected]"
},
"amount": {
"value": "0.01",
"currency": "USD"
}
},
"payment_linked_group": 1,
"custom": "custom_value_2388",
"invoice_number": "invoice_number_2388",
"payment_descriptor": "Payment Mobile World"
}
],
"redirect_urls": {
"return_url": "https://example.com/return",
"cancel_url": "https://example.com/cancel"
}
}
}
}
}
},
"required": true
},
"security": [
{
"Oauth2": [
"https://uri.paypal.com/services/payments/payment",
"https://uri.paypal.com/services/payments/channelpartner",
"https://uri.paypal.com/services/payments/partnerfee",
"https://uri.paypal.com/services/payments/realtimepayment"
]
}
],
"tags": [
"orders"
]
}
},
"/v1/checkout/orders/{order_id}": {
"get": {
"summary": "Show order details",
"description": "Shows details for an order, by ID.",
"operationId": "orders.get",
"responses": {
"200": {
"description": "A successful request returns the HTTP `200 OK` status code and a JSON response body that shows order details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/order"
}
}
}
},
"default": {
"description": "The error response.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"parameters": [
{
"$ref": "#/components/parameters/order_id"
}
],
"security": [
{
"Oauth2": [
"https://uri.paypal.com/services/payments/payment",
"https://uri.paypal.com/services/payments/channelpartner",
"https://uri.paypal.com/services/payments/partnerfee",
"https://uri.paypal.com/services/payments/realtimepayment"
]
}
],
"tags": [
"orders"
]
},
"delete": {
"summary": "Cancel order",
"description": "Cancels an order, by ID, and deletes the order. To call this method, the order status must be `CREATED` or `APPROVED`.",
"operationId": "orders.cancel",
"responses": {
"204": {
"description": "A successful request returns the HTTP `204 No Content` status code with no JSON response body. If the order is already paid, the order cannot be canceled and the request returns the HTTP `422 Unprocessable Entity` status code with the message, `This order is in progress`."
},
"default": {
"description": "The error response.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"parameters": [
{
"$ref": "#/components/parameters/order_id"
}
],
"security": [
{
"Oauth2": [
"https://uri.paypal.com/services/payments/payment",
"https://uri.paypal.com/services/payments/realtimepayment"
]
}
],
"tags": [
"orders"
]
}
},
"/v1/checkout/orders/{order_id}/pay": {
"post": {
"summary": "Pay for order",
"description": "Initiates a PayPal payment that a buyer has approved.<blockquote><strong>Note:</strong> For Partner use cases, use the <code>disbursement_mode</code> to indicate whether to disburse funds to the seller and partner accounts immediately or later. If you delay disbursement, you must call <a href=\"/docs/multiparty/checkout/delayed-disbursement/\">disburse funds</a> to disburse funds to the merchant and partner.</blockquote>",
"operationId": "orders.pay",
"responses": {
"200": {
"description": "A successful request returns the HTTP `200 OK` status code and a JSON response body that shows order and payment details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pay_order_response"
}
}
}
},
"201": {
"description": "A successful request returns the HTTP `201 Created` status code and a JSON response body that shows order and payment details.<blockquote><strong>Note:</strong> Applies to existing asynchronous payment processing integrations.</blockquote>",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pay_order_response"
}
}
}
},
"202": {
"description": "A successful request returns the HTTP `202 Accepted` status code and a JSON response body that shows order and payment details.<blockquote><strong>Note:</strong> Applies to existing asynchronous payment processing integrations.</blockquote>",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pay_order_response"
}
}
}
},
"default": {
"description": "The error response.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"parameters": [
{
"$ref": "#/components/parameters/order_id"
},
{
"$ref": "#/components/parameters/paypal_partner_attribution_id"
},
{
"$ref": "#/components/parameters/paypal_request_id"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pay_order_request"
}
}
},
"required": true
},
"security": [
{
"Oauth2": [
"https://uri.paypal.com/services/payments/payment",
"https://uri.paypal.com/services/payments/realtimepayment"
]
}
],
"tags": [
"orders-payment-actions"
]
}
}
},
"components": {
"securitySchemes": {
"Oauth2": {
"type": "oauth2",
"description": "Oauth 2.0 authentication",
"flows": {
"clientCredentials": {
"tokenUrl": "/v1/oauth2/token",
"scopes": {
"https://uri.paypal.com/services/payments/payment": "Manage payments and checkout workflow.",
"https://uri.paypal.com/services/payments/unilateralrefund": "This scope enables partners/facilitators to perform unilateralrefund and also refund.",
"https://uri.paypal.com/services/payments/funding-options": "Access payer's funding options available for the payment.",
"https://uri.paypal.com/services/payments/channelpartner": "Permission to explicitly specify the receiver of a payment on request payload.",
"https://uri.paypal.com/services/payments/partnerfee": "Permission to partners to withdraw partner fee as part of the payment.",
"https://uri.paypal.com/services/payments/realtimepayment": "Permission to do any real time payment, with support for sale/authorize/order intents"
}
}
}
}
},
"schemas": {
"error_details": {
"title": "Error Details",
"type": "object",
"description": "The error details. Required for client-side `4XX` errors.",
"properties": {
"field": {
"type": "string",
"description": "The field that caused the error. If this field is in the body, set this value to the field's JSON pointer value. Required for client-side errors."
},
"value": {
"type": "string",
"description": "The value of the field that caused the error."
},
"location": {
"$ref": "#/components/schemas/error_location"
},
"issue": {
"type": "string",
"description": "The unique, fine-grained application-level error code."
},
"description": {
"type": "string",
"description": "The human-readable description for an issue. The description can change over the lifetime of an API, so clients must not depend on this value."
}
},
"required": [
"issue"
]
},
"error_location": {
"type": "string",
"description": "The location of the field that caused the error. Value is `body`, `path`, or `query`.",
"enum": [
"body",
"path",
"query"
],
"default": "body"
},
"error_link_description": {
"title": "Link Description",
"description": "The request-related [HATEOAS link](/api/rest/responses/#hateoas-links) information.",
"type": "object",
"required": [
"href",
"rel"
],
"properties": {
"href": {
"description": "The complete target URL. To make the related call, combine the method with this [URI Template-formatted](https://tools.ietf.org/html/rfc6570) link. For pre-processing, include the `$`, `(`, and `)` characters. The `href` is the key HATEOAS component that links a completed call with a subsequent call.",
"type": "string",
"minLength": 0,
"maxLength": 20000,
"pattern": "^.*$"
},
"rel": {
"description": "The [link relation type](https://tools.ietf.org/html/rfc5988#section-4), which serves as an ID for a link that unambiguously describes the semantics of the link. See [Link Relations](https://www.iana.org/assignments/link-relations/link-relations.xhtml).",
"type": "string",
"minLength": 0,
"maxLength": 100,
"pattern": "^.*$"
},
"method": {
"description": "The HTTP method required to make the related call.",
"type": "string",
"minLength": 3,
"maxLength": 6,
"pattern": "^[A-Z]*$",
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH"
]
}
}
},
"error_400": {
"type": "object",
"title": "Bad Request Error",
"description": "Request is not well-formed, syntactically incorrect, or violates schema.",
"properties": {
"name": {
"type": "string",
"enum": [
"INVALID_REQUEST"
]
},
"message": {
"type": "string",
"enum": [
"Request is not well-formed, syntactically incorrect, or violates schema."
]
},
"details": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error_details"
}
},
"debug_id": {
"type": "string",
"description": "The PayPal internal ID. Used for correlation purposes."
},
"links": {
"description": "An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).",
"type": "array",
"minItems": 0,
"maxItems": 10000,
"items": {
"$ref": "#/components/schemas/error_link_description"
}
}
}
},
"error_401": {
"type": "object",
"title": "Unauthorized Error",
"description": "Authentication failed due to missing Authorization header, or invalid authentication credentials.",
"properties": {
"name": {
"type": "string",
"enum": [
"AUTHENTICATION_FAILURE"
]
},
"message": {
"type": "string",
"enum": [
"Authentication failed due to missing authorization header, or invalid authentication credentials."
]
},
"details": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error_details"
}
},
"debug_id": {
"type": "string",
"description": "The PayPal internal ID. Used for correlation purposes."
},
"links": {
"description": "An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).",
"type": "array",
"minItems": 0,
"maxItems": 10000,
"items": {
"$ref": "#/components/schemas/error_link_description"
}
}
}
},
"error_403": {
"type": "object",
"title": "Not Authorized Error",
"description": "The client is not authorized to access this resource, although it may have valid credentials. ",
"properties": {
"name": {
"type": "string",
"enum": [
"NOT_AUTHORIZED"
]
},
"message": {
"type": "string",
"enum": [
"Authorization failed due to insufficient permissions."
]
},
"details": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error_details"
}
},
"debug_id": {
"type": "string",
"description": "The PayPal internal ID. Used for correlation purposes."
},
"links": {
"description": "An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).",
"type": "array",
"minItems": 0,
"maxItems": 10000,
"items": {
"$ref": "#/components/schemas/error_link_description"
}
}
}
},
"error_404": {
"type": "object",
"title": "Not found Error",
"description": "The server has not found anything matching the request URI. This either means that the URI is incorrect or the resource is not available.",
"properties": {
"name": {
"type": "string",
"enum": [
"RESOURCE_NOT_FOUND"
]
},
"message": {
"type": "string",
"enum": [
"The specified resource does not exist."
]
},
"details": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error_details"
}
},
"debug_id": {
"type": "string",
"description": "The PayPal internal ID. Used for correlation purposes."
},
"links": {
"description": "An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).",
"type": "array",
"minItems": 0,
"maxItems": 10000,
"items": {
"$ref": "#/components/schemas/error_link_description"
}
}
}
},
"error_409": {
"type": "object",
"title": "Resource Conflict Error",
"description": "The server has detected a conflict while processing this request.",
"properties": {
"name": {
"type": "string",
"enum": [
"RESOURCE_CONFLICT"
]
},
"message": {
"type": "string",
"enum": [
"The server has detected a conflict while processing this request."
]
},
"details": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error_details"
}
},
"debug_id": {
"type": "string",
"description": "The PayPal internal ID. Used for correlation purposes."
},
"links": {
"description": "An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).",
"type": "array",
"minItems": 0,
"maxItems": 10000,
"items": {
"$ref": "#/components/schemas/error_link_description"
}
}
}
},
"error_415": {
"type": "object",
"title": "Unsupported Media Type Error",
"description": "The server does not support the request payload's media type.",
"properties": {
"name": {
"type": "string",
"enum": [
"UNSUPPORTED_MEDIA_TYPE"
]
},
"message": {
"type": "string",
"enum": [
"The server does not support the request payload's media type."
]
},
"details": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error_details"
}
},
"debug_id": {
"type": "string",
"description": "The PayPal internal ID. Used for correlation purposes."
},
"links": {
"description": "An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).",
"type": "array",
"minItems": 0,
"maxItems": 10000,
"items": {
"$ref": "#/components/schemas/error_link_description"
}
}
}
},
"error_422": {
"type": "object",
"title": "Unprocessable Entity Error",
"description": "The requested action cannot be performed and may require interaction with APIs or processes outside of the current request. This is distinct from a 500 response in that there are no systemic problems limiting the API from performing the request.",
"properties": {
"name": {
"type": "string",
"enum": [
"UNPROCESSABLE_ENTITY"
]
},
"message": {
"type": "string",
"enum": [
"The requested action could not be performed, semantically incorrect, or failed business validation."
]
},
"details": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error_details"
}
},
"debug_id": {
"type": "string",
"description": "The PayPal internal ID. Used for correlation purposes."
},
"links": {
"description": "An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).",
"type": "array",
"minItems": 0,
"maxItems": 10000,
"items": {
"$ref": "#/components/schemas/error_link_description"
}
}
}
},
"error_500": {
"type": "object",
"title": "Internal Server Error",
"description": "This is either a system or application error, and generally indicates that although the client appeared to provide a correct request, something unexpected has gone wrong on the server.",
"properties": {
"name": {
"type": "string",
"enum": [
"INTERNAL_SERVER_ERROR"
]
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred."
]
},
"debug_id": {
"type": "string",
"description": "The PayPal internal ID. Used for correlation purposes."
},
"links": {
"description": "An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).",
"type": "array",
"minItems": 0,
"maxItems": 10000,
"items": {
"$ref": "#/components/schemas/error_link_description"
}
}
},
"example": {
"name": "INTERNAL_SERVER_ERROR",
"message": "An internal server error occurred.",
"debug_id": "90957fca61718",
"links": [
{
"href": "https://developer.paypal.com/api/orders/v2/#error-INTERNAL_SERVER_ERROR",
"rel": "information_link"
}
]
}
},
"error_503": {
"type": "object",
"title": "Service Unavailable Error",
"description": "The server is temporarily unable to handle the request, for example, because of planned maintenance or downtime.",
"properties": {
"name": {
"type": "string",
"enum": [
"SERVICE_UNAVAILABLE"
]
},
"message": {
"type": "string",
"enum": [
"Service Unavailable."
]
},
"debug_id": {
"type": "string",
"description": "The PayPal internal ID. Used for correlation purposes."
},
"links": {
"description": "An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).",
"type": "array",
"minItems": 0,
"maxItems": 10000,
"items": {
"$ref": "#/components/schemas/error_link_description"
}
}
},
"example": {
"name": "SERVICE_UNAVAILABLE",
"message": "Service Unavailable.",
"debug_id": "90957fca61718",
"information_link": "https://developer.paypal.com/docs/api/orders/v2/#error-SERVICE_UNAVAILABLE"
}
},
"amount": {
"type": "object",
"title": "Amount",
"description": "The payment amount, with details.",
"additionalProperties": false,
"properties": {
"currency": {
"type": "string",
"description": "The [three-character ISO-4217 currency code](/docs/integration/direct/rest/currency-codes/). PayPal does not support all currencies."
},
"total": {
"type": "string",
"description": "The total amount charged to the payee by the payer. For refunds, represents the amount that the payee refunds to the original payer. Maximum length is 10 characters, which includes:<ul><li>Seven digits before the decimal point.</li><li>The decimal point.</li><li>Two digits after the decimal point.</li></ul>"
},
"details": {
"type": "object",
"title": "Payment Amount Details",
"description": "The additional details about the payment amount.",
"additionalProperties": false,
"properties": {
"subtotal": {
"type": "string",
"description": "The subtotal amount for the items. If the request includes line items, this property is **required**. Maximum length is 10 characters, which includes:<ul><li>Seven digits before the decimal point.</li><li>The decimal point.</li><li>Two digits after the decimal point.</li></ul>"
},
"shipping": {
"type": "string",
"description": "The shipping fee. Maximum length is 10 characters, which includes:<ul><li>Seven digits before the decimal point.</li><li>The decimal point.</li><li>Two digits after the decimal point.</li></ul>"
},
"tax": {
"type": "string",
"description": "The tax. Maximum length is 10 characters, which includes:<ul><li>Seven digits before the decimal point.</li><li>The decimal point.</li><li>Two digits after the decimal point.</li></ul>"
},
"handling_fee": {
"type": "string",
"description": "The handling fee. Maximum length is 10 characters, which includes:<ul><li>Seven digits before the decimal point.</li><li>The decimal point.</li><li>Two digits after the decimal point.</li></ul>Supported for the PayPal payment method only."
},
"shipping_discount": {
"type": "string",
"description": "The shipping fee discount. Maximum length is 10 characters, which includes:<ul><li>Seven digits before the decimal point.</li><li>The decimal point.</li><li>Two digits after the decimal point.</li></ul>Supported for the PayPal payment method only."
},
"insurance": {
"type": "string",
"description": "The insurance fee. Maximum length is 10 characters, which includes:<ul><li>Seven digits before the decimal point.</li><li>The decimal point.</li><li>Two digits after the decimal point.</li></ul>Supported only for the PayPal payment method."
},
"gift_wrap": {
"type": "string",
"description": "The gift wrap fee. Maximum length is 10 characters, which includes:<ul><li>Seven digits before the decimal point.</li><li>The decimal point.</li><li>Two digits after the decimal point.</li></ul>"
}
}
}
},
"required": [
"currency",
"total"
]
},
"payee_display_metadata": {
"type": "object",
"title": "Payee Display Metadata",
"description": "The display-only metadata for the payee.",
"properties": {
"email": {
"type": "string",
"format": "email",
"description": "The email address for the payer. Maximum length is 127 characters."
},
"display_phone": {
"type": "object",
"title": "Display Phone",
"description": "The payee's phone number.",
"properties": {
"country_code": {
"type": "string",
"description": "The [two-character IS0-3166-1 country code](https://developer.paypal.com/docs/integration/direct/rest/country-codes/) of the payee's country."
},
"number": {
"type": "string",
"description": "The in-country phone number, in [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164-201011-I)."
}
}
},
"brand_name": {
"type": "string",
"description": "The payer's business name."
}
}
},
"payee": {
"type": "object",
"title": "Payee",
"description": "The payee who receives the funds and fulfills the order.",
"properties": {
"email": {
"type": "string",
"format": "email",
"description": "The email address associated with the payee's PayPal account. For an intent of authorize or order, the email address must be associated with a confirmed PayPal business account. For an intent of sale, the email can either:<ul><li>Be associated with a confirmed PayPal personal or business account.</li><li>Not be associated with a PayPal account.</li></ul>"
},
"merchant_id": {
"type": "string",
"description": "The encrypted PayPal account ID for the payee."
},
"payee_display_metadata": {
"$ref": "#/components/schemas/payee_display_metadata"
}
}
},
"item": {
"type": "object",
"title": "Item",
"description": "The item details.",
"properties": {
"sku": {
"type": "string",
"description": "The stock keeping unit (SKU) for the item.",
"maxLength": 127
},
"name": {
"type": "string",
"description": "The item name. Maximum length is 127 characters."
},
"description": {
"type": "string",
"description": "The item description. Supported only for the PayPal payment method.",
"maxLength": 127
},
"quantity": {
"type": "string",
"description": "The item quantity. Must be a whole number.",
"maxLength": 10,
"pattern": "^[0-9]{0,10}$"
},
"price": {
"type": "string",
"description": "The item cost. Supports two decimal places.",
"maxLength": 10,
"pattern": "^[0-9]{0,10}(\\.[0-9]{0,2})?$"
},
"currency": {
"type": "string",
"description": "The [three-character ISO-4217 currency code](/docs/integration/direct/rest/currency-codes/)."
},
"tax": {
"type": "string",
"description": "The item tax. Supported only for the PayPal payment method."
},
"url": {
"type": "string",
"format": "uri",
"description": "The URL to item information. Available to the payer in the transaction history."
}
},
"required": [
"quantity",
"name",
"price",
"currency"
]
},
"country_code": {
"type": "string",
"description": "The [two-character ISO 3166-1 code](/docs/integration/direct/rest/country-codes/) that identifies the country or region.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and not <code>UK</code> as used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.</blockquote>",
"format": "ppaas_common_country_code_v2",
"maxLength": 2,
"minLength": 2,
"pattern": "^([A-Z]{2}|C2)$"
},
"address": {
"type": "object",
"title": "Address",
"description": "The billing address or shipping address for a payment.",
"properties": {
"line1": {
"type": "string",
"description": "The first line of the address. For example, number, street, and so on."
},
"line2": {
"type": "string",
"description": "The second line of the address. For example, suite or apartment number."
},
"city": {
"type": "string",
"description": "The city name."
},
"country_code": {
"$ref": "#/components/schemas/country_code"
},
"postal_code": {
"type": "string",
"description": "The postal code, which is the zip code or equivalent. Typically required for countries with a postal code or an equivalent. See [postal code](https://en.wikipedia.org/wiki/Postal_code)."
},
"state": {
"type": "string",
"description": "The [code](/docs/integration/direct/rest/state-codes/) for a US state or the equivalent for other countries. Required for transactions if the address is in one of these countries: [Argentina](/docs/integration/direct/rest/state-codes/#argentina), [Brazil](/docs/integration/direct/rest/state-codes/#brazil), [Canada](/docs/integration/direct/rest/state-codes/#canada), [India](/docs/integration/direct/rest/state-codes/#india), [Italy](/docs/integration/direct/rest/state-codes/#italy), [Japan](/docs/integration/direct/rest/state-codes/#japan), [Mexico](/docs/integration/direct/rest/state-codes/#mexico), [Thailand](/docs/integration/direct/rest/state-codes/#thailand), or [United States](/docs/integration/direct/rest/state-codes/#usa). Maximum length is 40 single-byte characters."
},
"phone": {
"type": "string",
"format": "phone",
"description": "The phone number, in [E.123 format](https://www.itu.int/rec/T-REC-E.123-200102-I/en). Maximum length is 50 characters."
},
"normalization_status": {
"type": "string",
"description": "The address normalization status. Returned only for payers from Brazil.",
"readOnly": true,
"enum": [
"UNKNOWN",
"UNNORMALIZED_USER_PREFERRED",
"NORMALIZED",
"UNNORMALIZED"
]
},
"type": {
"type": "string",
"description": "The type of address. For example, `HOME_OR_WORK`, `GIFT`, and so on."
}
},
"required": [
"line1",
"country_code"
]
},
"shipping_address": {
"title": "Shipping Address",
"description": "The shipping address details.",
"allOf": [
{
"$ref": "#/components/schemas/address"
},
{
"properties": {
"recipient_name": {
"type": "string",
"description": "The name of the recipient at this address.",
"maxLength": 127