Skip to main content

Create a card session

This endpoint creates a card session in our system, and it returns the URL that you should redirect the user to. A card session represents the issuance of a Sezzle virtual card to a Sezzle user and/or the agreement of a Sezzle user to use the virtual card as payment. Use the card session endpoints to create and update a card session.

You can use this endpoint to create a virtual card session. The response will include a session uuid and the Sezzle customer dashboard URL to be hosted in an iframe or popup.

Virtual Only

Note: This endpoint should be used with our virtual card offering. It is not intended for the direct integration flow.

Endpoint

POST https://gateway.sezzle.com/v2/session/card

Properties

Card Session Object

ParameterRequiredTypeDescription
originYesstringThe window origin of the host
modeYesstringiframe or popup
merchant_reference_idNostringTypically a checkout or cart id, currently used for tracking only
amount_in_centsNointThe amount of the order in cents
currencyNostringThe 3 character currency code as defined by ISO 4217
customerNoobjectThe customer for this session
card_response_formatOptionalstringValue of token required to use tokenization

Customer object

ParameterTypeDescription
emailstringThe customer's email address
first_namestringThe customer's first name
last_namestringThe customer's last name
phonestringThe customer's phone number
billing_addressobjectThe customer's billing address

Address Object

ParameterTypeDescription
streetstringThe street and number of the address
street2stringThe apt or unit
citystringThe city
statestringThe 2 character state code
postal_codestringThe postal delivery code
country_codestringThe 2 character country code

Item Object

ParameterTypeDescription
namestringThe name of the item
skustringThe sku identifier
quantityintThe quantity purchased
priceobjectThe price object

Price Object

ParameterTypeDescription
amount_in_centsintThe amount of the item in cents
currencystringThe 3 character currency code as defined by ISO 4217

Request Object Examples

Card Session Request

{
"origin": "https://example.com",
"mode": "iframe",
"merchant_reference_id": "merchant-cart-id-max-255",
"amount_in_cents": 1000,
"currency": "USD",
"customer": {
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "6125551234",
"billing_address": {
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US"
}
},
"items": [
{
"name": "Blue tee",
"sku": "sku123456",
"quantity": 1,
"price": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
]
}

Tokenized Card Session

{
"origin": "https://example.com",
"mode": "iframe",
"merchant_reference_id": "merchant-cart-id-max-255",
"amount_in_cents": 1000,
"currency": "USD",
+ "card_response_format": "token"
"customer": {
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "6125551234",
"billing_address": {
"street": "123 W Lake St",
"street2": "Unit 104",
"city": "Minneapolis",
"state": "MN",
"postal_code": "55408",
"country_code": "US"
}
},
"items": [
{
"name": "Blue tee",
"sku": "sku123456",
"quantity": 1,
"price": {
"amount_in_cents": 1000,
"currency": "USD"
}
}
],
}

Response Object

The dashboard_url is a URL which the customer should be redirected to. Upon accepting the agreements there will be a postMessage returned for the payload of the card data.

{
"uuid": "fadbc642-05a4-4e38-9e74-80e325623af9",
"dashboard_url": "https://dashboard.sezzle.com/example?id=0001"
}