---
updatedAt: 2025-11-05T05:43:35.000Z
agentTools:
  projectIndex: https://telr-api.readme.io/llms.txt
---

# Seamless JS SDK

## Mastercard JS API

The following API methods must be invoked during the checkout process. Refer to the Mastercard SDK <Anchor label="documentation " target="_blank" href="https://developer.mastercard.com/unified-checkout-solutions/documentation/sdk-reference/">documentation </Anchor>for full payload details and flow handling:

* Init() - Must be called only after successfully loading ths JS SDK.
* getCards()
* idLookup()
* initiateValidation()
* validate()
* checkoutWithCard()
* signOut()

<br />

<Image border={false} src="https://files.readme.io/523340c818f51cbe16ae0c86ae8d903a820ccb8217824340bb604c7ac6d4d7cb-image.png" />

<br />

<br />

## UI Suggestion

As you are not PCI DSS certified, please disable the Add Card option in the src-sdk UI by setting: `display-add-card="false"` while defining the custom element.

Display an information message to customers advising them to add or manage cards in their Click to Pay profile at [www.src.mastercard.com/profile/](http://www.src.mastercard.com/profile/) when no cards for listing, sample UI below:

<Image align="center" border={true} caption="Sample UI" src="https://files.readme.io/112c02eafd59a0546c4954f6c7c3b17760067d394a0cc1daaf2895e789798f65-image.png" />

<br />

<br />

Handle the checkoutWithCard response for checkoutActionCode: ADD\_CARD the same way as above (redirect or message to manage cards externally).

## Order API

Once checkoutWithCard is invoked

* Check the value of checkoutActionCode.
* If checkoutActionCode = COMPLETE, call the Order API with the clicktopay parameters.

```json order API fields
"paymethod": "clicktopay",
"clicktopay": {
  "merchantTransactionId": "<merchant-transaction-id from C2P JS>",
  "correlationId": "<srcCorrelationId from C2P JS>",
  "flowId": "<x-src-cx-flow-id from C2P JS>"
}

```

* Fallback to regular card flow in case of failure.
* Handle the ORDER API response same as existing flow.

<br />

> Sandbox profile can be created at <https://sandbox.src.mastercard.com/profile>