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.
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
Parameter | Required | Type | Description |
---|---|---|---|
origin | Yes | string | The window origin of the host |
mode | Yes | string | iframe or popup |
merchant_reference_id | No | string | Typically a checkout or cart id, currently used for tracking only |
amount_in_cents | No | int | The amount of the order in cents |
currency | No | string | The 3 character currency code as defined by ISO 4217 |
customer | No | object | The customer for this session |
card_response_format | Optional | string | Value of token required to use tokenization |
Customer object
Parameter | Type | Description |
---|---|---|
string | The customer's email address | |
first_name | string | The customer's first name |
last_name | string | The customer's last name |
phone | string | The customer's phone number |
billing_address | object | The customer's billing address |
Address Object
Parameter | Type | Description |
---|---|---|
street | string | The street and number of the address |
street2 | string | The apt or unit |
city | string | The city |
state | string | The 2 character state code |
postal_code | string | The postal delivery code |
country_code | string | The 2 character country code |
Item Object
Parameter | Type | Description |
---|---|---|
name | string | The name of the item |
sku | string | The sku identifier |
quantity | int | The quantity purchased |
price | object | The price object |
Price Object
Parameter | Type | Description |
---|---|---|
amount_in_cents | int | The amount of the item in cents |
currency | string | The 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"
}