Skip to main content
POST
/
crypto
/
session
/
widget
Create a crypto widget
curl --request POST \
  --url https://api-sb.meld.io/crypto/session/widget \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sessionData": {
    "serviceProvider": "ALCHEMYPAY"
  },
  "sessionType": "BUY"
}
'
{
  "customerId": "<string>",
  "externalCustomerId": "<string>",
  "externalSessionId": "<string>",
  "id": "<string>",
  "serviceProviderWidgetUrl": "<string>",
  "token": "<string>",
  "widgetUrl": "<string>"
}

Authorizations

Authorization
string
header
default:BASIC <Meld API Key>
required

Body

application/json
sessionData
Buy Crypto · object
required

Data related to the session

sessionType
enum<string>
required

The type of widget session to create

Available options:
BUY,
SELL,
TRANSFER
bypassKyc
boolean

When true, the system will automatically look up the customer's KYC status and generate a share token if KYC is approved. Requires a valid customerId or externalCustomerId.

customerId
string

Meld generated unique identifier for your customer. This should be used to track customer activity.

externalCustomerId
string

Your unique identifier for your customer. If maintaining your own customer management system this can also be used for tracking customer activity.

externalSessionId
string

Your reference id for your widget session, if you use this optional field you must pass in a unique value each time

externalSubaccountCustomerId
string

Optional external identifier for the sub-account customer this transaction belongs to. Used for tracking when multiple businesses operate under one Meld account. A sub-account customer must be created first before it can be referenced.

subaccountCustomerId
string

Optional Meld customer id used to track the business sub-account this transaction belongs to when multiple businesses operate under one Meld account.

Response

Widget created

customerId
string

Meld generated unique identifier for your customer. This should be used to track customer activity.

externalCustomerId
string

Your unique identifier for your customer. If maintaining your own customer management system this can also be used for tracking customer activity.

externalSessionId
string

Your reference Id for your widget session

id
string

Unique identifier for this session

serviceProviderWidgetUrl
string

The service provider's widget URL

token
string

The session token

widgetUrl
string

The crypto widget URL