Index

API and SDK reference

Installation

NPM


_10
npm add kohortpay-node

Yarn


_10
yarn add kohortpay-node


Payment Intents

Available Operations

  • Find All - Retrieve all Payment Intents
  • Create - Create a new Payment Intent
  • Find One - Retrieve a Payment Intent by ID
  • Cancel - Cancel a Payment Intent by ID

Payment Intents

Find All

Retrieve all Payment Intents

Parameters

TypeScript
config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.FindAllPaymentIntentsResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

FindAll.ts

_15
import { KohortPay } from 'kohortpay-node';
_15
_15
async function run() {
_15
const sdk = new KohortPay({
_15
bearer: '',
_15
});
_15
_15
const res = await sdk.paymentIntents.findAll();
_15
_15
if (res.statusCode == 200) {
_15
// handle response
_15
}
_15
}
_15
_15
run();


Payment Intents

Create

Create a new Payment Intent

Parameters

TypeScript
request: components.CreatePaymentIntentDto

The request object to use for the request.

Show child properties
amount: number

The amount to be charged.


Example: 5000


checkoutSessionId: string

Checkout Session id of the payment intent


Example: cs_1abc2def3ghi


customerId?: string

Customer id of the payment intent


Example: cus_1abc2def3ghi


metadata?: components.Metadata

Additional metadata for the payment group.

Show child properties

status?: components.Status

Status of the payment intent


Example: REQUIRES_PAYMENT_METHOD

Show child properties

config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.CreatePaymentIntentResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing


createPaymentIntentDto?: components.CreatePaymentIntentDto

The Payment Intent has been successfully created.

Show child properties
Create.ts

_22
import { KohortPay } from "kohortpay-node";
_22
import { Status } from "openapi/dist/models/components";
_22
_22
async function run() {
_22
const sdk = new KohortPay({
_22
bearer: "",
_22
});
_22
_22
const res = await sdk.paymentIntents.create({
_22
amount: 5000,
_22
checkoutSessionId: "cs_1abc2def3ghi",
_22
customerId: "cus_1abc2def3ghi",
_22
metadata: {},
_22
status: Status.RequiresPaymentMethod,
_22
});
_22
_22
if (res.statusCode == 200) {
_22
// handle response
_22
}
_22
}
_22
_22
run();

Example Response

_10
{
_10
"amount": 5000,
_10
"checkoutSessionId": "cs_1abc2def3ghi",
_10
"customerId": "cus_1abc2def3ghi",
_10
"metadata": {}
_10
}

Status 201
Content-Type application/json

Payment Intents

Find One

Retrieve a Payment Intent by ID

Parameters

TypeScript
id: string

ID of the Payment Intent to fetch


config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.FindOnePaymentIntentResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

FindOne.ts

_17
import { KohortPay } from 'kohortpay-node';
_17
import { FindOnePaymentIntentRequest } from 'openapi/dist/models/operations';
_17
_17
async function run() {
_17
const sdk = new KohortPay({
_17
bearer: '',
_17
});
_17
const id: string = 'string';
_17
_17
const res = await sdk.paymentIntents.findOne(id);
_17
_17
if (res.statusCode == 200) {
_17
// handle response
_17
}
_17
}
_17
_17
run();


Payment Intents

Cancel

Cancel a Payment Intent by ID

Parameters

TypeScript
security: operations.CancelPaymentIntentSecurity

The security requirements to use for the request.

Show child properties
bearer?: string

bearer1?: string

id: string

ID of the Payment Intent to cancel


config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.CancelPaymentIntentResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

Cancel.ts

_21
import { KohortPay } from 'kohortpay-node';
_21
import {
_21
CancelPaymentIntentRequest,
_21
CancelPaymentIntentSecurity,
_21
} from 'openapi/dist/models/operations';
_21
_21
async function run() {
_21
const sdk = new SDK();
_21
const id: string = 'string';
_21
const operationSecurity: CancelPaymentIntentSecurity = {
_21
bearer: '',
_21
};
_21
_21
const res = await sdk.paymentIntents.cancel(operationSecurity, id);
_21
_21
if (res.statusCode == 200) {
_21
// handle response
_21
}
_21
}
_21
_21
run();


Payment Groups

Available Operations


Payment Groups

Find All

Retrieve all payment groups

Parameters

