-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
big-openapi.json
27363 lines (27363 loc) · 838 KB
/
big-openapi.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.0",
"servers": [
{
"url": "//api.rebilly.com/v2.1",
"description": "Live Server"
},
{
"url": "//api-sandbox.rebilly.com/v2.1",
"description": "Sandbox Server"
}
],
"info": {
"version": "2.1",
"title": "Rebilly REST API",
"contact": {
"name": "Rebilly API Support",
"url": "https://www.rebilly.com/contact/",
"email": "integrations@rebilly.com"
},
"license": {
"name": "Rebilly",
"url": "https://my.rebilly.com/api/license/"
},
"termsOfService": "https://www.rebilly.com/terms/",
"x-logo": {
"url": "https://rebilly.github.io/RebillyAPI/rb_apiLogo.svg",
"backgroundColor": "#0033A0",
"altText": "Rebilly API logo"
},
"description": "# Introduction\nThe Rebilly API is built on HTTP. Our API is RESTful. It has predictable\nresource URLs. It returns HTTP response codes to indicate errors. It also\naccepts and returns JSON in the HTTP body. You can use your favorite\nHTTP/REST library for your programming language to use Rebilly's API, or\nyou can use one of our SDKs (currently available in [PHP](https://github.com/Rebilly/rebilly-php)\nand [C#](https://github.com/Rebilly/rebilly-dotnet-client)).\n\n# Authentication\nWhen you sign up for an account, you are given your first API key.\nYou can generate additional API keys, and delete API keys (as you may\nneed to rotate your keys in the future). You authenticate to the\nRebilly API by providing your secret key in the request header.\n\nRebilly offers three forms of authentication: private key, JSON Web Tokens, and\npublic key.\n- private key: authenticates each request by searching for the presence\nof an HTTP header: REB-APIKEY.\n- JWT: authenticates each request by the HTTP header: Authorization.\n- public key: authenticates by the HTTP header: REB-AUTH (read more on this below).\n\nRebilly also offers JSON Web Tokens (JWT) authentication, where you can control\nthe specific granular permissions and expiration for that JWT. We call our resource\nfor generating JWT [Sessions](#tag/Sessions).\n\nRebilly also has a client-side authentication scheme that uses an\napiUser and HMAC-SHA1 signature (only for the Tokens resource), so\nthat you may safely create tokens from the client-side without compromising\nyour secret keys.\n\nNever share your secret keys. Keep them guarded and secure.\nThe client-side authentication scheme uses one HTTP header named REB-AUTH.\n\n\n\n# PHP SDK\nFor all PHP SDK examples provided in this spec you will need to configure `$client`.\nYou may do it like this:\n\n```php\n$client = new Rebilly\\Client([\n 'apiKey' => 'YourApiKeyHere',\n 'baseUrl' => 'https://api.rebilly.com',\n]);\n```\n"
},
"tags": [
{
"name": "3D Secure",
"description": "3D Secure is a way to authenticate and protect transactions. Typically,\nit's only possible to protect the initial transaction in a subscription\nwith 3D Secure.\n"
},
{
"name": "API Keys",
"description": "Always keep your API Keys private. In addition to your API Keys, you may use\nJSON Web Tokens (JWT) to authenticate to the API. See\nour [Sessions](#tag/Sessions) resource for more information.\n"
},
{
"name": "Bank Accounts",
"description": "Bank Accounts are a type of payment instrument used to collect\nACH (echeck) payments, similar to how a payment\ncard would be used to for a credit card payment.\n"
},
{
"name": "Blacklists",
"description": "Your blacklists contains values of customerIds, email addresses,\nipAddresses, bank identification numbers, countries or payment cards that\nyou do NOT want to do business with. They are a good tool for managing\nrisk. A blacklist entry that expires after a period of time we call a\ngreylist.\n"
},
{
"name": "Checkout Pages",
"description": "Hosted checkout pages.\n"
},
{
"name": "Contacts",
"description": "Contacts are Customer's address book.\nAll contact information used in Invoices, Subscriptions, Transacions, etc is enlisted here. However, changing a Contact won't change corresponding contact information in related resources\n"
},
{
"name": "Coupons",
"description": "Coupons allows to apply different types of discounts to Invoices, Subscriptions and Plans. Redeemed Coupons will be applied only to Invoices with the same currency.\n"
},
{
"name": "Customers",
"description": "Customers are your customers, sometimes known as accounts, clients,\nmembers, patrons, or players in other systems.\n"
},
{
"name": "Customer Authentication",
"description": "Create authentication credentials, login, logout, and verify your customers.\n"
},
{
"name": "Custom Events",
"description": "If system events can't solve your problems, you are able to create a custom event\nthat can fit your requirements, and use it to solve your own business logic.\n"
},
{
"name": "Custom Rules",
"description": "\"Don't conform to the rules. Create the rules.\"\nRather than adapt your workflow and business, Rebilly can align with your business\nobjectives by giving you the power to automate certain behaviors when key events happen.\nYou can use this to your advantage to mitigate risk, maximize conversions and minimize costs.\nYou have the controls at your fingertips here. If you need more control,\nor help dialing in on a strategy, feel free to contact us.\n\nWhen an event happens, it triggers the evaluation of conditions (that you set up),\nin order from top to bottom. If the condition is met, the corresponding actions are executed.\nThe conditions continue to be checked until either all of the conditions have been executed,\nor a special \"stop\" action is executed.\n"
},
{
"name": "Custom Fields",
"description": "Create additional custom fields for particular resources. You may name,\ndescribe, and determine the type of the schema.\n"
},
{
"name": "Credential Hashes",
"description": "Get and create SMTP and Webhook credential hashes.\n"
},
{
"name": "Disputes",
"description": "Handle disputes (chargebacks and retrievals).\n"
},
{
"name": "Email Credentials",
"description": "Send automated emails through our system by connecting to your third party\nSMTP server (or your third party email service provider's SMTP server).\n"
},
{
"name": "Files",
"description": "A File is an entity that can store a physical file and some metadata. It also provides an easy access to\nits size, mime-type, user-defined tags and description thus allowing easy sorting and searching among stored\nfiles.\nThere are several methods of file uploading available: multipart/form-data encoded form, RAW POST (by sending\nfile contents as POST body), fetching from URL (by providing the file URL via 'url' param)\nAttachment is an entity that is used to link a File to one or multiple objects like Customer, Dispute, Payment,\nTransaction, Subscription, Plan, Product, Invoice, Note. That allows to quickly find and use files related to\nthose specific entities.\n"
},
{
"name": "Gateway Accounts",
"description": "Gateway accounts connect payment request to third party networks and platforms.\n"
},
{
"name": "Invoices",
"description": "Invoices leave a record for both you and your customer of the products sold.\n"
},
{
"name": "Layouts",
"description": "Layouts are used to hold collections of plans. A layout can be used to\npower a pricing page. You can make multiple layouts, and use rules to\ntarget them to different audiences.\n"
},
{
"name": "Lists",
"description": "Lists contain sets of values and may be referenced within Rules criteria.\n\nYou may grant permissions to edit Lists to different people than those who can edit Rules.\nIt may be useful if your workflow involves frequent updates to value sets used in criteria.\n"
},
{
"name": "Migrate payment cards",
"description": "Migrate payment cards from one gateway to another.\n"
},
{
"name": "Notes",
"description": "Leave notes on a customer record to have a handy location to share with\nothers who may interface with the customer. It's great for customer service.\n"
},
{
"name": "Organizations",
"description": "Organizations include the name and address of the entities related to your\naccount. An account may be multi-national, and support multiple\norganizations. Note: Organizations are share between \"Live\" and \"Sandbox\"\n"
},
{
"name": "Payments",
"description": "Collect money from your customers with payments. You can schedule a payment\nto occur in the future. You can assign a dunning schedule to a payment to collect\nin the case of a decline.\n\nSome payments may be, what we term, suspended payments. These types of payments\nrequire user interaction. For example, an initial PayPal purchase, a 3D Secure\npurchase, China Union Pay, and more require the customer's interaction to\ncomplete the payment. We call these a \"suspended\" payment flow.\n"
},
{
"name": "Payment Cards",
"description": "Payment cards are a type of payment instrument used for credit and debit card\nsales. Rebilly securely vaults the full payment card number, and can pass it\nonward securely to any gateway account to transact business.\n"
},
{
"name": "Payment Tokens",
"description": "Payment tokens are used to reduce the scope of PCI DSS compliance. A payment\ntoken can be made using a different authentication scheme (refer to the public key\nauthentication scheme in the Authentication section), which allows you to\ncreate a payment token directly from the browser, bypassing the need to send\nsensitive cardholder info to your servers. We recommend using this with our\nRebilly.js library, which helps you wire a form into this API resource and create\npayment tokens.\n"
},
{
"name": "Plans",
"description": "Plans are a template for making a subscription. For example, you may have a plan\nthat has a 30-day free trial followed by a recurring charge of $19.95 per month\nuntil canceled. The combination of the plan and a request to make a subscription\nwill apply those instructions to create the invoices according to the plan's\nschedule.\n"
},
{
"name": "Products",
"description": "Proposed: Your product includes digital goods, services, and physical goods.\n"
},
{
"name": "Reports",
"description": "The Rebilly Reporting API is currently experimental. You may see\nthe [Reports API Documentation here](https://rebilly.github.io/RebillyReportsAPI/).\n"
},
{
"name": "Rules",
"description": "\"Don't conform to the rules. Create the rules.\"\nRather than adapt your workflow and business, Rebilly can align with your business\nobjectives by giving you the power to automate certain behaviors when key events happen.\nYou can use this to your advantage to mitigate risk, maximize conversions and minimize costs.\nYou have the controls at your fingertips here. If you need more control,\nor help dialing in on a strategy, feel free to contact us.\n\nWhen an event happens, it triggers the evaluation of conditions (that you set up),\nin order from top to bottom. If the condition is met, the corresponding actions are executed.\nThe conditions continue to be checked until either all of the conditions have been executed,\nor a special \"stop\" action is executed.\n"
},
{
"name": "Sessions",
"description": "A session contains a token, which is a JSON Web Token. The token is created\nwith a user's signin credentials.\n\nThis token can be used to authenticate to the API. In addition, the session can be set to\nexpire at a particular time, and has very granular control over permissions.\nUse the token to then authenticate for further requests to the Rebilly API.\n\nThe token should be kept private, but could be stored on the user's browser\nclient to simulate a \"session.\"\n"
},
{
"name": "Shipping Zones",
"description": "A shipping zone contains regions and countries that you ship to. Each shipping zone has its own shipping rates.\n"
},
{
"name": "Status",
"description": "Check the status of the Rebilly API (no authentication required).\n"
},
{
"name": "Subscriptions",
"description": "A subscription applies a plan's template to create invoices for a customer at the\nappropriate scheduled intervals. A subscription may also determine if the payment\nis collected automatically (with autopay set true).\n"
},
{
"name": "Taxes",
"description": "Proposed: You can map a product to a tax category. The tax category is used by\ntax providers to calculate taxes for invoices.\n"
},
{
"name": "Tracking",
"description": "Tracking is a layer for accessing all the activity (API requests,\nsubscriptions, webhooks, events, etc.), thus providing easier\ndebugging and issues auditing.\n"
},
{
"name": "Transactions",
"description": "Get and refund transactions.\n"
},
{
"name": "Users",
"description": "A User represents a person who can login to Rebilly, and take actions subject to\ntheir granted permissions.\n"
},
{
"name": "Websites",
"description": "A Website represents the website/brand that customers interact with... You\ncould think of it like a brand. For example, Nestle owns Perrier and Purina\nand PowerBar.\n\nWe recognize that some enterprises have more than one website (or brand). The\nwebsite is related to each invoice and each payment gateway account. This feature\nwould allow you to have gateway accounts that are related to multiple websites, or\nexclusive to particular websites. And gives you more control over your business.\n"
},
{
"name": "Webhooks",
"description": "Webhooks are designed to notify your systems when certain/all registered events happen in near real-time.\nThey allow you to collect information about those events. Rebilly can send these information via\nPOST to an URL of your choice.\n"
}
],
"security": [
{
"ApiKey": []
}
],
"paths": {
"/3dsecure": {
"get": {
"tags": [
"3D Secure"
],
"summary": "Retrieve a list of ThreeDSecure entries",
"parameters": [
{
"$ref": "#/components/parameters/collectionLimit"
},
{
"$ref": "#/components/parameters/collectionOffset"
}
],
"responses": {
"200": {
"description": "A list was retrieved successfully",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
},
"Pagination-Total": {
"description": "Total items count",
"schema": {
"type": "integer"
}
},
"Pagination-Limit": {
"description": "Items per page limit",
"schema": {
"type": "integer"
}
},
"Pagination-Offset": {
"description": "Pagination offset",
"schema": {
"type": "integer"
}
}
},
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ThreeDSecure"
}
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
}
}
},
"post": {
"tags": [
"3D Secure"
],
"summary": "Create a ThreeDSecure entry",
"description": "Create a ThreeDSecure entry\n",
"responses": {
"201": {
"description": "ThreeDSecure entry was created",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ThreeDSecure"
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
},
"422": {
"$ref": "#/components/responses/InvalidDataError"
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ThreeDSecure"
}
}
},
"description": "ThreeDSecure resource",
"required": true
}
}
},
"/3dsecure/{id}": {
"parameters": [
{
"$ref": "#/components/parameters/resourceId"
}
],
"get": {
"tags": [
"3D Secure"
],
"summary": "Retrieve a ThreeDSecure entry",
"description": "Retrieve a ThreeDSecure entry with specified identifier string\n",
"responses": {
"200": {
"description": "ThreeDSecure entry was retrieved successfully",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ThreeDSecure"
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
}
}
}
},
"/activation/{token}": {
"parameters": [
{
"name": "token",
"in": "path",
"description": "The token string",
"required": true,
"schema": {
"type": "string"
}
}
],
"post": {
"tags": [
"Users"
],
"summary": "Sends a token to activate user account",
"description": "Sends a token to activate user account\n",
"security": [
{
"RebAuth": []
}
],
"responses": {
"204": {
"description": "User account was activated",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
}
},
"422": {
"description": "Invalid token was sent",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidError"
}
}
}
}
},
"x-code-samples": [
{
"lang": "PHP",
"source": "try {\n $client->users()->activate('token');\n} catch (UnprocessableEntityException $e) {\n echo $e->getMessage();\n}\n"
}
]
}
},
"/api-keys": {
"get": {
"tags": [
"API Keys"
],
"summary": "Retrieve a list of api keys",
"description": "Retrieve a list of api keys\n",
"parameters": [
{
"$ref": "#/components/parameters/collectionLimit"
},
{
"$ref": "#/components/parameters/collectionOffset"
}
],
"responses": {
"200": {
"description": "A list of api keys was retrieved successfully",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
},
"Pagination-Total": {
"description": "Total items count",
"schema": {
"type": "integer"
}
},
"Pagination-Limit": {
"description": "Items per page limit",
"schema": {
"type": "integer"
}
},
"Pagination-Offset": {
"description": "Pagination offset",
"schema": {
"type": "integer"
}
}
},
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
}
},
"x-code-samples": [
{
"lang": "PHP",
"source": "$apiKeys = $client->apiKeys()->search([\n 'filter' => 'description:Test',\n]);\n"
}
]
},
"post": {
"tags": [
"API Keys"
],
"summary": "Create an api key",
"description": "Create an api key\n",
"responses": {
"201": {
"description": "Api Key was created",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
},
"422": {
"description": "Invalid data was sent",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidError"
}
}
}
}
},
"x-code-samples": [
{
"lang": "PHP",
"source": "$apiKeyForm = new Rebilly\\Entities\\ApiKey();\n$apiKeyForm->setDescription('Test');\n$apiKeyForm->setDatetimeFormat($apiKeyForm::DATETIME_FORMAT_MYSQL);\n\ntry {\n $apiKey = $client->apiKeys()->create($apiKeyForm);\n} catch (UnprocessableEntityException $e) {\n echo $e->getMessage();\n}\n"
}
],
"requestBody": {
"$ref": "#/components/requestBodies/ApiKey"
}
}
},
"/api-keys/{id}": {
"parameters": [
{
"$ref": "#/components/parameters/resourceId"
}
],
"get": {
"tags": [
"API Keys"
],
"summary": "Retrieve api key",
"description": "Retrieve api key with specified identifier string\n",
"responses": {
"200": {
"description": "Api key was retrieved successfully",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
}
},
"x-code-samples": [
{
"lang": "PHP",
"source": "$apiKeys = $client->apiKeys()->load('apiKeyID');\n"
}
]
},
"put": {
"tags": [
"API Keys"
],
"summary": "Create or update api key with predefined ID",
"description": "Create or update api key with predefined identifier string\n",
"responses": {
"200": {
"description": "ApiKey was updated",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
},
"201": {
"description": "ApiKey was created",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"422": {
"$ref": "#/components/responses/InvalidDataError"
}
},
"x-code-samples": [
{
"lang": "PHP",
"source": "$apiKeyForm = new Rebilly\\Entities\\ApiKey();\n$apiKeyForm->setDescription('TestPut');\n$apiKeyForm->setDatetimeFormat($apiKeyForm::DATETIME_FORMAT_MYSQL);\n\ntry {\n $apiKey = $client->apiKeys()->update('apiKeyID', $apiKeyForm);\n} catch (UnprocessableEntityException $e) {\n echo $e->getMessage();\n}\n"
}
],
"requestBody": {
"$ref": "#/components/requestBodies/ApiKey"
}
},
"delete": {
"tags": [
"API Keys"
],
"summary": "Delete api key",
"description": "Delete api key with predefined identifier string\n",
"responses": {
"204": {
"description": "ApiKey was deleted",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"409": {
"$ref": "#/components/responses/Conflict"
}
},
"x-code-samples": [
{
"lang": "PHP",
"source": "$client->apiKeys()->delete('apiKeyID');\n"
}
]
}
},
"/attachments": {
"get": {
"tags": [
"Files"
],
"summary": "Retrieve a list of Attachments",
"description": "Retrieve a list of Attachments\n",
"parameters": [
{
"$ref": "#/components/parameters/collectionLimit"
},
{
"$ref": "#/components/parameters/collectionOffset"
},
{
"$ref": "#/components/parameters/collectionFilter"
},
{
"$ref": "#/components/parameters/collectionQuery"
},
{
"$ref": "#/components/parameters/collectionExpand"
},
{
"$ref": "#/components/parameters/collectionFields"
},
{
"name": "sort",
"in": "query",
"description": "The collection items sort field and order (prefix with \"-\" for descending sort).",
"style": "form",
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"id",
"-id",
"name",
"-name",
"relatedId",
"-relatedId",
"relatedType",
"-relatedType",
"fileId",
"-fileId",
"createdTime",
"-createdTime",
"updatedTime",
"-updatedTime"
]
}
}
}
],
"responses": {
"200": {
"description": "A list of Attachments was retrieved successfully",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
},
"Pagination-Total": {
"description": "Total items count",
"schema": {
"type": "integer"
}
},
"Pagination-Limit": {
"description": "Items per page limit",
"schema": {
"type": "integer"
}
},
"Pagination-Offset": {
"description": "Pagination offset",
"schema": {
"type": "integer"
}
}
},
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Attachment"
}
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
}
},
"x-code-samples": [
{
"lang": "PHP",
"source": "$attachments = $client->attachments()->search([\n 'filter' => 'relatedType:customer',\n]);\n"
}
]
},
"post": {
"tags": [
"Files"
],
"summary": "Create an Attachment",
"description": "Create an Attachment\n",
"responses": {
"201": {
"description": "Attachment was created",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
},
"422": {
"$ref": "#/components/responses/InvalidDataError"
}
},
"x-code-samples": [
{
"lang": "PHP",
"source": "$attachmentForm = new Rebilly\\Entities\\Attachment();\n$attachmentForm->setFileId('fileId');\n$attachmentForm->setRelatedType($attachmentForm::TYPE_CUSTOMER);\n$attachmentForm->setRelatedId('customerId');\n\ntry {\n $attachment = $client->attachments()->create($attachmentForm);\n} catch (UnprocessableEntityException $e) {\n echo $e->getMessage();\n}\n"
}
],
"requestBody": {
"$ref": "#/components/requestBodies/Attachment"
}
}
},
"/attachments/{id}": {
"parameters": [
{
"$ref": "#/components/parameters/resourceId"
}
],
"get": {
"tags": [
"Files"
],
"summary": "Retrieve an Attachment",
"description": "Retrieve a Attachment with specified identifier string\n",
"responses": {
"200": {
"description": "Attachment was retrieved successfully",
"headers": {
"Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Remaining": {
"description": "The number of remaining requests in the current period",
"schema": {
"type": "integer"
}
},
"Rate-Limit-Reset": {
"description": "The date in format defined by [RFC 822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)\nwhen the current period will reset\n",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
}
},
"401": {
"$ref": "#/components/responses/AccessForbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
}