---
page_title: Wallet Direct Debit
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/express-checkout/wallet-direct-debit
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Fexpress-checkout%2Fwallet-direct-debit
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/api-reference/llms.txt
---

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

> **Warning**
> * Wallet Direct Debit transaction API calls are authenticated, unlike other transaction API calls. This API must be invoked directly from your server. DO NOT send the API key to the client.
> * In case you are calling the transaction API from the client side, kindly include `client_auth_token` in the API request. Please note that `client_auth_token` can be fetched from the [Create Customer API](https://docs.juspay.in/api-reference/docs/express-checkout/createcustomer), [Get Customer API](https://docs.juspay.in/api-reference/docs/express-checkout/getcustomer) or [Create Order API](https://docs.juspay.in/api-reference/docs/express-checkout/create-order-api).




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:
- Sandbox: https://sandbox.juspay.in/txns

- Production: https://api.juspay.in/txns

## Request Type: 
POST

## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String, Mandatory

#### x-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl -X POST https://api.juspay.in/txns \
-u your_api_key: \
-H 'x-routing-id: customer_1122'\
-d "order_id=:order_id" \
-d "merchant_id=:merchant_id" \
-d "payment_method_type=WALLET" \
-d "direct_wallet_token=:direct_wallet_token"
-d "payment_method=MOBIKWIK" \
-d "redirect_after_payment=true" \
-d "format=json"

```

### 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"
    }
  }
}
```

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


---

## See Also

- [Wallet Payment](https://juspay.io/in/docs/api-reference/docs/express-checkout/wallet-payment)
- [Cash On Delivery Payment](https://juspay.io/in/docs/api-reference/docs/express-checkout/cash-on-delivery-payment)
