POST
/
groups
curl --request POST \
  --url https://api.kohortpay.com/groups \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customerId": "cus_IzkjlvAhdjzjht3",
  "paymentIntentId": "pi_1JYLo8KerLxWZaQtys6ZQ1xR",
  "orderId": "pi_1JYLo8KerLxWZaQtys6ZQ1xR",
  "metadata": {
    "order_id": "ord_1JYLo8KerLxWZaQtys6ZQ1xS"
  },
  "expiresAt": "2024-11-05T14:44:03.303Z",
  "midExpireAt": "2024-11-05T14:44:00.805Z"
}'
{
  "id": "ord_1234567890",
  "shareId": "KHT-XXXXXXXX",
  "livemode": true,
  "organizationId": "org_1234567890",
  "customerId": "cus_1234567890",
  "creatorEmail": "[email protected]",
  "status": "COMPLETED",
  "metadata": {
    "basket_id": "1JYLo8KerLxWZaQtys6ZQ1xS"
  },
  "expiresAt": "2021-07-22T00:00:00.000Z",
  "midExpireAt": "2021-07-22T00:00:00.000Z",
  "jMinus2ExpireAt": "2021-07-22T00:00:00.000Z",
  "jPlus3StartAt": "2021-07-22T00:00:00.000Z",
  "reminderEmailSent": "NOT_SENT",
  "createdAt": "2021-07-22T00:00:00.000Z",
  "createdBy": "usr_1234567890",
  "updatedAt": "2021-07-22T00:00:00.000Z",
  "updatedBy": "usr_1234567890",
  "canceledAt": "2021-07-22T00:00:00.000Z",
  "completedAt": "2021-07-22T00:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
customerId
string
required

The ID of the customer. This field is required and must be a valid customer ID.

Example:

"cus_IzkjlvAhdjzjht3"

paymentIntentId
string
required

The ID of the payment intent associated with this payment group. This field is required and must be a valid payment intent ID.

Example:

"pi_1JYLo8KerLxWZaQtys6ZQ1xR"

orderId
string
required

The ID of the payment intent associated with this payment group. This field is required and must be a valid payment intent ID.

Example:

"pi_1JYLo8KerLxWZaQtys6ZQ1xR"

metadata
object

Additional metadata for the payment group. This can include any additional information needed to process the payment group.

Example:
{
  "order_id": "ord_1JYLo8KerLxWZaQtys6ZQ1xS"
}
expiresAt
string

The expiration date and time of the payment group. Must be between the minimum and maximum payment group duration.

Example:

"2024-11-05T14:44:03.303Z"

midExpireAt
string

The midpoint date and time of the payment group for reminder purposes. Must be before the expiration date.

Example:

"2024-11-05T14:44:00.805Z"

Response

201 - application/json
Group successfully created.
id
string
required

The id of the group.

Example:

"ord_1234567890"

shareId
string | null
required

The shared identifier of the group. If null, it will create a group. If not null, it will join the group.

Example:

"KHT-XXXXXXXX"

livemode
boolean
required

Wether the order is in live mode or test mode.

Example:

true

organizationId
string
required

The id of the organization.

Example:

"org_1234567890"

customerId
string
required

The id of the customer.

Example:

"cus_1234567890"

creatorEmail
string
required

The email of the creator of the group.

status
enum<string>
required

The status of the group.

Available options:
OPEN,
COMPLETED,
CANCELED,
EXPIRED
Example:

"COMPLETED"

metadata
object
required

Additional metadata for the order.

Example:
{ "basket_id": "1JYLo8KerLxWZaQtys6ZQ1xS" }
expiresAt
string
required
Example:

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

midExpireAt
string
required
Example:

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

jMinus2ExpireAt
string
required
Example:

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

jPlus3StartAt
string
required
Example:

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

reminderEmailSent
enum<string>
required

The reminder email sent status of the group.

Available options:
NOT_SENT,
MIDWAY_SENT,
DAY3_SENT,
DAY2_BEFORE_END_SENT
Example:

"NOT_SENT"

createdAt
string
required
Example:

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

createdBy
string | null
required

The id of the user who created the customer.

Example:

"usr_1234567890"

updatedAt
string
required
Example:

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

updatedBy
string | null
required

The id of the user who last updated the customer.

Example:

"usr_1234567890"

canceledAt
string
required
Example:

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

completedAt
string
required
Example:

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