TypeScript
config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.FindAllPaymentGroupsResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

FindAll.ts

_15
import { KohortPay } from 'kohortpay-node';
_15
_15
async function run() {
_15
const sdk = new KohortPay({
_15
bearer: '',
_15
});
_15
_15
const res = await sdk.paymentGroups.findAll();
_15
_15
if (res.statusCode == 200) {
_15
// handle response
_15
}
_15
}
_15
_15
run();


Payment Groups

Create

Create a new payment group

Parameters

TypeScript
request: components.CreatePaymentGroupDto

The request object to use for the request.

Show child properties
customerId: string

The ID of the customer.


Example: cus_IzkjlvAhdjzjht3


paymentIntentId: string

The ID of the payment intent.


Example: pi_1JYLo8KerLxWZaQtys6ZQ1xR


metadata?: components.CreatePaymentGroupDtoMetadata

Additional metadata for the payment group.

Show child properties

expiresAt?: Date

The expiration date and time of the payment group.


Example: 2023-12-05T23:49:12.816Z


config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.CreatePaymentGroupResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

Create.ts

_20
import { KohortPay } from 'kohortpay-node';
_20
_20
async function run() {
_20
const sdk = new KohortPay({
_20
bearer: '',
_20
});
_20
_20
const res = await sdk.paymentGroups.create({
_20
customerId: 'cus_IzkjlvAhdjzjht3',
_20
paymentIntentId: 'pi_1JYLo8KerLxWZaQtys6ZQ1xR',
_20
metadata: {},
_20
expiresAt: new Date('2023-12-05T23:49:12.816Z'),
_20
});
_20
_20
if (res.statusCode == 200) {
_20
// handle response
_20
}
_20
}
_20
_20
run();


Payment Groups

Find One

Retrieve a payment group by id

Parameters

TypeScript
id: string

config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.FindOnePaymentGroupResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

FindOne.ts

_17
import { KohortPay } from 'kohortpay-node';
_17
import { FindOnePaymentGroupRequest } from 'openapi/dist/models/operations';
_17
_17
async function run() {
_17
const sdk = new KohortPay({
_17
bearer: '',
_17
});
_17
const id: string = 'string';
_17
_17
const res = await sdk.paymentGroups.findOne(id);
_17
_17
if (res.statusCode == 200) {
_17
// handle response
_17
}
_17
}
_17
_17
run();


Payment Groups

Update

Update a payment group by id

Parameters

TypeScript
id: string

updatePaymentGroupDto: components.UpdatePaymentGroupDto
Show child properties
metadata: components.UpdatePaymentGroupDtoMetadata

Additional metadata for the payment group update.

Show child properties

config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.UpdateResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

Update.ts

_24
import { KohortPay } from 'kohortpay-node';
_24
import {
_24
UpdatePaymentGroupDto,
_24
UpdatePaymentGroupDtoMetadata,
_24
} from 'openapi/dist/models/components';
_24
import { UpdateRequest } from 'openapi/dist/models/operations';
_24
_24
async function run() {
_24
const sdk = new KohortPay({
_24
bearer: '',
_24
});
_24
const id: string = 'string';
_24
const updatePaymentGroupDto: UpdatePaymentGroupDto = {
_24
metadata: {},
_24
};
_24
_24
const res = await sdk.paymentGroups.update(id, updatePaymentGroupDto);
_24
_24
if (res.statusCode == 200) {
_24
// handle response
_24
}
_24
}
_24
_24
run();


Payment Groups

Get Participants

Retrieve participants of a payment group by id

Parameters

TypeScript
id: string

config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.GetParticipantsResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

GetParticipants.ts

_17
import { KohortPay } from 'kohortpay-node';
_17
import { GetParticipantsRequest } from 'openapi/dist/models/operations';
_17
_17
async function run() {
_17
const sdk = new KohortPay({
_17
bearer: '',
_17
});
_17
const id: string = 'string';
_17
_17
const res = await sdk.paymentGroups.getParticipants(id);
_17
_17
if (res.statusCode == 200) {
_17
// handle response
_17
}
_17
}
_17
_17
run();


Payment Groups

Cancel

Cancel a payment group by id

Parameters

TypeScript
id: string

config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.CancelPaymentGroupResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

Cancel.ts

