---
page_source: https://juspay.io/in/docs/part-payments/docs/integration/transaction-api
page_title: Transaction API
---

## API Version: default


# Transaction API



Initiate transaction with below details

> **Note**
> * `selected_plan_id` , `selected_plan_type`, `selected_part_number`, should be sent in transaction call under `metadata` key to inform what part number is being paid for
> * Unless the selected part’s payment is successful, user cannot make payment for the next part. E.g. user is making payment for part 1 and transaction goes into pending, in such a scenario, user can make repayment of part 1 only and cannot proceed to part 2 since previous part is still pending and not completed.

## Endpoints:
- Sandbox: https://sandbox.juspay.in/txns

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

## Request Type: 
POST

## Content-Type: 
application/json

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

#### Request Code Snippet:

```request
curl --location --request POST 'https://sandbox.juspay.in/txns' \
--header 'Content-Type: application/json' \
--header 'Cookie: tokenization_cookie_version_mandate_juspay=1' \
--header 'Authorization: Basic N0JBRDA4OUExRjxxxxxxxxxxxyNDlCNjY3QTVCMUQzM0Q6' \
--data '{
   "order_id": "123456789",
   "merchant_id": "your_merchantID",
   "payment_method_type": "CARD",
   "payment_method": "VISA",
   "card_number": "55xxx4xxxxxxx105",
   "card_exp_month": "09",
   "card_exp_year": "2029",
   "name_on_card": "Test",
   "card_security_code": "123",
   "redirect_after_payment": "true",
   "format": "json",
   "txn_amount": "500",
   "metadata": {
       "part_payment_info": "{\"selected_plan_id\": \"1234\",\"selected_plan_type\": \"FIXED\",\"selected_part_number\": \1\}"
   }
}'

```

### Sample Response:

#### Response:
```plaintext
{
    "payment": {
        "authentication": {
            "method": "GET",
            "url": "https://sandbox.juspay.in/v2/pay/start/picasso/mozhJ19S3G5CB3LtJo4?cardIssuerBankName%3DHDFC%20Bank%26cardType%3DCREDIT%26paymentMethod%3DNB_CORP%26paymentMethodType%3DNB"
        }
    },
    "status": "STARTED",
    "txn_uuid": "mozhJ19S3G5CB3LtJo4",
    "offer_details": {
        "offers": []
    },
    "order_id": "1749026515",
    "txn_id": "picasso-1749026515-1"
}
```

## Body Parameters:
### New Keys in /txns call:

#### txn_amount:
- Description: The amount of the part needs to be sent in the transaction call and it should match
- Value:  500
- Tags: String, Mandatory, Required

#### metadata:
- Description: This key contains data about the plan and part being paid for i.e. selected plan, selected plan type and the part number. 
- Value: {"part_payment_info": "{\"selected_plan_id\": \"1234\",\"selected_plan_type\": \"FIXED\",\"selected_part_number\": \1\}
- Tags: String, Mandatory, Required

#### part_payment_info:
- Description: Inside `metadata`, this key defines the part information which the user is making payment for
- Tags: String, Mandatory, Required

#### selected_plan_id:
- Description: Send the plan ID in this key which the user chooses to make the payment
- Tags: Mandatory, Required

#### selected_plan_type:
- Description: Sent the plan type as `FIXED` or `EDITABLE` based on the user selection
- Tags: Mandatory, Required

#### selected_part_number:
- Description: Send the part number for which user is making payment. 

> **Note**
> User would not be allowed to proceed to the next part number unless the previous part is paid for (successful). 
> 
> * For Fixed plan, call order status to the fetch the order details of the part payment paid for and the initiate the transaction with the correct part number and amount. E.g. If part 1 is paid and part 2 is in pending in order status, do not initiate transaction with part 3 since part 2 needs to be paid first.
> * For editable plan, call order status to determine the total number of parts already paid for. Then add plus 1 to the part number of the last successful transaction to initiate payment for next part.
> * For Transaction initiation, refer to this doc: [https://juspay.io/in/docs/ec-api/docs/base-integration/credit--debit-card-transaction](https://juspay.io/in/docs/ec-api/docs/base-integration/credit--debit-card-transaction)


- Tags: Mandatory, Required
## API Responses:
### 200:

#### payment:
- Value:
  - **Authentication**:
    - Value:
      - **Method**:
        - Value: GET
        - Tags: String
      - **Url**:
        - Value: http://localhost:8080/v2/pay/start/azharamin/mozrTCkdXzCNYqMtA3k
        - Tags: String
    - Tags: Object
- Tags: Object

#### status:
- Value: PENDING_VBV
- Tags: String

#### txn_uuid:
- Value: mozrTCkdXzCNYqMtA3k
- Tags: String

#### order_id:
- Value: partLocal1745929649
- Tags: String

#### txn_id:
- Value: azharamin-partLocal1745929649-2
- Tags: String
