Skip to main content
POST
/
platform
/
v1
/
sessions
cURL
curl --request POST \
  --url https://api.moonpay.com/platform/v1/sessions \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "externalCustomerId": "<string>",
  "deviceIp": "0.0.0.0",
  "email": "<string>",
  "phoneNumber": "<string>"
}
'
{
  "sessionToken": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Api-Key
string
header
required

Secret key provided as an Authorization header.

Example: Authorization: Api-Key <secretKey>

Body

application/json
externalCustomerId
string
required

A unique identifier for the customer from your system.

Required string length: 1 - 255
Example:

"user_01AN4Z07BY"

deviceIp
required

The IP address of the user's device to ensure the integrity of the session. Both IPv4 and IPv6 values are supported.

Example:

"0.0.0.0"

email
string

The customer's email address. Must be a valid email. If provided, phoneNumber must also be provided.

Example:

"user@example.com"

phoneNumber
string

The customer's phone number in E.164 format. If provided, email must also be provided.

Example:

"+14155551234"

Response

The request has succeeded.

sessionToken
string
required

An opaque session token used to set up a connection on your frontend. This token is single-use and must be generated each time the customer visits your app.

Token expires 24 hours after issuance.

Required string length: 1 - 8192
Example:

"c2Vzc2lvbi50b2tlbg"