---
page_source: https://docs.juspay.io/paytm-gateway-configuration/docs/express-checkout/wallet-direct-debit
page_title: Wallet Direct Debit
---

## API Version: default


# Wallet Direct Debit



Directly debit the amount from a Wallet that is linked to a Customer’s account. If the status in the response is `CHARGED`, then the payment is immediatley successful. If the status in the response is `PENDING`, then the user wallet doesn’t have sufficient balance for the payment and the topup URL is returned in the response

Note: This is an authenticated call unlike other transaction APIs. This API must be invoked from your server directly. DO NOT send the API Key to client.


| payment_method | Bank |
|---|---|
| GOPAY | Gopay Wallet |
| DANA | Dana Wallet |
| SHOPEEPAY | ShopeePay wallet |
| OVO | Ovo Wallet |



## HANDLING GET



When you get `GET` as the authentication method in the response, you may load the URL directly into the customer’s browser. You can easily achieve this by send HTTP 302 from your server. However, if the API call was made from the browser, then you can utilize the code snippet provided.


#### Handling GET Code Snippet:

```handling get
<!-- Example for handling GET response -->
<script type="text/javascript">
 // assuming that you are passing the JSON response of /txns API directly here
 function handleJuspayGetResponse(juspayResponse) {
   window.location.href = juspayResponse.payment.authentication.url
 }
 handleJuspayGetResponse(response)
</script>
```
## Endpoints:
- Production: https://api.juspay.in/txns

## Request Type: 
POST

## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location 'https://api.juspay.in/txns' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic xxx==' \
--data-urlencode 'merchant_id=azharamin' \
--data-urlencode 'payment_method_type=WALLET' \
--data-urlencode 'payment_method=GOPAY' \
--data-urlencode 'redirect_after_payment=true' \
--data-urlencode 'format=json' \
--data-urlencode 'direct_wallet_token=tkn_ef1a29396adb4ced9ea1b5a43562ac7b' \
--data-urlencode 'order.order_id=:order_id' \
--data-urlencode 'order.amount=100' \
--data-urlencode 'order.currency=IDR' \
--data-urlencode 'order.customer_id=test123' \
--data-urlencode 'order.customer_phone=9164326296'

```

### Sample Response:

#### Response:
```json
{
  "order_id": ":order_id",
  "txn_id": ":txn_id",
  "status": "CHARGED",
  "payment": {
    "authentication": {
      "method": "GET",
      "url": "https://api.juspay.in/pay/finish/:merchant-id/:txn-id/:order-id"
    }
}

```

## Body Parameters:
### Parameters:

#### order_id:
- Description: `order\_id` pertaining to the order for which the payment is started.
- Tags: string, Required

#### merchant_id:
- Description: ID of the merchant_account that you hold with us.
- Tags: string, Required

#### direct_wallet_token:
- Description: Juspay wallet token for linked wallets. This is available in the `/customers/:id/wallets` API or `/wallets/:id` API.
- Tags: string, Required

#### payment_method_type:
- Description: Must be `WALLET`
- Tags: string, Required

#### payment_method:
- Description: The actual payment method that was selected by the user. For WALLET transactions, it must be one of the supported wallets from the table.
- Tags: string, Required

#### redirect_after_payment:
- Description: This is a boolean variable and accepts true/false. We recommend that you set this to true. If set to `true`, then the user is redirected to the `return\_url` configured for the order. If set to `false`, then the user will be stopped at the response page from the gateway. Your client should be able to read the page/title to infer that the user has completed the transaction.
- Tags: string, Required

#### format:
- Description: If it is set to `json`, then the response will be HTTP 200 with a JSON formatted text. Otherwise, the response is HTTP 302 with the Location attribute having the destination URL.
- Tags: string, Required
## API Responses:
### 200:

#### order_id:
- Description: :order_id
- Tags: string

#### txn_id:
- Description: :txn_id
- Tags: string

#### status:
- Description: CHARGED
- Tags: string

#### payment:
- Value:
  - **Authentication.method**:
    - Tags: String
  - **Authentication.url**:
    - Tags: String
- Tags: object
### 400:

#### status:
- Description: error
- Tags: string

#### error_message:
- Description: Order timed out
- Tags: string

#### error_code:
- Description: invalid_request
- Tags: string
