---
page_source: https://docs.juspay.io/payout-sea/docs/integration/attempt-api-encrypted
page_title: Attempt API [Encrypted]
---

## API Version: default


# Attempt API [Encrypted]



Attempt API is used for PLAIN_CARD payouts where merchant wants to retry on a failed attempt. Merchant can pass card details in this authenticated API from merchant's server. This API is to be used only for the use case where merchant has access to card details (either PAN or card token) and wants to implement retry for PLAIN_CARD payout orders.

> **Warning**
> Request data has to be sent in encrypted format. Please follow the steps mentioned [here](https://docs.juspay.in/payout/docs/resources/encryption-guide)



The below params have to be stringified before encryption: ## Endpoints:
- Production: https://api.juspay.in/payout/merchant/v1/{orderId}/attempt

## Request Type: 
POST

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string

Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: String, Mandatory
## Headers:

#### x-merchantid:
Please pass merchant-id given for your merchant
- Tags: string
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location 'https://sandbox.juspay.in/payout/merchant/v1/orders/:orderId/attempt' \
--header 'x-merchantid: <x-merchantid>' \
--header 'Content-Type: application/json' \
--header 'x-routing-id: customer_1122'\
--header 'Authorization: Basic (b64 encoded API key)' \
--data '{
    "payload": "eyJhbGciOiJSU0EtT0FFUCIsInR5cCI6IkpXVCIsImVuYyI6IkEyNTZDQkMtSFM1MTIifQ.x88C2GRVLT9501v1Nq49QF83qoVSf7xmibBfBrfJn4sOjI1gy1Gu9R5X9diVf-ST9wSHBwKuM4bW7Vs9VsshcCxtQr0xd6rFCbS-PnM6VwbjOh8Vre-06d3j3dbKFEy_OFVIvqvRIpJxGuTcAXUAoaoJMh_ubykxxQJX_owudksyUMmu0-cEa9QeitIET5P_45mn9EdD6NYsy94gYPucBxhfihvUuNfoQH7VwjsYbIAR9NMkxTPzSqfrfGZC2qq5Emav06b937ZfCcz2ncYpdHCBuJ3oWcW4ZG9WkebpAp3ho5lNHiU22TAawyt5B2LZXHCg_1dIdz7fOu0Nkb7Pow.f8LRRRhuMDti2aD3dkyr7w.JHVovPAX5WsztT0ikR_W2_Po7r-4lPRBN69Flv_F9JOQExSrZOYZr0cwXHuThoUhmkxVbvP886xtDgKPbosKUve8pn4k0ujGsVy--ptt5Zici3XEFwmY_m51L3qi_BzmqCBDCTAqXRpkLblyJfAEP-Apdq0956jDe2jwO2KuDly1P29SLcL4rVGTz6244hDCjvCN-JR3sFCTNLN6fFbMOEAPcR2TBEJ5KVDeM_wrdWmdfRp24HPVtVYHA6rE5W2zX_o6a2UeJGApgwKGRZx_u_SLWUrmMP9X_5l8HTjuphbxdVEkSBbZPgBi16ec8PEL8xNvSPtHbY5hSGPgmPJiN6l_4Ht5C8revwUb2OBQcMXxU_WrxvYo8iz8JQAjxM1uDDARJORvuSzbpxi09zJx2QtT6wKNZcFxzfOAHdFZuLhPI0HnamFQcmE1QOAbYhyycrsN918bNesCuJVrpvTOOEaROfbVTZpP3wfpbjf2B93OTV0hNerlQ4zF-A-vSodZ2w164bnq6j.KAUUlWrSXo7VKwlmyseyU8MthpPSUjqpbAyYo1wgNEM",
    "kid": "JuspayKID", //Reference to Juspay private key
    "sid": "JuspaySID", //Refernce to Merchant public key
    "format": "compact"
}'

