---
page_title: Initiate Transaction EC API
product: digital-wallets-sea
page_source: https://docs.juspay.io/digital-wallets-sea/docs/how-to-integrate-web/initiate-transaction-ec-api
openapi: https://docs.juspay.io/api/swagger?document=https%3A%2F%2Fdocs.juspay.io%2Fdigital-wallets-sea%2Fdocs%2Fhow-to-integrate-web%2Finitiate-transaction-ec-api%3Fversion%3Ddefault
llms_txt: https://docs.juspay.io/llms.txt
product_llms_txt: https://docs.juspay.io/digital-wallets-sea/llms.txt
---

## API Version: default


# Txns API



This API supports both creation of order and transaction and authorizing the transaction. Pass the apple pay/Google pay token in transient_info to complete the transaction. 


#### **Processing Apple Pay Transactions** 



1. After the customer successfully authenticates the payment, the **Apple Pay SDK**  returns a **payment token** .
2. The merchant must forward this token to the **Txns API**  to complete the transaction.


#### For References:



* [Apple Pay on the Web](https://developer.apple.com/documentation/apple_pay_on_the_web/)
* [Apple Pay on iOS](https://developer.apple.com/documentation/passkit_apple_pay_and_wallet/apple_pay)## Endpoints:
- Sandbox: https://sandbox.juspay.in/txns

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

## Request Type: 
POST

## Content-Type: 
application/json

## Authorization:

#### Authorization:
- Tags: Base64, Mandatory
## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String, Mandatory
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location 'https://sandbox.juspay.in/txns' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'Authorization: Basic <Base64-Encoded-Key>' \
  --data-urlencode 'order.order_id=app_1728584102' \
  --data-urlencode 'merchant_id=seamena' \
  --data-urlencode 'payment_method_type=WALLET' \
  --data-urlencode 'payment_method=APPLEPAY' \
  --data-urlencode 'order.currency=SGD' \
  --data-urlencode 'gateway_id=75' \
  --data-urlencode 'order.amount=200' \
  --data-urlencode 'transient_info=<ApplePay_Token_JSON>' \
  --data-urlencode 'redirect_after_payment=true' \
  --data-urlencode 'format=json' \
  --data-urlencode 'order.metadata.JUSPAY%3Agateway_reference_id=applepay_stripe'

```

## Body Parameters:
### Basic Parameters:

#### order_id:
- Description: Unique id of the order
- Value: value
- Tags: String, Mandatory

#### order.currency:
- Description: 3-letter currency code of the order.
- Tags: String, Mandatory

#### order.amount:
- Description: Should be passed as “WALLET”
- Tags: Number, Mandatory

#### payment_method:
- Tags: String, Mandatory

#### order.metadata.JUSPAY:gateway_reference_id:
- Description: Reference id of the gateway which needs to be selected.

Based on what is returned in SDK initiate call
- Tags: String, Optional

#### gateway_id:
- Description: Juspay Gateway Id Number.

Based on what is returned in SDK initiate call
- Tags: Number, Optional

#### merchant_id:
- Description: A unique identifier of the merchant provided by the Juspay
- Tags: String, Mandatory

#### payment_method_type:
- Description: Should be passed as “WALLET”
- Tags: String, Mandatory

#### payemnt_method:
- Description: Should be passed as “APPLEPAY”
- Tags: String, Mandatory

#### transient_info:
- Description: Required for Applepay wallet flow. Pass the complete applepaywallet token payload.
- Tags: Object, Mandatory

#### redirect_after_payment:
- Description: Should be passed as true(boolean)
- Tags: Boolean, Mandatory

#### format:
- Description: Should be passed as json
- Tags: String, Mandatory
## API Responses:
### 200:

#### txn_uuid:
- Tags: String

#### txn_id:
- Tags: String

#### status:
- Tags: String

#### payment:
- Value:
  - **Sdk_params**:
    - Value:
      - **Status**:
        - Tags: String
      - **Error_code**:
        - Tags: String
      - **Response**:
        - Value:
          - **Checkout_mode**:
            - Tags: String
          - **State**:
            - Tags: String
          - **Layout**:
            - Value:
              - **Icon**:
                - Tags: String
              - **Banner_text**:
                - Tags: String
              - **Sub_text**:
                - Tags: String
              - **Cta_text**:
                - Tags: String
              - **Title**:
                - Tags: String
            - Tags: object
          - **Tracking_id**:
            - Tags: String
          - **Intent_url**:
            - Tags: String
          - **Reference_id**:
            - Tags: String
        - Tags: object
      - **Error_description**:
        - Tags: String
      - **Error_message**:
        - Tags: String
    - Tags: Object
  - **Authentication**:
    - Value:
      - **Url**:
        - Tags: String
      - **Method**:
        - Tags: String
    - Tags: object
- Tags: object

#### order_id:
- Tags: String
