POST
/
orders
curl --request POST \
  --url https://api.kohortpay.com/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customerEmail": "[email protected]",
  "customerPhoneNumber": "+1 555 555 5555",
  "customerFirstName": "John",
  "customerLastName": "Doe",
  "customerId": "cus_xxxxxxxxxxxxxxxx",
  "metadata": {
    "basket_id": "1JYLo8KerLxWZaQtys6ZQ1xS"
  },
  "amount": 35000,
  "locale": "en_US",
  "clientReferenceId": "myclientid-1234",
  "paymentGroupShareId": "KHTPAY-XXXXXXXX"
}'
{
  "id": "ord_1234567890",
  "livemode": true,
  "organizationId": "org_1234567890",
  "amount": 35000,
  "amountCashback": 5000,
  "applicationFeeAmount": 1000,
  "customerEmail": "[email protected]",
  "customerFirstName": "John",
  "customerLastName": "Doe",
  "customerPhoneNumber": "+1 555 555 5555",
  "paymentGroupShareId": "KHT-XXXXXXXX",
  "customerId": "cus_xxxxxxxxxxxxxxxx",
  "currency": "EUR",
  "locale": "en_US",
  "status": "CASHBACK_SENT",
  "metadata": {
    "basket_id": "1JYLo8KerLxWZaQtys6ZQ1xS"
  },
  "paymentGroupId": "pg_1234567890",
  "ambassadorId": "amb_1234567890",
  "clientReferenceId": "1234567890",
  "riskLevel": "LOW",
  "createdAt": "2021-07-22T00:00:00.000Z",
  "createdBy": "usr_1234567890",
  "updatedAt": "2021-07-22T00:00:00.000Z",
  "updatedBy": "usr_1234567890"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
amount
number
required

The total amount of the order in cents.

Required range: x >= 0
Example:

35000

customerEmail
string

The email of the customer.

Maximum length: 255
customerPhoneNumber
string

The phone number of the customer.

Example:

"+1 555 555 5555"

customerFirstName
string

The first name of the customer.

Maximum length: 100
Example:

"John"

customerLastName
string

The last name of the customer.

Maximum length: 100
Example:

"Doe"

customerId
string

The ID of the customer.

Maximum length: 50
Example:

"cus_xxxxxxxxxxxxxxxx"

metadata
object

Additional metadata for the order.

Example:
{ "basket_id": "1JYLo8KerLxWZaQtys6ZQ1xS" }
locale
enum<string>
default:fr_FR

The locale of the order

Available options:
en_US,
fr_FR
Example:

"en_US"

clientReferenceId
string

Unique string of your choice to reconcile with your internal system

Maximum length: 50
Example:

"myclientid-1234"

paymentGroupShareId
string | null

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

Maximum length: 50
Example:

"KHTPAY-XXXXXXXX"

Response

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

The id of the order.

Example:

"ord_1234567890"

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"

amount
number
required

The total amount of the order in cents.

Required range: x >= 0
Example:

35000

amountCashback
number | null
required

The cashback amount of the order in cents.

Required range: x >= 0
Example:

5000

applicationFeeAmount
number | null
required

The fees due to Kohort for this order in cents.

Required range: x >= 0
Example:

1000

customerEmail
string
required

The email of the customer.

customerFirstName
string
required

The first name of the customer.

Example:

"John"

customerLastName
string
required

The last name of the customer.

Example:

"Doe"

customerPhoneNumber
string
required

The phone number of the customer.

Example:

"+1 555 555 5555"

paymentGroupShareId
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"

customerId
string
required

The ID of the customer.

Example:

"cus_xxxxxxxxxxxxxxxx"

currency
enum<string>
default:EUR
required

The currency of the order.

Available options:
EUR
Example:

"EUR"

locale
enum<string>
default:fr_FR
required

The locale of the order.

Available options:
en_US,
fr_FR
Example:

"en_US"

status
enum<string>
required

The current status of the order.

Available options:
CREATED,
CASHBACK_AVAILABLE,
CASHBACK_PROCESSING,
CASHBACK_SENT
Example:

"CASHBACK_SENT"

metadata
object
required

Additional metadata for the order.

Example:
{ "basket_id": "1JYLo8KerLxWZaQtys6ZQ1xS" }
paymentGroupId
string | null
required

The id of the associated group.

Example:

"pg_1234567890"

ambassadorId
string | null
required

The id of the associated ambassador.

Example:

"amb_1234567890"

clientReferenceId
string | null
required

The reference id of the client. Use this field to renconcile with your system.

Example:

"1234567890"

riskLevel
enum<string>
required

The risk level of the order.

Available options:
LOW,
MEDIUM,
HIGH,
HIGHEST
Example:

"LOW"

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"