```

#### Decrypted Payload for Card Number based attempt Code Snippet:

```decrypted payload for card number based attempt
{
    "fulfillmentId": "c14b43505a545b3a65c416634009a2-f1",
    "cardInfo": {
        "cardNumber": " 5513651111111111",
        "cardSecurityCode": "123",
        "cardExpiry": {
            "month": "02",
            "year": "2028"
        }
    }
}

```

#### Decrypted Payload for Card Token based attempt  Code Snippet:

```decrypted payload for card token based attempt 
{
    "fulfillmentId": "c14b43505a545b3a65c416634009a2-f1",
    "cardInfo": {
        "cardToken": "1111111111111111"
    }
}

```

### Sample Response:

#### Response:
```json
ACK
```

## Body Parameters:
### Parameters:

#### fulfillmentId:
- Description: Fulfillment ID received in the response of order create request
- Tags: string, Required

#### cardInfo:
- Description: This will contain the details like cardNumber/cardToken and all other details related to CardToken.
- Value:
  - **CardNumber**:
    - Description: Field will contain the card number used for the order
    - Tags: string
  - **CardToken**:
    - Description: Field will contain the network token used for the order
    - Tags: string
  - **Name**:
    - Description: Name of the card holder / beneficiary for the order
    - Tags: string
  - **CardExpiry**:
    - Description: This object contains expiry month and year of card
    - Value:
      - **Month**:
        - Description: Expiry month for users card (MM)Example: “01”
        - Tags: String
      - **Year**:
        - Description: Expiry year for users card (YYYY)Example : “2024”
        - Tags: String
    - Tags: Object
  - **CardSecurityCode**:
    - Description: cvv. String(3)
    - Tags: String
  - **SenderDetails**:
    - Value:
      - **Type**:
        - Description: Indicates the type of the payment doneAllowed Values : PAY_CARD, NETBANKING, UPI
        - Tags: String
      - **Details**:
        - Value:
          - **Name**:
            - Description: Name of the sender
            - Tags: String
          - **Account**:
            - Description: Please populate this field with the accountNumber of the remitter if the paymentType is NETBANKING
            - Tags: String
          - **Pan**:
            - Description: Please populate this with the card number or Token if the Type is PAY_CARD
            - Tags: String
          - **Expiry**:
            - Description: Expiry details for sender’s card. This is an optional field
            - Value:
              - **Month**:
                - Description: Expiry month for sender’s card (MM)
                - Tags: String
              - **Year**:
                - Description: Expiry year for sender’s card (YYYY)
                - Tags: String
            - Tags: String, Optional
          - **CardSecurityCode**:
            - Description: Please populate this with the card security code if the paymentType is PAY_CARD
            - Tags: String, Optional
          - **TransactionReference**:
            - Description: Please populate this filed with the unique transaction reference number if the paymentType is UPI
            - Tags: String
        - Tags: Object
    - Tags: Object
- Tags: object
## API Responses:
### 200:

#### ACK:
- Tags: String
### 400:

#### error:
- Description: Boolean reflecting error in request of create order API
- Value:  true
- Tags: Boolean

#### errorCode:
- Description: Error code provided by Juspay
- Value:  E01
- Tags: String

#### errorMessage:
- Description: Error message provided by Juspay. Share this message with Juspay POC for debugging
- Value: Amount0.0 cannot be less than 1.0Amount0.0 cannot be less than 1.0
- Tags: String

#### userMessage:
- Description: Error message that will be shown on dashboard / analytics
- Tags: String
### 401:

#### error:
- Description: Boolean reflecting error in request of create order API
- Value:  true
- Tags: String

#### errorCode:
- Description: Error code provided by Juspay
- Value:  E02
- Tags: String

#### errorMessage:
- Description: Error message provided by Juspay. Share this message with Juspay POC for debugging
- Value:  Invalid API key passed in request.
- Tags: String

#### userMessage:
- Description: Error message that will be shown on dashboard / analytics
- Value:  Invalid API Key
- Tags: String, Mandatory
