API and SDK reference
Installation
NPM
_10npm add kohortpay-node
Yarn
_10yarn 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
config?
: AxiosRequestConfig
Available config options for making requests.
Response
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
Payment Intents
Create
Create a new Payment Intent
Parameters
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
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
Payment Intents
Find One
Retrieve a Payment Intent by ID
Parameters
id
: string
ID of the Payment Intent to fetch
config?
: AxiosRequestConfig
Available config options for making requests.
Response
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
Payment Intents
Cancel
Cancel a Payment Intent by ID
Parameters
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
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
Payment Groups
Available Operations
- Find All - Retrieve all payment groups
- Create - Create a new payment group
- Find One - Retrieve a payment group by id
- Update - Update a payment group by id
- Get Participants - Retrieve participants of a payment group by id
- Cancel - Cancel a payment group by id
- Expire - Expire a payment group by id
- Validate Payment Group - Validate a payment group by id
Payment Groups
Find All
Retrieve all payment groups
Parameters
config?
: AxiosRequestConfig
Available config options for making requests.
Response
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
Payment Groups
Create
Create a new payment group
Parameters
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
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
Payment Groups
Find One
Retrieve a payment group by id
Parameters
Response
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
Payment Groups
Update
Update a payment group by id
Parameters
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
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
Payment Groups
Get Participants
Retrieve participants of a payment group by id
Parameters
Response
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
Payment Groups
Cancel
Cancel a payment group by id
Parameters
Response
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
Payment Groups
Expire
Expire a payment group by id
Parameters
Response
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
Payment Groups
Validate Payment Group
Validate a payment group by id
Parameters
id
: string
validatePaymentGroupDto
: components.ValidatePaymentGroupDto
Show child properties
config?
: AxiosRequestConfig
Available config options for making requests.
Response
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
Customers
Available Operations
- Find All - find All customers of an organization.
- Create - Create a new customer.
- Delete - Delete a customer.
- Find One - find All customers of an organization.
- Update Customer - Update a customer.
Customers
Find All
find All customers of an organization.
Parameters
config?
: AxiosRequestConfig
Available config options for making requests.
Response
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
Customers
Create
Create a new customer.
Parameters
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
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
Customers
Delete
Delete a customer.
Parameters
Response
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
Customers
Find One
find All customers of an organization.
Parameters
Response
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
Customers
Update Customer
Update a customer.
Parameters
id
: string
updateCustomerDto
: components.UpdateCustomerDto
Show child properties
config?
: AxiosRequestConfig
Available config options for making requests.
Response
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
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
config?
: AxiosRequestConfig
Available config options for making requests.
Response
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
Checkout Sessions
Create
Create a new checkout session.
Parameters
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
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
Checkout Sessions
Find One
Retrieve a checkout session by ID for the current organization and livemode.
Parameters
id
: string
ID of the checkout session to retrieve.
config?
: AxiosRequestConfig
Available config options for making requests.
Response
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
Checkout Sessions
Expire
Expire a checkout session by ID for the current organization and livemode.
Parameters
id
: string
ID of the checkout session to expire.
config?
: AxiosRequestConfig
Available config options for making requests.
Response
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.