This repository was archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.yaml
More file actions
1980 lines (1791 loc) · 70.9 KB
/
swagger.yaml
File metadata and controls
1980 lines (1791 loc) · 70.9 KB
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
---
swagger: "2.0"
info:
title: Charge Payments
description: |

---
## Authorization
To use the gateway APIs you will need an **API Token**, which can be requested to support or navigating on your gateway account to Users > Details > Api Token.
With that token, you’ll be able to access our API. You should send your key in every request to our API, in order to authenticate and identify yourself. For every request, you should pass the Authorization HTTP Header containing your token, prefixed by “Bearer “ string. Example below:
`curl -H 'Authorization: Bearer YOUR_API_TOKEN' https://gateway-api.charge.io/api/transactions`
An authentication error message would return a message like the following:
```
{
"error": {
"status": 401,
"message": {
"base": [
"Not authenticated"
]
}
}
}
```
Please note that the error messages that use the same structure of an **error** node will display a **message** node. The message displayed will result when the incorrect syntax is used in the desired field. A **base** error is a general error that cannot be related to any field submitted The **fatal** node is a system error that will occur when the incorrect format is entered into a field, such as when letters are used in the **amount** field. This will result in a system error. All messages also contain an HTTP status follow W3C recommendations, e.g. an unauthenticated request will issue an HTTP status 401.
We include the HTTP status on the JSON message, as well as on the headers of all JSON error responses.
You must replace **YOUR_API_TOKEN** with your personal API key.
#### Rate limiting
Please note that API requests are rate-limited for security purposes. By default, you are not allowed to submit more than 60 requests per minute. **X-RateLimit-Limit** and **X-RateLimit-Remaining** headers are always present on the API responses so you can better manage your requests and put together a timing strategy. If that limit is exceeded, the server will return HTTP Status 429 and data will not be submitted to the processor. Our recommendation is using an exponential backoff strategy to make sure you do not over exceed the limits as this may result in permanent blacklisting.
```
{
"error": {
"status": 429,
"message": {
"base": [
"Too Many Attempts."
]
}
}
}
```
If you need a limit higher than 60req/min, please contact us with reasoning for the upgrade.
---
## Test Card Numbers
In order to help customers with the integration process with our API, the following list contains card numbers that can be used for testing purposes.
<table>
<tr>
<td><b/>Credit Card Brand</td><td><b/>PAN</td><td><b/>EXP</td><td><b/>CVV</td>
</tr>
<tr><td><b/>Visa</td> <td>4111111111111111</td> <td>01/21</td> <td>999</td></tr>
<tr><td><b/>MasterCard</td> <td>5499740000000057</td> <td>02/22</td> <td>998</td></tr>
<tr><td><b/>AMEX</td> <td>371449635392376</td> <td>03/23</td> <td>9997</td></tr>
<tr><td><b/>Discover</td> <td>6011000993026909</td> <td>12/20</td> <td>966</td></tr>
<tr><td><b/>Diners</td> <td>3055155515160018</td> <td>12/20</td> <td>966</td></tr>
<tr><td><b/>JCB</td> <td>3530142019945859</td> <td>12/20</td> <td>966</td></tr>
</table><br/>
**Important - Relevant Information for Skrill**
For tests purposes in Skrill you should use any valid date in the future (formatted as MM/YY) as **EXP**, a random number as **CVV** and any of the card numbers in the following list:
<table>
<tr>
<td><b/>Credit Card Brand</td><td><b/>PAN</td>
</tr>
<tr><td><b/>MasterCard for Skrill</td> <td>5438311234567890</td>
<tr><td><b/>Visa for Skrill</td> <td>4000001234567890</td>
<tr><td><b/>Amex for Skrill</td> <td>371234500012340</td>
</table><br/>
**APPROVAL/DECLINES**
* every single transaction with valid test cards should approve
* whenever amount is greater than 999999.99, decline
* if CVV doesn’t match the above test cards, decline
**AVS**
* whenever enabled and **street_address_1 = 59 North Santa Cruz Av** and **state = CA** and **zip = 95030**, full avs match
* whenever enabled and **street_address_1 = anything** and **state = CA** and **zip = 95030**, partial match
* enabled and anything else no match
---
## Card Transactions
Before starting up with actual API documentation, there are a few concepts that must be understood. On credit card processing, there are two main concepts which are fundamental parts of how funds go from the customer’s credit card to the merchant’s bank. Those are:
**Authorization**: performing a debit or credit on a credit card to test fund availability without actually deducting the funds from the card. This means the amount is blocked and cannot be used.
**Settlement**: the process of grouping all authorizations performed that day into a batch of transactions that is submitted to the processor to deduct the funds from the cardholders; typically processed nightly.
In order to keep those two concepts completely manageable for the merchant, the Charge Gateway has implemented a Transaction Event concept which is an append-only log that keeps the whole transaction lifecycle intact. There are five different types of these events:
* An **auth** which stands for an authorization debit, with no settlement;
* A **capture** which stands for an actual debit, by promoting a transaction with an **auth** event to settlement;
* **sale** requests are exactly the combination of **auth** and **capture**, meaning it authorizes and flags that event for settlement;
* A **void** which is an authorization credit, that cancels partially or fully a previous **auth** event;
* **refund** stands for an authorization credit, plus an actual credit since it sends that record for settlement. It should be run after a **capture** or **sale**.
**Examples**
**Scenario #1** Let’s say you want to charge a customer card for $10.00 and deduct those funds immediately our of their account. Then, on the next day, after settlement, you want to refund $5.00 to that customer. To accomplish that, you’ll run a **sale** event for $10.00 (which would both authorize the amount and flag it for batch settlement later that day) and then, on the next day, you could run a **refund** event for $5.00, and on the day after those funds would be credited back to your customer.
**Scenario #2** Let’s say you want to authorize a customer card for $500.00 for a hotel room. Eventually, whenever that customer does the checkout, you’ll just bill $400.00. In that case, you could run an **auth** request for $500.00. After that, you’ll run a **capture** for $400.00. Once the customer does the checkout, you can **void** the missing $100.00.
#### Charge a Credit Card
Charging a credit card using Charge gateway is simple. In this case, we’re performing a straight capture, so it’s an authorization and also a settlement request. If you’re looking just to authorize a certain amount, and then charge later, see **Authorize and Charge later**
#### Authorize and Charge Later
**Default Behavior**
In order to charge later, you need to make two requests: first an **auth** request, which blocks balance on customer’s credit card, and then run **capture** request, to flag the authorization for settlement.
#### Capture Transaction
After running the auth transaction event, you should be able to capture the funds. Use the transaction ID sent back in the response to capture the desired amount.
#### Voiding a Transaction
A void is only possible after a transaction has been created through auth request. Once that’s done, you should use the transaction ID response field to reference the transaction being voided. A void simply cancels a previously made authorization and releases the authorized balance on the customer’s card.
#### Refunding a Transaction
A refund should be ran when running a reversal for a transaction that has a **capture** or **sale** event. A **refund** flags the transaction to be sent for settlement and returns the funds to the customer.
#### Passing 3D Secure Data
3D Secure is a method to shift fraud liability from the merchant’s sphere to the issuing bank or card brand sphere. That means whenever a 3D Secure protected transaction is provided to the processor and authorized, that transaction cannot become a dispute or a chargeback, as the card brand and the issuing bank previously approved it from happening. All this happens in real-time, in a variety of methods.
EMV 3DS is the upgraded version of the protocol, also known as 3DS2, 3DS V2 or 3DS 2.0.
When running 3D Secure authenticated transactions you should pass the MPI/ACS response to the gateway. Possible outcomes for a 3D Secure transaction are:
* attempted which is returned whenever a 3DS request has been attempted but not fully validated by the card brand or issuer;
* failed is returned whenever the card brand or issuer denied the transaction from happening;
* success is returned whenever the transaction has been successfully protected and liability has been shifted;
* error means the processor, issuer or card brand systems returned an error with the provided data;
* unavailable means that 3DS is not available for the provided card.
This should be done either during a **auth** or **sale** event. Besides passing all fields for these event types, you will also need to pass the fields described below. All this data is provided by your 3DS MPI, after running the Payment Authentication Response (PaRes).
#### Address Verification
Address Verification Service is one way to confirm customer identity and remove fraud, while decreasing interchange rates. By providing the customer’s full address, you add another layer of security and consequently fetch more data from the processors, while protecting you from fraud. Our address verification service returns five different statuses to identify the outcome of an AVS request attempt: **exact_match**, **partial_match**, **no_match**, **error** and **unavailable**.
* exact_match is returned whenever the address matches the records. That usually means the address, city, state, country and postal code match;
* partial_match is returned whenever the processor is able to match parts of the information provided;
* no_match is returned whenever there aren’t records matching the data provided;
* error means the processor or issuer systems returned an error with the provided data;
* unavailable means that AVS is not available for the provided card.
AVS should be done either during a **auth** or **sale** event. Besides passing all fields for these event types, you will also need to pass the fields described below.
#### Airline & Travel Data
Charge Gateway™ has some built-in features for the Airline and Travel industries. Whenever submitting a transaction for those industries, you can pass additional information which will both populate on our Gateway’s user interface and also on the customer’s credit card statement, besides sending additional data to the processors which help on reconciliation, dispute, risk, fraud mitigation and chargeback representment processes. This data includes:
* Passenger name and ticket details such as ticket number, issuing city, carrier and date;
* Restricted ticket indicators (for tickets that cannot be refunded);
* Leg information such as carrier code, service class, departure and destination airports and fares;
For each passenger you want to use the reporting capabilities, you should be submitting an object under the **passenger_transport** field. As for each leg, you should be submitting information under the passenger record, even if all passengers are doing the same itinerary.
Make sure that the **processor_id** being used for this feature has industry field as **passenger_transport**.
#### Dynamic Descriptors
A dynamic descriptor is a string passed to the processor to be displayed on the customer’s card statement while overriding default information such as the merchant’s name, merchant phone, website or city. Our dynamic descriptor implementation uses a pipe element | to separate the name from the contact info (which may be the city, phone or website). So for example, a dynamic descriptor passed as MYBUSINESSINC|123-1231234 will be interpreted at processor level as **name=MYBUSINESSINC** and contact **info=123-1231234**.
**Each processor has it's own constraints for showing up data, and sometimes this also varies by card issuer.**
#### Using Tokenization
In order to use a Tokenized credit card for authorization and sale, you can use the Tokenization tool in order to use the tokenized card instead of the original credit card info given.
**When using Tokenization, you should not send original credit card info as: `card_number`, `card_expiry_month` and `card_expiry_year`.**
---
## Recurring Billing
#### Create a Subscription
To create a subscription, you should define when and how much to charge your customer. To start billing, simply create a subscription and then the Gateway will handle the entire billing flow for you. The charging period should be defined by the **interval** and **interval_count** fields. Being **interval** the period of time to calculate the next charge and **interval_count** being the **interval** number that we should wait until the next charge. For example:
* Charging every month: **interval = month** and **interval_count = 1**;
* Charging every 3 weeks: **interval = week** and **interval_count = 3**.
Subscriptions should also receive the **start_date** and **end_date** fields, which means the start and end date of the subscription, respectively. The first charge will always occur on the **start_date**. The next payment cycles will be automatically calculated by the Gateway. The whole period until **start_date** will be considered as trial and you can charge your customer for this period filling the **trial_amount** field.
Beware: filling **trial_amount** and a **start_date** too close may result in undesirable behavior. It is recommended to use **trial_amount** with a **start_date** equals to the current date + the configured interval.
The subscription routine runs every day at **00:59 PST (07:59 UTC)** and performs the charge for all the merchant accounts. The system collects the active subscriptions that should be charged by comparing the start_date (before the current date). This means that a monthly subscription created with the **start_date** equals August 1st will be charged every month on the 2nd at 00:59 PST.
#### Cancel a Subscription
To cancel a subscription, you should use the Subscription ID response field to reference the subscription being canceled. This endpoint simply cancels the subscription and stops charging it.
#### Renew a Subscription
You can renew a subscription by updating its **end_date** field, you should use the Subscription ID response field to reference the subscription being renewed.
---
## Check Transactions
The Check Transactions API makes it possible to send and receive money between U.S.A. bank accounts. It does this by using standards implemented by banks and the Federal Reserve for transferring money called ACH. It works through an account validation process, and then issuing the check. Settlement generally occurs within a few hours, when you can safely confirm that the transaction was successfully settled and funds deducted from the customer’s account.
Before starting up with actual API documentation, there are a few concepts that must be understood. On check card processing, there are two main concepts which are fundamental parts of how funds go from the customer’s account to the merchant’s bank. Those are:
**Authorization**: performing a validation of the bank information while not blocking funds from the customer’s account. This means the balance is still available for the customer and there’s no guarantee of deduction yet.
**Settlement**: a process, that usually happens every 2 hours, to get all authorizations grouped into a batch of transactions that are then submitted to the processor to deduct the funds from the customer’s account. At this point it is safe to allow access to the product, either by shipping the product or delivering a digital good or service.
In order to keep those two concepts completely manageable by the merchant, on Charge Gateway™ we have implemented a Transaction Event concept, which is an append-only log, that keeps the whole transaction lifecycle intact. There are two different types of events for check transactions:
A **sale**, running the authorization and settlement portions, is not real-time. This means you will need to use the reporting endpoints to check for settlement later. If the **sale** does not settle, a **refund** request will act as a cancellation. If the transaction has already settled, a **refund** request will appear as a credit to the customer’s account.
**Please keep in mind that card and check transactions work differently given their nature, so it's very important to not assume a transaction was processed just by having a success as true on the responses.**
#### Validate account number
In order to prevent fraudulent check transactions, we provide a simple way to check if a provided account number is valid. All you need is the account number.
#### Charge an Account
Charging a bank account using Charge Gateway is simple. All you need is the bank account information of the person or entity you want to credit or debit. Then decide how much you want to send or receive from their bank account.
#### Refund an Account
Refunding a bank account using Charge Gateway is simple. A refund stops the transaction from being settled and don’t remove funds from the customer.
---
## Reporting
#### List all Transactions
In order to list all the transactions that have been sent through the gateway, you can use this endpoint. Please note that for every new event that is sent under the same transaction, the transaction’s **updated_at** field is updated.
Filtering is enabled to this endpoint through query parameter **search**. So whenever searching for a field, make sure to submit it through the endpoint’s query parameters, for example:
`https://gateway-api.charge.io/api/transactions?search[first_name]=John&search[last_name]=Doe`
Filter types are described below:
* **starts with** which matches for records on a SQL **LIKE** fashion, e.g.: a string “Cha“ will match “Charge”;
* **exact comparison** which matches for records through exact comparison, case sensitive, e.g.: a string “charge” will NOT match “Charge”;
* **date** which matches for records through SQL date, and these fields should be provided on Y-m-d H:i:s format, e.g.: 2025-01-01 17:59:00
Also, this endpoint provides pagination to navigate through record sets. Pagination information can be found on meta response field. The pages always return 50 records at a time. While using reporting capabilities, make sure to monitor rate limits through **X-RateLimit-Limit** and **X-RateLimit-Remaining** response headers.
---
## Tokenization
#### Card Tokenization
The idea is to swap payment card data with a randomized number in the same format with no intrinsic value of its own. The difference from encryption is that the original pattern is still “locked”. Encrypted values can be decrypted with the key, brute computing force, or through a hacked/stolen key. Tokens, by the other hand, have no mathematical relationship between the token and its original number, then it cannot be decrypted. De-tokenization can only be done by the Charge tokenization system.
This endpoint tokenizes a given credit card number. You will need to provide the card number you wish to store and then you will be able to retrieve the card number with the original number out of the token provided on the response.
#### Card Detokenize
This endpoint detokenizes a given credit card token. You will need to provide the token you wish to detokenize and as part of the response you’ll get the original number previously stored and it’s expiration month and year.
#### ACH Tokenization
The idea is to swap payment ACH data with an encrypted string. De-tokenization can only be done by the Charge tokenization system.
This endpoint tokenizes a given account, check and routing number. You will need to provide these three parameters you wish to store and then you will be able to retrieve the token provided on the response.
#### ACH Detokenize
This endpoint detokenizes a given ACH token. You will need to provide the token you wish to detokenize and as part of the response you’ll get the original number previously stored and it’s expiration month and year.
**For more information and a demo about our gateway, please contact support@charge.io.**
version: 1.0.0
host: gateway-api.charge.io
basePath: /api
schemes:
- "https"
paths:
/transactions/sale:
post:
security:
- ApiKeyAuth: []
tags:
- "Card Transactions"
summary: "Charge a Credit Card"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/TransactionRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
transaction:
$ref: "#/definitions/Transaction"
/transactions/auth:
post:
security:
- ApiKeyAuth: []
tags:
- "Card Transactions"
summary: "Authorize and Charge Later"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/TransactionRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
transaction:
$ref: "#/definitions/Transaction"
/transactions/{transaction_id}/capture:
post:
security:
- ApiKeyAuth: []
tags:
- "Card Transactions"
summary: "Capture Transaction"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "path"
name: "transaction_id"
type: "string"
required: true
description: "Transaction ID"
example: "41f00869-d7b3-413e-9476-9ef1a8bc2f28"
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/CaptureTransactionRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
transaction:
$ref: "#/definitions/Transaction"
/transactions/{transaction_id}/refund:
post:
security:
- ApiKeyAuth: []
tags:
- "Card Transactions"
summary: "Capture Transaction"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "path"
name: "transaction_id"
type: "string"
required: true
description: "Transaction ID"
example: "41f00869-d7b3-413e-9476-9ef1a8bc2f28"
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/RefundingTransactionRequest"
rresponses:
200:
description: "successful operation"
schema:
type: "object"
properties:
transaction:
$ref: "#/definitions/Transaction"
/transactions/{transaction_id}/void:
post:
security:
- ApiKeyAuth: []
tags:
- "Card Transactions"
summary: "Voiding a Transaction"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "path"
name: "transaction_id"
type: "string"
required: true
description: "Transaction ID"
example: "41f00869-d7b3-413e-9476-9ef1a8bc2f28"
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/VoidingTransactionRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
transaction:
$ref: "#/definitions/Transaction"
/subscriptions:
post:
security:
- ApiKeyAuth: []
tags:
- "Recurring Billing"
summary: "Create a Credit Card Subscription"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/CreateSubscriptionRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
subscription:
$ref: "#/definitions/Subscription"
/check/subscriptions:
post:
security:
- ApiKeyAuth: []
tags:
- "Recurring Billing"
summary: "Create a Check Subscription"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/CreateSubscriptionRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
subscription:
$ref: "#/definitions/Subscription"
/subscriptions/{subscription_id}:
delete:
security:
- ApiKeyAuth: []
tags:
- "Recurring Billing"
summary: "Cancel a Subscription"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "path"
name: "subscription_id"
type: "string"
required: true
description: "The Subscription record ID"
example: "41f00869-d7b3-413e-9476-9ef1a8bc2f28"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
subscription:
$ref: "#/definitions/Subscription"
put:
security:
- ApiKeyAuth: []
tags:
- "Recurring Billing"
summary: "Renew a Subscription"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "path"
name: "subscription_id"
type: "string"
required: true
description: "The Subscription record ID"
example: "41f00869-d7b3-413e-9476-9ef1a8bc2f28"
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/RenewSubscriptionRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
subscription:
$ref: "#/definitions/Subscription"
/checks/verify_account:
post:
security:
- ApiKeyAuth: []
tags:
- "Check Transactions"
summary: "Validate account number"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/ValidateAccountNumberRequest"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/AccountNumberValidation"
/checks/sale:
post:
security:
- ApiKeyAuth: []
tags:
- "Check Transactions"
summary: "Charge an Account"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/ChargeAccountRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
transaction:
$ref: "#/definitions/Transaction"
/checks/{transaction_id}/refund:
post:
security:
- ApiKeyAuth: []
tags:
- "Check Transactions"
summary: "Refund an Account"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/RefundAccountRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
transaction:
$ref: "#/definitions/Transaction"
/transactions:
get:
security:
- ApiKeyAuth: []
tags:
- "Reporting"
summary: "List all Transactions"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "query"
name: "merchant_transaction_id"
schema:
type: string
required: false
description: "Filter Type: starts with"
- in: "query"
name: "card_number"
schema:
type: string
required: false
description: "Filter Type: starts with"
- in: "query"
name: "first_name"
schema:
type: string
required: false
description: "Filter Type: starts with"
- in: "query"
name: "last_name"
schema:
type: string
required: false
description: "Filter Type: starts with"
- in: "query"
name: "email"
schema:
type: string
required: false
description: "Filter Type: starts with"
- in: "query"
name: "mobile_phone"
schema:
type: string
required: false
description: "Filter Type: starts with"
- in: "query"
name: "user_id"
schema:
type: string
required: false
description: "Filter Type: exact comparison"
- in: "query"
name: "city"
schema:
type: string
required: false
description: "Filter Type: starts with"
- in: "query"
name: "state"
schema:
type: string
required: false
description: "Filter Type: exact comparison"
- in: "query"
name: "zip"
schema:
type: string
required: false
description: "Filter Type: exact comparison"
- in: "query"
name: "shipping_city"
schema:
type: string
required: false
description: "Filter Type: starts with"
- in: "query"
name: "shipping_state"
schema:
type: string
required: false
description: "Filter Type: exact comparison"
- in: "query"
name: "shipping_zip"
schema:
type: string
required: false
description: "Filter Type: exact comparison"
- in: "query"
name: "created_at_gte"
schema:
type: string
format: date-time
required: false
- in: "query"
name: "created_at_lte"
schema:
type: string
format: date-time
required: false
- in: "query"
name: "updated_at_gte"
schema:
type: string
format: date-time
required: false
- in: "query"
name: "updated_at_lte"
schema:
type: string
format: date-time
required: false
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
transactions:
type: "array"
items:
$ref: "#/definitions/Transaction"
meta:
type: "object"
properties:
last_page:
type: "number"
format: "int32"
description: "The last page for this query"
example: "1"
current_page:
type: "number"
format: "int32"
description: "The current page for this query"
example: "1"
total:
type: "number"
format: "int32"
description: "The total count of records for this page"
example: "1"
/tokens/tokenize:
post:
security:
- ApiKeyAuth: []
tags:
- "Tokenization"
summary: "Card Tokenize"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/TokenizeRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
card_token:
$ref: "#/definitions/TokenizeCardToken"
/tokens/detokenize:
post:
security:
- ApiKeyAuth: []
tags:
- "Tokenization"
summary: "Card Tokenize"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/DetokenizeRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
card_token:
$ref: "#/definitions/DetokenizeCardToken"
/tokens/ach_tokenize:
post:
security:
- ApiKeyAuth: []
tags:
- "Tokenization"
summary: "ACH Tokenize"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/ACHTokenizeRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
ach_token:
$ref: "#/definitions/ACHTokenizeCardToken"
/tokens/ach_detokenize:
post:
security:
- ApiKeyAuth: []
tags:
- "Tokenization"
summary: "ACH Detokenize"
description: ""
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/ACHDetokenizeRequest"
responses:
200:
description: "successful operation"
schema:
type: "object"
properties:
card_token:
$ref: "#/definitions/ACHDetokenizeCardToken"
securityDefinitions:
ApiKeyAuth:
type: apiKey
in: header
name: Authorization
definitions:
TransactionRequest:
type: "object"
properties:
processor_id:
type: "string"
format: "uuid"
required: false
description: "The Processor record ID. If processor_id has not been provided, the gateway will pick one randomly."
example: "41f00869-d7b3-413e-9476-9ef1a8bc2f28"
amount:
type: "number"
format: "float"
required: true
description: "Total transaction amount"
example: "3.56"
capture:
type: "boolean"
required: false
description: "If your processor is configured with the Auto Capture feature, you may call an auth or sale request with a capture=false flag. The transactions will be automatically captured by gateway up to 24h."
card_number:
type: "string"
required: true
description: "The credit card to charge"
example: "411111111111111"
card_expiry_month:
type: "string"
required: true
description: "The expiration month with two positions"
example: "01"
card_expiry_year:
type: "string"
required: true
description: "The expiration month with four positions"
example: "2021"
card_cvv:
type: "string"
required: false
description: "3 or 4 digit [card verification code](https://en.wikipedia.org/wiki/Card_security_code). card_cvv is a not required as a default. There are some processors such as “Payvision” that requires this field to be present on VISA,MASTER,AMEX."
example: "123"
merchant_transaction_id:
type: "string"
required: true
description: "A merchant assigned identifier (your transaction ID)"
example: "my-order-id-0001"
first_name:
type: "string"
required: false
description: "Customer’s first name. first_name is required and minimum of 2 chars when running transactions with Skrill Card processor."
example: "John"
last_name:
type: "string"
required: false
description: "Customer’s last name. last_name is required and minimum of 2 chars when running transactions with Skrill Card processor."
example: "Doe"
email:
type: "string"
required: false
description: "Customer’s email"
example: "support@charge.io"
mobile_phone:
type: "string"
required: false
description: "Customer’s phone"
example: "11231231234"
avs_enabled:
type: "number"
format: "int32"
required: false
description: "Flag to enable AVS capabilities (1 for enabled / 0 for not enabled)"