_17
import { KohortPay } from 'kohortpay-node';
_17
import { CancelPaymentGroupRequest } from 'openapi/dist/models/operations';
_17
_17
async function run() {
_17
const sdk = new KohortPay({
_17
bearer: '',
_17
});
_17
const id: string = 'string';
_17
_17
const res = await sdk.paymentGroups.cancel(id);
_17
_17
if (res.statusCode == 200) {
_17
// handle response
_17
}
_17
}
_17
_17
run();


Payment Groups

Expire

Expire a payment group by id

Parameters

TypeScript
id: string

config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.ExpirePaymentGroupResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

Expire.ts

_17
import { KohortPay } from 'kohortpay-node';
_17
import { ExpirePaymentGroupRequest } from 'openapi/dist/models/operations';
_17
_17
async function run() {
_17
const sdk = new KohortPay({
_17
bearer: '',
_17
});
_17
const id: string = 'string';
_17
_17
const res = await sdk.paymentGroups.expire(id);
_17
_17
if (res.statusCode == 200) {
_17
// handle response
_17
}
_17
}
_17
_17
run();


Payment Groups

Validate Payment Group

Validate a payment group by id

Parameters

TypeScript
id: string

validatePaymentGroupDto: components.ValidatePaymentGroupDto
Show child properties
customerEmail: string

The email address of the customer.


Example: [email protected]


config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.ValidatePaymentGroupResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

ValidatePaymentGroup.ts

_24
import { KohortPay } from 'kohortpay-node';
_24
import { ValidatePaymentGroupDto } from 'openapi/dist/models/components';
_24
import { ValidatePaymentGroupRequest } from 'openapi/dist/models/operations';
_24
_24
async function run() {
_24
const sdk = new KohortPay({
_24
bearer: '',
_24
});
_24
const id: string = 'string';
_24
const validatePaymentGroupDto: ValidatePaymentGroupDto = {
_24
customerEmail: '[email protected]',
_24
};
_24
_24
const res = await sdk.paymentGroups.validatePaymentGroup(
_24
id,
_24
validatePaymentGroupDto,
_24
);
_24
_24
if (res.statusCode == 200) {
_24
// handle response
_24
}
_24
}
_24
_24
run();


Customers

Available Operations


Customers

Find All

find All customers of an organization.

Parameters

TypeScript
config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.FindAllCustomersResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

FindAll.ts

_15
import { KohortPay } from 'kohortpay-node';
_15
_15
async function run() {
_15
const sdk = new KohortPay({
_15
bearer: '',
_15
});
_15
_15
const res = await sdk.customers.findAll();
_15
_15
if (res.statusCode == 200) {
_15
// handle response
_15
}
_15
}
_15
_15
run();


Customers

Create

Create a new customer.

Parameters

TypeScript
request: components.CreateCustomerDto

The request object to use for the request.

Show child properties
emailAddress: string

The primary email address of the user.


Example: [email protected]


firstName?: string

The first name of the customer.


Example: John


lastName?: string

The last name of the customer.


Example: Doe


phoneNumber?: string

The phone number of the customer.


Example: +1 555 555 5555


address?: components.CreateAddressDto

The address of the customer.

Show child properties

shippingAddress?: components.CreateAddressDto

The shipping address of the customer.

Show child properties

metadata?: components.CreateCustomerDtoMetadata

Additional metadata for the customer.

Show child properties

config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.CreateCustomerResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

Create.ts

_37
import { KohortPay } from 'kohortpay-node';
_37
_37
async function run() {
_37
const sdk = new KohortPay({
_37
bearer: '',
_37
});
_37
_37
const res = await sdk.customers.create({
_37
emailAddress: '[email protected]',
_37
firstName: 'John',
_37
lastName: 'Doe',
_37
phoneNumber: '+1 555 555 5555',
_37
address: {
_37
addressLine1: ' Avenue des Champs-Élysées',
_37
addressLine2: 'Appartement 4B',
_37
city: 'Paris',
_37
postalCode: '75014',
_37
country: 'France',
_37
state: 'Île-de-France',
_37
},
_37
shippingAddress: {
_37
addressLine1: ' Avenue des Champs-Élysées',
_37
addressLine2: 'Appartement 4B',
_37
city: 'Paris',
_37
postalCode: '75014',
_37
country: 'France',
_37
state: 'Île-de-France',
_37
},
_37
metadata: {},
_37
});
_37
_37
if (res.statusCode == 200) {
_37
// handle response
_37
}
_37
}
_37
_37
run();


