---
agentTools:
  projectIndex: https://docs.chargeafter.com/llms.txt
---

# Create a new session

Creates a session with an optional cart, consumer and checkout details.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Checkout Management",
    "description": "Welcome to ChargeAfter API reference! This API is implemented in a RESTful state of mind, it has straight-forward, resource-oriented endpoints, and produces standard HTTP response codes to communicate back the result of operations. To get started please contact ChargeAfter support to get your API keys, and get an access to your testing and live environments.",
    "termsOfService": "https://chargeafter.com/privacy-policy",
    "contact": {
      "name": "Customer Support",
      "email": "support@chargeafter.com"
    },
    "version": "3.0.22+7e1a9d5f054dd9d981fc916bc81e7d98826a01ee"
  },
  "servers": [
    {
      "url": "https://api-sandbox.ca-dev.co",
      "description": "Local Environment"
    },
    {
      "url": "https://api.chargeafter.com",
      "description": "Production Environment"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/v3/session": {
      "post": {
        "tags": [
          "SessionsV3"
        ],
        "summary": "Create a new session",
        "description": "Creates a session with an optional cart, consumer and checkout details.",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.CreateSessionRequestBodyV3"
                  }
                ]
              }
            },
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.CreateSessionRequestBodyV3"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.CreateSessionRequestBodyV3"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.CreateSessionRequestBodyV3"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.CreateSessionResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.CreateSessionResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.CreateSessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string",
                      "example": "Unique RequestId"
                    },
                    "message": {
                      "type": "string",
                      "example": "Message Describing The Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "422": {
            "description": "Input Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "validationState": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "example": {
                    "RequestId": "Unique RequestId",
                    "Message": "Input Validation Failure",
                    "Errors": [
                      {
                        "Field": "RequestField1",
                        "ValidationState": "Invalid",
                        "Error": "RequestField1 should be up to 150 characters, and can contain a-z, A-Z, _ characters."
                      }
                    ]
                  }
                }
              }
            }
          },
          "500": {
            "description": "General Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "requestId": "Unique RequestId",
                    "errors": [
                      {
                        "code": "1",
                        "description": "Internal unknown error occurred"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ChargeAfter.BFF.WebApi.Contracts.CreateSessionRequestBodyV3": {
        "required": [
          "checkoutDetails"
        ],
        "type": "object",
        "properties": {
          "consumerDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.Models.ConsumerDetails"
              }
            ],
            "description": "Optional consumer details",
            "nullable": true
          },
          "cartDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.CartDetails"
              }
            ],
            "description": "Order cart details. Mandatory for checkout, optional for apply flow.",
            "nullable": true
          },
          "merchantDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.Models.MerchantDetails"
              }
            ],
            "description": "Optional merchant details",
            "nullable": true
          },
          "checkoutDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.Models.CheckoutDetailsV3"
              }
            ],
            "description": "Checkout details"
          },
          "userId": {
            "type": "string",
            "description": "Optional user id",
            "nullable": true
          },
          "linkId": {
            "type": "string",
            "description": "Optional Omni-Link id",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ChargeAfter.BFF.WebApi.Contracts.CreateSessionResponse": {
        "required": [
          "applicationId",
          "expirationDate",
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string",
            "description": "SessionToken"
          },
          "expirationDate": {
            "minLength": 1,
            "type": "string",
            "description": "Expiration date for the created session."
          },
          "applicationId": {
            "minLength": 1,
            "type": "string",
            "description": "Unique identifier of the application"
          },
          "isContinuation": {
            "type": "boolean"
          },
          "deviceSessionId": {
            "type": "string",
            "nullable": true
          },
          "merchantDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.BFF.WebApi.Contracts.Responses.Models.SessionMerchantDetailsResponse"
              }
            ],
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ChargeAfter.BFF.WebApi.Contracts.Models.CheckoutDetailsV3": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "description": "Optional ISO 4217 currency code. If not provided, the USD currency will be used.",
            "nullable": true
          },
          "flowType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.FlowType"
              }
            ],
            "description": "Optional flow type. If not provided, the Checkout flow type will be used.",
            "nullable": true
          },
          "channel": {
            "type": "string",
            "description": "Optional Channel. If not provided, the E_COMMERCE channel will be used.<br />\r\nOther options are IN_STORE / CALL_CENTER / IN_HOME",
            "nullable": true
          },
          "source": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Contracts.Source"
              }
            ],
            "description": "Source of the request. Api should be specified for all requests coming from the API.",
            "nullable": true
          },
          "tokens": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional security tokens",
            "nullable": true
          },
          "promoCode": {
            "type": "string",
            "description": "Optional promo code",
            "nullable": true
          },
          "requestedLoanAmount": {
            "type": "number",
            "description": "Optional requested loan amount, if supported by the underlying lenders.",
            "format": "double",
            "nullable": true
          },
          "tags": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Merchant's tags for this application.<br />\r\nThe tags will be used for marking/analytics purposes.",
            "nullable": true
          },
          "correlationId": {
            "type": "string",
            "description": "Optional merchant's correlation id for this application.",
            "nullable": true
          },
          "merchantPromoCode": {
            "type": "string",
            "description": "Optional merchant promo code.",
            "nullable": true
          },
          "intent": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.Entities.IntentSafe"
              }
            ],
            "description": "Optional intent used for initiating specific lender flows.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ChargeAfter.BFF.WebApi.Contracts.Models.ConsumerDetails": {
        "required": [
          "billingAddress",
          "dateOfBirth",
          "email",
          "firstName",
          "lastName",
          "netMonthlyIncome",
          "shippingAddress"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "firstName": {
            "minLength": 1,
            "type": "string",
            "description": "Consumer first name",
            "example": "John"
          },
          "lastName": {
            "minLength": 1,
            "type": "string",
            "description": "Consumer last name",
            "example": "Doe"
          },
          "email": {
            "minLength": 1,
            "type": "string",
            "description": "Consumer email",
            "example": "john.doe@gmail.com"
          },
          "shippingAddress": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Address"
              }
            ],
            "description": "Consumer shipping address"
          },
          "billingAddress": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Address"
              }
            ],
            "description": "Consumer billing address"
          },
          "spouseInfo": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.SpouseInfo"
              }
            ],
            "description": "Spouse information",
            "nullable": true
          },
          "marriageStatus": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.MarriageStatus"
              }
            ],
            "description": "Marriage status",
            "nullable": true
          },
          "netMonthlyIncome": {
            "type": "number",
            "description": "Net monthly income. Provide either net or gross monthly income.",
            "format": "double",
            "example": 5000
          },
          "annualNetIncome": {
            "type": "number",
            "description": "Annual net income",
            "format": "double",
            "nullable": true
          },
          "annualGrossIncome": {
            "type": "number",
            "description": "Annual net income",
            "format": "double",
            "nullable": true
          },
          "updatedIncomeType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.Entities.IncomeType"
              }
            ],
            "description": "The most recently update income type.",
            "nullable": true
          },
          "monthlyHousingPaymentIncome": {
            "type": "number",
            "description": "Monthly housing payment income",
            "format": "double",
            "nullable": true
          },
          "grossMonthlyIncome": {
            "type": "number",
            "description": "Gross monthly income. Provide either net or gross monthly income.",
            "format": "double",
            "nullable": true
          },
          "dateOfBirth": {
            "type": "string",
            "description": "Date of birth in ISO 8601 format",
            "format": "date-time",
            "example": "1994-05-12T00:00:00Z"
          },
          "socialSecurityNumber": {
            "type": "string",
            "description": "US Social security number (SSN) or Tax ID.<br />\r\n9-digits number without dashes.",
            "nullable": true,
            "example": "123456789"
          },
          "additionalIds": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.AdditionalIds"
              }
            ],
            "description": "Additional IDs, if any",
            "nullable": true
          },
          "mobilePhoneNumber": {
            "type": "string",
            "description": "Mobile phone number, only digits.",
            "nullable": true,
            "example": "2125555555"
          },
          "housingStatus": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.Entities.ResidenceType"
              }
            ],
            "description": "Housing status",
            "nullable": true
          },
          "preferences": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Preferences"
              }
            ],
            "description": "Optional preferences.",
            "nullable": true
          },
          "merchantConsumerId": {
            "type": "string",
            "description": "Consumer ID in merchant system",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ChargeAfter.BFF.WebApi.Contracts.Models.MerchantDetails": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string",
            "description": "The store identifier",
            "nullable": true
          },
          "posId": {
            "type": "string",
            "description": "The point of sale identifier",
            "nullable": true
          },
          "posType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.Entities.PosType"
              }
            ],
            "description": "The point of sale type",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ChargeAfter.BFF.WebApi.Contracts.Responses.Models.SessionMerchantDetailsResponse": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string",
            "description": "The store identifier",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ChargeAfter.Contracts.Source": {
        "enum": [
          "Api",
          "Dashboard",
          "Sdk",
          "Managed",
          "Consumers",
          "CheckoutApi",
          "Distributor",
          "Widget"
        ],
        "type": "string"
      },
      "ChargeAfter.Libraries.Entities.IncomeType": {
        "enum": [
          "MonthlyNet",
          "MonthlyGross",
          "AnnualNet",
          "AnnualGross"
        ],
        "type": "string"
      },
      "ChargeAfter.Libraries.Entities.IntentSafe": {
        "enum": [
          "ExistingAccount",
          "Authenticate",
          "ConfirmPayment",
          "StandaloneLookup"
        ],
        "type": "string"
      },
      "ChargeAfter.Libraries.Entities.PosType": {
        "enum": [
          "Kiosk",
          "Retail",
          "GenericMerchantDevice",
          "GenericConsumerDevice",
          "SelfServiceTerminal"
        ],
        "type": "string"
      },
      "ChargeAfter.Libraries.Entities.ResidenceType": {
        "enum": [
          "OWN",
          "RENT",
          "OTHER"
        ],
        "type": "string"
      },
      "ChargeAfter.Libraries.WebApi.Contracts.AdditionalIds": {
        "type": "object",
        "properties": {
          "socialInsuranceNumber": {
            "type": "string",
            "description": "Canadian Social Insurance Number",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Additional IDs"
      },
      "ChargeAfter.Libraries.WebApi.Contracts.Address": {
        "required": [
          "city",
          "country",
          "line1",
          "state",
          "zipCode"
        ],
        "type": "object",
        "properties": {
          "country": {
            "minLength": 1,
            "type": "string",
            "description": "Gets or sets the country.",
            "example": "US"
          },
          "state": {
            "minLength": 1,
            "type": "string",
            "description": "Gets or sets the state.",
            "example": "NY"
          },
          "city": {
            "minLength": 1,
            "type": "string",
            "description": "Gets or sets the city.",
            "example": "New York"
          },
          "line1": {
            "minLength": 1,
            "type": "string",
            "description": "Gets or sets the line1.",
            "example": "3 My Street"
          },
          "line2": {
            "type": "string",
            "description": "Gets or sets the line2.",
            "nullable": true,
            "example": "My Building, 4th floor"
          },
          "zipCode": {
            "minLength": 1,
            "type": "string",
            "description": "Gets or sets the zip code.",
            "example": "10019"
          }
        },
        "additionalProperties": false,
        "description": "Consumer Address info."
      },
      "ChargeAfter.Libraries.WebApi.Contracts.BoolType": {
        "enum": [
          "NO",
          "YES"
        ],
        "type": "string",
        "description": "This Enum created to match UI select control"
      },
      "ChargeAfter.Libraries.WebApi.Contracts.Language": {
        "enum": [
          "En",
          "Fr"
        ],
        "type": "string"
      },
      "ChargeAfter.Libraries.WebApi.Contracts.MarriageStatus": {
        "enum": [
          "Not Married",
          "Married"
        ],
        "type": "string",
        "description": "This Enum created to match UI select control."
      },
      "ChargeAfter.Libraries.WebApi.Contracts.Preferences": {
        "type": "object",
        "properties": {
          "language": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Language"
              }
            ],
            "nullable": true
          },
          "marketingOptIn": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.CartDetails": {
        "required": [
          "items",
          "totalAmount"
        ],
        "type": "object",
        "properties": {
          "merchantOrderId": {
            "type": "string",
            "description": "Optional merchant order identifier.",
            "nullable": true,
            "example": "12345"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.Item"
            },
            "description": "Line items."
          },
          "discounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.Discount"
            },
            "description": "Optional discounts.",
            "nullable": true
          },
          "taxAmount": {
            "type": "number",
            "description": "Total tax amount.",
            "format": "double",
            "example": 199
          },
          "shippingTaxAmount": {
            "type": "number",
            "description": "Shipping tax amount.",
            "format": "double",
            "nullable": true,
            "example": 1.9
          },
          "shippingAmount": {
            "type": "number",
            "description": "Shipping amount.",
            "format": "double",
            "nullable": true,
            "example": 19
          },
          "totalAmount": {
            "type": "number",
            "description": "Total amount.<br />\r\nMust be equal to the sum of all items - discounts + tax and shipping.",
            "format": "double",
            "example": 4297.9
          }
        },
        "additionalProperties": false,
        "description": "Order cart details. Mandatory for checkout, optional for apply flow."
      },
      "ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.Discount": {
        "required": [
          "amount"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the discount.",
            "nullable": true,
            "example": "Birthday discount"
          },
          "amount": {
            "type": "number",
            "description": "Amount of the discount.",
            "format": "double",
            "example": 20
          }
        },
        "additionalProperties": false,
        "description": "Discount details."
      },
      "ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.FlowType": {
        "enum": [
          "Apply",
          "Checkout"
        ],
        "type": "string",
        "description": "FlowType.<p>Description:</p><ul><li><i>Apply</i> - Consumer checks if cart eligible.</li><li><i>Checkout</i> - Consumer makes purchasing in merchant.</li></ul>"
      },
      "ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.Item": {
        "required": [
          "price",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Item name.",
            "nullable": true,
            "example": "Awesome Product"
          },
          "price": {
            "type": "number",
            "description": "Price of a single item.",
            "format": "double",
            "example": 1999
          },
          "sku": {
            "type": "string",
            "description": "Item SKU.",
            "nullable": true,
            "example": "AWSMPRDCT"
          },
          "quantity": {
            "type": "integer",
            "description": "Number of items.",
            "format": "int32",
            "example": 2
          },
          "leasable": {
            "type": "boolean",
            "description": "Indicates if the item is leasable (i.e. can be financed by LTO lender).",
            "nullable": true,
            "example": true
          },
          "productCategory": {
            "type": "string",
            "description": "Optional product category.",
            "nullable": true,
            "example": "Product category"
          },
          "warranty": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.Warranty"
              }
            ],
            "description": "Optional warranty for the item.",
            "nullable": true
          },
          "taxAmount": {
            "type": "number",
            "description": "Optional tax amount.",
            "format": "double",
            "nullable": true,
            "example": 199
          },
          "discounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.Discount"
            },
            "description": "Optional discounts.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Item details."
      },
      "ChargeAfter.Libraries.WebApi.Contracts.Requests.Models.Warranty": {
        "required": [
          "price"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Gets or sets the name.",
            "nullable": true,
            "example": "Awesome Warranty"
          },
          "sku": {
            "type": "string",
            "description": "Gets or sets the sku.",
            "nullable": true,
            "example": "AWSMWRNTY"
          },
          "price": {
            "type": "number",
            "description": "Gets or sets the price.",
            "format": "double",
            "example": 100
          }
        },
        "additionalProperties": false,
        "description": "Warranty."
      },
      "ChargeAfter.Libraries.WebApi.Contracts.SpouseInfo": {
        "type": "object",
        "properties": {
          "spouseSameAddress": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.BoolType"
              }
            ],
            "nullable": true
          },
          "spouseAddress": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeAfter.Libraries.WebApi.Contracts.Address"
              }
            ],
            "description": "Consumer Address info.",
            "nullable": true
          },
          "spouseFirstName": {
            "type": "string",
            "nullable": true
          },
          "spouseLastName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 103,
      "1": 159,
      "2": 120,
      "3": 166,
      "4": 120,
      "5": 200,
      "6": 200,
      "7": 0,
      "8": 17,
      "9": 69,
      "10": 102,
      "11": 87
    }
  }
}
```