POST
/
v1
/
sessions
curl --request POST \
  --url https://api.salesnip.com/v1/sessions \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "projectId": "project_abcdefghjijklmnop",
  "currency": "USD",
  "callbacks": {
    "success": "https://example.com/salesnip/success?sessionId={SESSION_ID}",
    "cancel": "https://example.com/salesnip/cancel?sessionId={SESSION_ID}"
  },
  "products": [
    {
      "id": "your_product_id",
      "name": "Product Name",
      "description": "Product Description",
      "image": "https://example.com/product.png",
      "price": {
        "initial": 100,
        "minimum": 80
      },
      "quantity": {
        "initial": 1,
        "maximum": 10,
        "minimum": 1
      },
      "recurring": {
        "unit": "MONTH",
        "count": 6
      },
      "trial": {
        "unit": "MONTH",
        "count": 6
      },
      "metadata": {
        "description": "This is a description of the product"
      },
      "upsellProduct": {
        "id": "your_product_id",
        "name": "Product Name",
        "description": "Product Description",
        "image": "https://example.com/product.png",
        "price": {
          "initial": 100,
          "minimum": 80
        },
        "quantity": {
          "initial": 1,
          "maximum": 10,
          "minimum": 1
        },
        "recurring": {
          "unit": "MONTH",
          "count": 6
        },
        "trial": {
          "unit": "MONTH",
          "count": 6
        },
        "metadata": {
          "description": "This is a description of the product"
        }
      }
    }
  ],
  "crossSellProducts": [
    {
      "id": "your_product_id",
      "name": "Product Name",
      "description": "Product Description",
      "image": "https://example.com/product.png",
      "price": {
        "initial": 100,
        "minimum": 80
      },
      "quantity": {
        "initial": 1,
        "maximum": 10,
        "minimum": 1
      },
      "recurring": {
        "unit": "MONTH",
        "count": 6
      },
      "trial": {
        "unit": "MONTH",
        "count": 6
      },
      "metadata": {
        "description": "This is a description of the product"
      }
    }
  ],
  "metadata": {
    "some_important_info": "SaleSnip is awesome!"
  }
}'
{
  "id": "session_abcdefghjijklmnop",
  "url": "https://chat.salesnip.com/#abcdefghjijklmnop"
}

Authorizations

X-Api-Key
string
header
required

Body

application/json
projectId
string
required

The id of the SaleSnip project for this session. You can locate your project ID in the SaleSnip dashboard under the 'Keys' tab on the project level.

Example:

"project_abcdefghjijklmnop"

currency
enum<string>
required

The ISO 4217 currency code to be used throughout the negotiation. This will be used for all products.

Available options:
AED,
AFN,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BRL,
BSD,
BTN,
BWP,
BYN,
BZD,
CAD,
CDF,
CHF,
CKD,
CLP,
CNY,
COP,
CRC,
CUC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
EHP,
ERN,
ETB,
EUR,
FJD,
FKP,
FOK,
GBP,
GEL,
GGP,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
IMP,
INR,
IQD,
IRR,
ISK,
JEP,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KID,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MAD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRU,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PND,
PRB,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SLL,
SLS,
SOS,
SRD,
SSP,
STN,
SVC,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TVD,
TWD,
TZS,
UAH,
UGX,
USD,
UYU,
UZS,
VED,
VES,
VND,
VUV,
WST,
XAF,
XCD,
XOF,
XPF,
YER,
ZAR,
ZMW,
ZWB,
ZWL
Example:

"USD"

products
object[]
required

An array of products to be included in the negotiation.

callbacks
object

A set of callback URLs for the session. If you are using SaleSnip inside the widget, these fields can be left empty.

crossSellProducts
object[]

A selection of complementary products that can be added to the original purchase to enhance or extend its value. This is commonly known as a cross-sell.

metadata
object

Custom metadata to be included with the session.

Example:
{
  "some_important_info": "SaleSnip is awesome!"
}

Response

201
application/json
Created
id
string
required

The unique ID of the session. You can use this to open SaleSnip as a widget.

Example:

"session_abcdefghjijklmnop"

url
string
required

The hosted URL of the session. You can redirect users to this URL to use SaleSnip in a standalone mode.

Example:

"https://chat.salesnip.com/#abcdefghjijklmnop"