Customers

Delete

Delete a customer.

Parameters

TypeScript
id: string

config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.DeleteCustomerResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

Delete.ts

_17
import { KohortPay } from 'kohortpay-node';
_17
import { DeleteCustomerRequest } from 'openapi/dist/models/operations';
_17
_17
async function run() {
_17
const sdk = new KohortPay({
_17
bearer: '',
_17
});
_17
const id: string = 'string';
_17
_17
const res = await sdk.customers.delete(id);
_17
_17
if (res.statusCode == 200) {
_17
// handle response
_17
}
_17
}
_17
_17
run();


Customers

Find One

find All customers of an organization.

Parameters

TypeScript
id: string

config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.FindOneCustomerResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

FindOne.ts

_17
import { KohortPay } from 'kohortpay-node';
_17
import { FindOneCustomerRequest } from 'openapi/dist/models/operations';
_17
_17
async function run() {
_17
const sdk = new KohortPay({
_17
bearer: '',
_17
});
_17
const id: string = 'string';
_17
_17
const res = await sdk.customers.findOne(id);
_17
_17
if (res.statusCode == 200) {
_17
// handle response
_17
}
_17
}
_17
_17
run();


Customers

Update Customer

Update a customer.

Parameters

TypeScript
id: string

updateCustomerDto: components.UpdateCustomerDto
Show child properties
deletedAt?: Date

Example: 2021-07-22T00:00:00.000Z


config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.UpdateCustomerResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing

UpdateCustomer.ts

_21
import { KohortPay } from 'kohortpay-node';
_21
import { UpdateCustomerDto } from 'openapi/dist/models/components';
_21
import { UpdateCustomerRequest } from 'openapi/dist/models/operations';
_21
_21
async function run() {
_21
const sdk = new KohortPay({
_21
bearer: '',
_21
});
_21
const id: string = 'string';
_21
const updateCustomerDto: UpdateCustomerDto = {
_21
deletedAt: new Date('2021-07-22T00:00:00.000Z'),
_21
};
_21
_21
const res = await sdk.customers.updateCustomer(id, updateCustomerDto);
_21
_21
if (res.statusCode == 200) {
_21
// handle response
_21
}
_21
}
_21
_21
run();


Checkout Sessions

Available Operations

  • Find All - Retrieve all checkout sessions for the current organization and livemode.
  • Create - Create a new checkout session.
  • Find One - Retrieve a checkout session by ID for the current organization and livemode.
  • Expire - Expire a checkout session by ID for the current organization and livemode.

Checkout Sessions

Find All

Retrieve all checkout sessions for the current organization and livemode.

Parameters

TypeScript
config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.FindAllCheckoutSessionsResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing


badRequestResponse?: components.BadRequestResponse

Bad Request

Show child properties

unauthorizedException?: components.UnauthorizedException

API key is not Valid

Show child properties

error?: components.ErrorT

Not Found Endpoint

Show child properties
FindAll.ts

_15
import { KohortPay } from "kohortpay-node";
_15
_15
async function run() {
_15
const sdk = new KohortPay({
_15
bearer: "",
_15
});
_15
_15
const res = await sdk.checkoutSessions.findAll();
_15
_15
if (res.statusCode == 200) {
_15
// handle response
_15
}
_15
}
_15
_15
run();

Example Response

_10
{
_10
"error": {
_10
"type": "invalid_request_error",
_10
"message": "Invalid input value.",
_10
"code": "Unauthorized"
_10
}
_10
}

Status 400
Content-Type application/json

Checkout Sessions

Create

Create a new checkout session.

Parameters

TypeScript
request: components.CreateCheckoutSessionDto

The request object to use for the request.

Show child properties
successUrl?: string

The URL to redirect the user to upon successful payment.


Example: https://success.example.com


cancelUrl?: string

The URL to redirect the user to upon cancellation of payment.


Example: https://cancel.example.com


customerEmail?: string

The email of the customer.


Example: [email protected]


customerFirstName?: string

The firstName of the customer.


Example: John


customerLastName?: string

The lastName of the customer.


Example: Doe


customerId?: string

