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$version: "2"
namespace com.hyperswitch
use com.hyperswitch.smithy.types#PaymentsRequest
use com.hyperswitch.smithy.types#PaymentsResponse
use com.hyperswitch.smithy.types#RefundRequest
use com.hyperswitch.smithy.types#RefundResponse
use com.hyperswitch.smithy.types#RefundUpdateRequest
use com.hyperswitch.smithy.types#RefundListRequest
use com.hyperswitch.smithy.types#RefundListResponse
use com.hyperswitch.smithy.types#PaymentsCaptureRequest
use com.hyperswitch.smithy.types#PaymentsCancelRequest
use com.hyperswitch.smithy.types#CustomerRequest
use com.hyperswitch.smithy.types#CustomerResponse
use com.hyperswitch.smithy.types#CustomerUpdateRequest
use com.hyperswitch.smithy.types#CustomerDeleteResponse
use com.hyperswitch.smithy.types#CustomerListRequest
use com.hyperswitch.smithy.types#MandateRevokedResponse
use com.hyperswitch.smithy.types#MandateResponse
use com.hyperswitch.smithy.types#MandateListConstraints
use aws.protocols#restJson1
/// The Hyperswitch API.
@restJson1
@aws.api#service(
sdkId: "hyperswitch",
arnNamespace: "hyperswitch",
cloudFormationName: "Hyperswitch",
endpointPrefix: "api"
)
service Hyperswitch {
version: "2024-07-31",
operations: [PaymentsCreate, PaymentsConfirm, PaymentsUpdate, PaymentsRetrieve, PaymentsCapture, PaymentsCancel, RefundsCreate, RefundsRetrieve, RefundsUpdate, RefundsList, CustomersCreate, CustomersRetrieve, CustomersUpdate, CustomersDelete, CustomersList, MandatesRevoke, MandatesRetrieve, MandatesList]
}
/// Structure for creating a payment
structure PaymentsCreateRequest {
/// The payment request details
@required
@httpPayload
payload: PaymentsRequest
}
@documentation("Create a payment with the specified details.")
@http(method: "POST", uri: "/payments")
operation PaymentsCreate {
input: PaymentsCreateRequest,
output: PaymentsResponse,
}
/// Structure for confirming a payment
structure PaymentsConfirmRequest {
/// The unique identifier for the payment to confirm
@required
@httpLabel
payment_id: smithy.api#String
/// The payment confirmation request details
@required
@httpPayload
payload: PaymentsRequest
}
@documentation("Confirm a payment using the payment_id.")
@http(method: "POST", uri: "/payments/{payment_id}/confirm")
operation PaymentsConfirm {
input: PaymentsConfirmRequest,
output: PaymentsResponse,
}
/// Structure for updating a payment
structure PaymentsUpdateRequest {
/// The unique identifier for the payment to update
@required
@httpLabel
payment_id: smithy.api#String
/// The payment update request details
@required
@httpPayload
payload: PaymentsRequest
}
@documentation("Update a payment using the payment_id.")
@http(method: "POST", uri: "/payments/{payment_id}")
operation PaymentsUpdate {
input: PaymentsUpdateRequest,
output: PaymentsResponse,
}
structure PaymentsRetrieveRequest {
/// The unique identifier for the payment to retrieve
@required
@httpLabel
payment_id: smithy.api#String
}
@documentation("Retrieve a payment using the payment_id.")
@http(method: "GET", uri: "/payments/{payment_id}")
operation PaymentsRetrieve {
input: PaymentsRetrieveRequest,
output: PaymentsResponse,
}
/// Input structure for capturing a payment
structure PaymentsCaptureRequestInput {
/// The unique identifier for the payment to capture
@required
@httpLabel
payment_id: smithy.api#String
/// The capture request details
@required
@httpPayload
payload: PaymentsCaptureRequest
}
@documentation("Capture a payment that has been previously authorized.")
@http(method: "POST", uri: "/payments/{payment_id}/capture")
operation PaymentsCapture {
input: PaymentsCaptureRequestInput,
output: PaymentsResponse,
}
/// Input structure for canceling a payment
structure PaymentsCancelRequestInput {
/// The unique identifier for the payment to cancel
@required
@httpLabel
payment_id: smithy.api#String
/// The cancel request details
@required
@httpPayload
payload: PaymentsCancelRequest
}
@documentation("Cancel a payment using the payment_id.")
@http(method: "POST", uri: "/payments/{payment_id}/cancel")
operation PaymentsCancel {
input: PaymentsCancelRequestInput,
output: PaymentsResponse,
}
/// Structure for creating a refund
structure RefundsCreateRequest {
/// The refund request details
@required
@httpPayload
payload: RefundRequest
}
@documentation("Create a refund for a payment.")
@http(method: "POST", uri: "/refunds")
operation RefundsCreate {
input: RefundsCreateRequest,
output: RefundResponse,
}
structure RefundsRetrieveRequest {
/// The unique identifier for the refund to retrieve
@required
@httpLabel
id: smithy.api#String
}
@documentation("Retrieve a refund using the refund_id.")
@http(method: "GET", uri: "/refunds/{id}")
operation RefundsRetrieve {
input: RefundsRetrieveRequest,
output: RefundResponse,
}
/// Structure for updating a refund
structure RefundsUpdateRequest {
/// The unique identifier for the refund to update
@required
@httpLabel
id: smithy.api#String
/// The refund update request details
@required
@httpPayload
payload: RefundUpdateRequest
}
@documentation("Update a refund using the refund_id.")
@http(method: "POST", uri: "/refunds/{id}")
operation RefundsUpdate {
input: RefundsUpdateRequest,
output: RefundResponse,
}
/// Structure for listing refunds
structure RefundsListRequestInput {
/// The refund list request details
@required
@httpPayload
payload: RefundListRequest
}
@documentation("Retrieve a list of refunds.")
@http(method: "POST", uri: "/refunds/list")
operation RefundsList {
input: RefundsListRequestInput,
output: RefundListResponse,
}
/// Structure for creating a customer
structure CustomersCreateRequest {
/// The customer request details
@required
@httpPayload
payload: CustomerRequest
}
@documentation("Create a customer with the specified details.")
@http(method: "POST", uri: "/customers")
operation CustomersCreate {
input: CustomersCreateRequest,
output: CustomerResponse,
}
/// Structure for retrieving a customer
structure CustomersRetrieveRequest {
/// The unique identifier for the customer to retrieve
@required
@httpLabel
customer_id: smithy.api#String
}
@documentation("Retrieve a customer using the customer_id.")
@http(method: "GET", uri: "/customers/{customer_id}")
operation CustomersRetrieve {
input: CustomersRetrieveRequest,
output: CustomerResponse,
}
/// Structure for updating a customer
structure CustomersUpdateRequest {
/// The unique identifier for the customer to update
@required
@httpLabel
customer_id: smithy.api#String
/// The customer update request details
@required
@httpPayload
payload: CustomerUpdateRequest
}
@documentation("Update a customer using the customer_id.")
@http(method: "POST", uri: "/customers/{customer_id}")
operation CustomersUpdate {
input: CustomersUpdateRequest,
output: CustomerResponse,
}
/// Structure for deleting a customer
structure CustomersDeleteRequest {
/// The unique identifier for the customer to delete
@required
@httpLabel
customer_id: smithy.api#String
}
@documentation("Delete a customer using the customer_id.")
@http(method: "DELETE", uri: "/customers/{customer_id}")
operation CustomersDelete {
input: CustomersDeleteRequest,
output: CustomerDeleteResponse,
}
list CustomerResponseList {
member: CustomerResponse
}
structure CustomersListRequestInput with [CustomerListRequest] {
}
@documentation("Retrieve a list of customers.")
@http(method: "GET", uri: "/customers/list")
operation CustomersList {
input: CustomersListRequestInput,
output:= {
@httpPayload
customers_list: smithy.api#Document
},
}
/// Structure for revoking a mandate
structure MandatesRevokeRequest {
/// The unique identifier for the mandate to revoke
@required
@httpLabel
id: smithy.api#String
}
@documentation("Revoke a mandate using the mandate_id.")
@http(method: "POST", uri: "/mandates/revoke/{id}")
operation MandatesRevoke {
input: MandatesRevokeRequest,
output: MandateRevokedResponse,
}
/// Structure for retrieving a mandate
structure MandatesRetrieveRequest {
/// The unique identifier for the mandate to retrieve
@required
@httpLabel
id: smithy.api#String
}
@documentation("Retrieve a mandate using the mandate_id.")
@http(method: "GET", uri: "/mandates/{id}")
operation MandatesRetrieve {
input: MandatesRetrieveRequest,
output: MandateResponse,
}
list MandateResponseList {
member: MandateResponse
}
structure MandatesListRequestInput with [MandateListConstraints] {
}
@documentation("Retrieve a list of mandates.")
@http(method: "GET", uri: "/mandates/list")
operation MandatesList {
input: MandatesListRequestInput,
output:= {
@httpPayload
mandates_list: smithy.api#Document
},
}