You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/data/bav/reverse-penny-drop/api-integration.mdx
+55-22Lines changed: 55 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@ order: 2
5
5
visible_in_sidebar: true
6
6
---
7
7
8
-
# API Integration
8
+
##API Integration
9
9
10
10
Below is a quick summary of the APIs you need to start integrating with for bank verification using Reverse Penny Drop (RPD).
11
11
12
-
Here are the few things you would need for this integration—
12
+
Here are the things you will need for this integration—
13
13
14
14
- Sandbox — `https://dg-sandbox.setu.co`
15
15
- Production — `https://dg.setu.co`
@@ -27,36 +27,52 @@ Here are the few things you would need for this integration—
27
27
28
28
<hrclass="primary" />
29
29
30
-
####Create reverse penny drop request
30
+
### Create reverse penny drop request
31
31
32
32
Send a `POST` request to the `/api/verify/ban/reverse` endpoint to create a reverse penny drop request.
33
-
Optionally you can pass `additionalData` with header `Content-Type` as `application/json`.
34
33
35
-
`additionalData` should be simple key-value pairs (string value only).
36
-
E.g:
34
+
#### Request Body
37
35
38
-
<CodeBlockWithCopylanguage="json">
39
-
{`
40
-
"additionalData": {
41
-
"key1": "value1",
42
-
"key2": "value2"
43
-
}
44
-
`}
45
-
</CodeBlockWithCopy>
36
+
You can include the following parameters in the request body:
37
+
38
+
##### Optional Parameters
46
39
40
+
-`redirectionConfig`: Configuration for redirect behavior after transaction completion
41
+
-`redirectUrl`: The URL where the user will be redirected after the transaction (e.g., "https://example.com")
42
+
-`timeout`: Duration in seconds to wait before redirection occurs (e.g., 30)
43
+
44
+
-`additionalData`: Additional information to be included with the request. `additionalData` should be simple key-value pairs (string value only).
47
45
<Callouttype="warning">
48
-
You can expect this `additionalData` as part of a JSON body when we notify
46
+
You can expect this additionalData as part of a JSON body when we notify
49
47
you with bank account verification details over webhook, or when you use our{""}
50
48
<code>GET</code> details API.
51
49
</Callout>
50
+
51
+
##### Request Headers
52
+
53
+
`Content-Type`: `application/json` (optional, required when sending request body)
54
+
55
+
##### Example Request
56
+
57
+
<CodeBlockWithCopylanguage="json">
58
+
{`
59
+
"additionalData": {
60
+
"customField": "value"
61
+
},
62
+
"redirectionConfig": {
63
+
"redirectUrl": "https://example.com",
64
+
"timeout": 30
65
+
}
66
+
`}
67
+
</CodeBlockWithCopy>
52
68
<br />
53
69
54
70
If successful, you will get a JSON response. Two of the fields in the response would be
55
71
56
72
-`upiLink`, a UPI intent link starting with `upi://`
57
73
-`shortUrl`, a link starting with `https://` and an image with a QR code
58
74
59
-
We recommend showing the QR code on desktop devices so that a user can use their phone to scan QR and pay. For mobile phones, it's recommended to use the UPI intent link to pay on the same device.
75
+
<b>We recommend showing the QR code on desktop devices so that a user can use their phone to scan QR and pay. For mobile phones, it's recommended to use the UPI intent link to pay on the same device.</b>
60
76
61
77
- If you want PSP specific link. Read the <atarget="_blank"href="/data/bav/reverse-penny-drop/quickstart#faqs">FAQ</a>.
62
78
@@ -83,8 +99,8 @@ We recommend showing the QR code on desktop devices so that a user can use their
83
99
-`BAV_REVERSE_PENNY_DROP_PAYMENT_FAILED`, when an issue occurs during payment by your user or at Setu’s banking partner’s end. The payment, if made, will be auto-refunded.
84
100
85
101
<Callouttype="warning">
86
-
In some cases when our banking partner doesn't send us credit alerts the
87
-
status still may show as <code>BAV_REVERSE_PENNY_DROP_CREATED</code>.
102
+
In some cases when our banking partner doesn't send us credit alerts, the
103
+
status may still show as <code>BAV_REVERSE_PENNY_DROP_CREATED</code>.
88
104
</Callout>
89
105
90
106
<br />
@@ -219,7 +235,7 @@ We recommend showing the QR code on desktop devices so that a user can use their
219
235
220
236
<hrclass="tertiary" />
221
237
222
-
####Mock payment
238
+
### Mock payment
223
239
224
240
This API lets you test the end to end flow without an actual payment. This will send a webhook to the callback URL you have configured with us.
225
241
@@ -333,9 +349,26 @@ This API lets you test the end to end flow without an actual payment. This will
333
349
334
350
<hrclass="tertiary" />
335
351
336
-
#### Notifications / Webhooks
352
+
### Redirection Behavior
353
+
354
+
After the transaction is completed, the user will be automatically redirected to the specified `redirectUrl` based on the transaction status:
355
+
356
+
- Successful transaction: Redirection after 5 seconds
357
+
- Failed transaction: Redirection after 5 seconds
358
+
- Timeout: Redirection occurs after the specified timeout period (in seconds)
359
+
360
+
<Callouttype="tip">
361
+
When using the <b>shortUrl</b> on mobile devices <b>(not recommended)</b>, notify your <b>mobile users</b> that
362
+
they will need to manually return to their browser after completing the payment
363
+
in their UPI app to be redirected to the specified <b>redirectUrl</b>.
364
+
The redirection will not happen automatically when the user is in the UPI app.
365
+
</Callout>
366
+
367
+
<hrclass="tertiary" />
368
+
369
+
### Notifications / Webhooks
337
370
338
-
Below are the summary of the notifications which need to be processed on your server by exposing an endpoint for Setu to send an HTTP POST request with 5 exponential backoff retries
371
+
Below is a summary of the notifications that need to be processed on your server by exposing an endpoint for Setu to send an HTTP POST request with 5 exponential backoff retries.
339
372
340
373
<Callouttype="tip">
341
374
Please send back HTTP 200 status code if the request sent was processed
@@ -363,7 +396,7 @@ _`accountType` can be `BANK_ACCOUNT`, `PPI` or `UNKNOWN`_
363
396
If the bank account is classified as PPI, then it is for sure a PPI
364
397
instrument and for majority of the use cases consider it an invalid bank
365
398
account since money movement doesn't happen when trying to deposit an amount
366
-
through IMPS/NEFT/RTGS. There can be PPI instruments which come up as
399
+
through IMPS/NEFT/RTGS. There can be PPI instruments that come up as
367
400
<code>UNKNOWN</code>, please notify us at [support@setu.co](support@setu.co)
0 commit comments