Skip to content

Commit a27f843

Browse files
authored
updates api integration docs: (#230)
- adds redirection feature related info - uses consistent heading levels for quick links on right sidebar
1 parent b04c4dd commit a27f843

File tree

1 file changed

+55
-22
lines changed

1 file changed

+55
-22
lines changed

content/data/bav/reverse-penny-drop/api-integration.mdx

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ order: 2
55
visible_in_sidebar: true
66
---
77

8-
# API Integration
8+
## API Integration
99

1010
Below is a quick summary of the APIs you need to start integrating with for bank verification using Reverse Penny Drop (RPD).
1111

12-
Here are the few things you would need for this integration—
12+
Here are the things you will need for this integration—
1313

1414
- Sandbox — `https://dg-sandbox.setu.co`
1515
- Production — `https://dg.setu.co`
@@ -27,36 +27,52 @@ Here are the few things you would need for this integration—
2727

2828
<hr class="primary" />
2929

30-
#### Create reverse penny drop request
30+
### Create reverse penny drop request
3131

3232
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`.
3433

35-
`additionalData` should be simple key-value pairs (string value only).
36-
E.g:
34+
#### Request Body
3735

38-
<CodeBlockWithCopy language="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
4639

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).
4745
<Callout type="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
4947
you with bank account verification details over webhook, or when you use our{" "}
5048
<code>GET</code> details API.
5149
</Callout>
50+
51+
##### Request Headers
52+
53+
`Content-Type`: `application/json` (optional, required when sending request body)
54+
55+
##### Example Request
56+
57+
<CodeBlockWithCopy language="json">
58+
{`
59+
"additionalData": {
60+
"customField": "value"
61+
},
62+
"redirectionConfig": {
63+
"redirectUrl": "https://example.com",
64+
"timeout": 30
65+
}
66+
`}
67+
</CodeBlockWithCopy>
5268
<br />
5369

5470
If successful, you will get a JSON response. Two of the fields in the response would be
5571

5672
- `upiLink`, a UPI intent link starting with `upi://`
5773
- `shortUrl`, a link starting with `https://` and an image with a QR code
5874

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>
6076

6177
- If you want PSP specific link. Read the <a target="_blank" href="/data/bav/reverse-penny-drop/quickstart#faqs">FAQ</a>.
6278

@@ -83,8 +99,8 @@ We recommend showing the QR code on desktop devices so that a user can use their
8399
- `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.
84100

85101
<Callout type="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>.
88104
</Callout>
89105

90106
<br />
@@ -219,7 +235,7 @@ We recommend showing the QR code on desktop devices so that a user can use their
219235

220236
<hr class="tertiary" />
221237

222-
#### Mock payment
238+
### Mock payment
223239

224240
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.
225241

@@ -333,9 +349,26 @@ This API lets you test the end to end flow without an actual payment. This will
333349

334350
<hr class="tertiary" />
335351

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+
<Callout type="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+
<hr class="tertiary" />
368+
369+
### Notifications / Webhooks
337370

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.
339372

340373
<Callout type="tip">
341374
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`_
363396
If the bank account is classified as PPI, then it is for sure a PPI
364397
instrument and for majority of the use cases consider it an invalid bank
365398
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
367400
<code>UNKNOWN</code>, please notify us at [support@setu.co](support@setu.co)
368401
</Callout>
369402

0 commit comments

Comments
 (0)