The unique id of the customer


Example: user_xxxxxxxxxxxxxxxx


expiresAt?: Date

The expiration date of the checkout session.


Example: 2023-10-02T14:30:00.000Z


lineItems: components.CreateLineItemDto[]

List of items in the checkout session.

Show child properties

metadata?: components.CreateCheckoutSessionDtoMetadata

Additional metadata for the checkout session.

Show child properties

amountTotal: number

The total amount of the checkout session


Example: 35000


locale: string

The locale of the checkout session. default: fr_FR


Example: en-US


config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.CreateCheckoutResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing


badRequestResponse?: components.BadRequestResponse

Bad Request

Show child properties

unauthorizedException?: components.UnauthorizedException

API key is not Valid

Show child properties

notFoundException?: components.NotFoundException

NOT_FOUND

Show child properties
Create.ts

_36
import { KohortPay } from "kohortpay-node";
_36
_36
async function run() {
_36
const sdk = new KohortPay({
_36
bearer: "",
_36
});
_36
_36
const res = await sdk.checkoutSessions.create({
_36
successUrl: "https://success.example.com",
_36
cancelUrl: "https://cancel.example.com",
_36
customerEmail: "[email protected]",
_36
customerFirstName: "John",
_36
customerLastName: "Doe",
_36
customerId: "user_xxxxxxxxxxxxxxxx",
_36
expiresAt: new Date("2023-10-02T14:30:00.000Z"),
_36
lineItems: [
_36
{
_36
name: "Item Name",
_36
price: 100,
_36
quantity: 1,
_36
imageUrl: "https://example.com/image.jpg",
_36
description: "Item Description",
_36
type: "PRODUCT",
_36
},
_36
],
_36
metadata: {},
_36
amountTotal: 35000,
_36
locale: "en-US",
_36
});
_36
_36
if (res.statusCode == 200) {
_36
// handle response
_36
}
_36
}
_36
_36
run();

Example Response

_10
{
_10
"error": {
_10
"type": "invalid_request_error",
_10
"message": "Invalid input value.",
_10
"code": "Unauthorized"
_10
}
_10
}

Status 400
Content-Type application/json

Checkout Sessions

Find One

Retrieve a checkout session by ID for the current organization and livemode.

Parameters

TypeScript
id: string

ID of the checkout session to retrieve.


config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.FindOneCheckoutSessionResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing


unauthorizedException?: components.UnauthorizedException

API key is not Valid

Show child properties

notFoundException?: components.NotFoundException

Checkout session not found.

Show child properties
FindOne.ts

_17
import { KohortPay } from "kohortpay-node";
_17
import { FindOneCheckoutSessionRequest } from "openapi/dist/models/operations";
_17
_17
async function run() {
_17
const sdk = new KohortPay({
_17
bearer: "",
_17
});
_17
const id: string = "string";
_17
_17
const res = await sdk.checkoutSessions.findOne(id);
_17
_17
if (res.statusCode == 200) {
_17
// handle response
_17
}
_17
}
_17
_17
run();

Example Response

_10
{}

Status 401
Content-Type application/json

Checkout Sessions

Expire

Expire a checkout session by ID for the current organization and livemode.

Parameters

TypeScript
id: string

ID of the checkout session to expire.


config?: AxiosRequestConfig

Available config options for making requests.

Response

TypeScript
Promise<operations.ExpireCheckoutSessionResponse>
Hide child properties
contentType: string

HTTP response content type for this operation


statusCode: number

HTTP response status code for this operation


rawResponse: AxiosResponse

Raw HTTP response; suitable for custom response parsing


unauthorizedException?: components.UnauthorizedException

API key is not Valid

Show child properties

badRequestResponse?: components.BadRequestResponse

Checkout session not found.

Show child properties
Expire.ts

_17
import { KohortPay } from "kohortpay-node";
_17
import { ExpireCheckoutSessionRequest } from "openapi/dist/models/operations";
_17
_17
async function run() {
_17
const sdk = new KohortPay({
_17
bearer: "",
_17
});
_17
const id: string = "string";
_17
_17
const res = await sdk.checkoutSessions.expire(id);
_17
_17
if (res.statusCode == 200) {
_17
// handle response
_17
}
_17
}
_17
_17
run();

Example Response

_10
{}

Status 401
Content-Type application/json