Finalise checkout process by creating transactions and capturing payment
POST
/v1/basket/{familyId}/checkout
curl \
--request POST 'https://classmanager.test/v1/basket/fml_123123123123/checkout' \
--header "Content-Type: application/json" \
--data '{"items":{"trials":[{"time":"09:00","classId":"cls_xxxxxxxx","trialAt":"2024-08-20","studentId":"stu_xxxxxxxx"}],"enrolments":[{"classId":"cls_xxxxxxxx","studentId":"stu_xxxxxxxx","pricingPlanId":"pp_xxxxxxxx"}]},"paymentIntentId":"pi_xxxxxxxx"}'
Request example
{
"items": {
"trials": [
{
"time": "09:00",
"classId": "cls_xxxxxxxx",
"trialAt": "2024-08-20",
"studentId": "stu_xxxxxxxx"
}
],
"enrolments": [
{
"classId": "cls_xxxxxxxx",
"studentId": "stu_xxxxxxxx",
"pricingPlanId": "pp_xxxxxxxx"
}
]
},
"paymentIntentId": "pi_xxxxxxxx"
}
Response examples (200)
[
{
"aggregateId": "trn_xxxxxxxxxxx",
"transaction": {
"id": "trn_123123123123",
"companyId": "co_123123123123",
"familyId": "fml_123123123123",
"familyName": "Potter",
"relatedTransactionId": "trn_123123123123",
"type": "debit",
"date": "2023-12-05",
"description": "This is a transaction",
"orderId": "ord_xxxxxxxxxxxxxxxxxxxxxxxxxx",
"deletedAt": "2023-12-05 14:30:41"
},
"details": [
{
"details": {
"id": "trn_123123123123",
"companyId": "co_123123123123",
"transactionId": "trn_123123123123",
"type": "manual-debit",
"amount": 100,
"description": "This is a transaction",
"deletedAt": "2023-12-05 14:30:41"
},
"relatedEntities": [
{
"id": "trn_123123123123",
"companyId": "co_123123123123",
"transactionDetailId": "trnd_123123123123",
"entityId": "cls_123123123123"
}
]
}
],
"stats": {
"total": 1000,
"subtotal": 950,
"discountTotal": 30,
"taxTotal": 20
}
}
]