Purchases
List of endpoints to complete, fetch update and cancel purchases.
The Purchases Object
Attributes
Attribute | Data type | Required | Description |
---|---|---|---|
customer_id | string | true | Unique identifier for the customer |
order_id | integer | true | Unique identifier for the customer's order |
items | array | true | The cart items |
Items Object
Attributes
Attribute | Data type | Required | Description |
---|---|---|---|
item_type | string | true | Possible values: phone , tv , laptop , tablet , home_theater , furniture , fridge , cooker , other |
item_brand | string | true | The item brand |
store_key | string | true | Unique identifier for your store. We provide this. |
delivery_option | string | true | Possible values: customer_store_pickup , customer_lipalater_pickup , store_delivery , lipalater_delivery , agent_delivery . Default: store_delivery |
preferred_option | string | true | Possible values: delivery , pick_up . Default: delivery |
item_decription | string | true | Short description of the item |
facility_plan | string | true | The facility plan. Set it to lipalater_regular_plan |
item_code | string | true | Unique identifier for the item |
item_value | integer | true | The item price |
item_topup | string | false | |
topup_ref | string | false |
Create Purchases
POST /api/v2/purchases
curl request
curl -i -X POST 'https://core-v2-multi-country.herokuapp.com/api/v2/purchases' \
-H 'Authorization: Bearer <access_token>' \
-H 'Content-type: application/json' \
-d '{
"customer_id":"b7dd0bce-1c25-45ee-a458-6c5a765fb0f1",
"order_id":"113",
"items":[
{
"item_type":"other",
"item_brand":"16GB A Series Walkman Video MP3",
"store_key":"queens_mobile",
"delivery_option":"customer_store_pickup",
"preferred_option":"pick_up",
"item_description":"16GB A Series Walkman Video MP3",
"facility_plan":"lipalater_regular_plan",
"item_code":"H0148VPS1T",
"item_value":"50000",
"item_topup":"",
"topup_ref":""
},
{
"item_type":"other",
"item_brand":"36GB A Series Walkman Video MP3",
"store_key":"jkiarie",
"delivery_option":"customer_store_pickup",
"preferred_option":"queens_mobile",
"item_description":"16GB A Series Walkman Video MP3",
"facility_plan":"lipalater_regular_plan",
"item_code":"H0148VPS1T",
"item_value":"50000",
"item_topup":"",
"topup_ref":""
}
]}'
JSON request object
{
"customer_id": "8bf616dd-4cdc-4c55-80bc-58678102f3d3",
"order_id": "113",
"items": [
{
"item_type": "other",
"item_brand": "16GB A Series Walkman Video MP3",
"store_key": "jkiarie",
"delivery_option": "customer_store_pickup",
"preferred_option": "pick_up",
"item_description": "16GB A Series Walkman Video MP3",
"facility_plan": "lipalater_regular_plan",
"item_code": "H0148VPS1T",
"item_value": "50000",
"item_topup": "",
"topup_ref": ""
},
{
"item_type": "other",
"item_brand": "36GB A Series Walkman Video MP3",
"store_key": "jkiarie",
"delivery_option": "customer_store_pickup",
"preferred_option": "pick_up",
"item_description": "16GB A Series Walkman Video MP3",
"facility_plan": "lipalater_regular_plan",
"item_code": "H0148VPS1T",
"item_value": "50000",
"item_topup": "",
"topup_ref": ""
}
]
}
JSON response
{
"apiVersion": "2.0",
"status": 201,
"order_id": "113",
"data": [
{
"interest_rate": 4.2,
"loan_duration": 12,
"facility_status": "pending_collection_customer",
"preferred_option": "pick_up",
"facility_plan": 0,
"created_at": "2020-11-25T07:55:27.364Z",
"updated_at": "2020-11-25T07:55:27.364Z",
"item_type": "other",
"item_brand": "36GB A Series Walkman Video MP3",
"item_code": "H0148VPS1T",
"store_name": "QUEENS MOBILE",
"item_value": 50000.0,
"delivery_option": "customer_store_pickup",
"item_description": "16GB A Series Walkman Video MP3",
"item_topup": 0.0,
"topup_ref": "",
"upfront_fees": 0.0,
"source": "sales-rep",
"accepted_terms": "accepted",
"id": "33ac6c2d-5b4e-47a8-b107-6d1f0e5cc73f",
"loan_application_detail_id": "28fcaa6e-6fd3-4caf-9db5-b39cdd8734b3",
"partner_store_id": "61d273cf-6584-4429-af01-7b4dd2ae9f78",
"loan_product_id": "e55e5ec9-13b1-4dbf-ac14-40b482c5d677"
},...
]
}
Get Purchases
GET /api/v2/purchases/:purchases_id
curl request
curl -i GET 'https://core-v2-multi-country.herokuapp.com/api/v2/purchases/e87a57de-4fe3-447e-bfdf-89b9a1a6cd4f'
-H 'Authorization: Bearer Xq3P06LFD5p0yRy6ZoVGY13gY8UeKU4Oi_S1K9sA54M' \
-H 'Content-Type: application/json'
JSON response
{
"apiVersion": "2.0",
"status": 200,
"order_id": "113",
"data": {
"interest_rate": 4.2,
"loan_duration": 12,
"facility_status": "pending_collection_customer",
"preferred_option": "pick_up",
"facility_plan": 0,
"created_at": "2020-11-25T07:55:27.294Z",
"updated_at": "2020-11-25T07:55:27.294Z",
"item_type": "other",
"item_brand": "16GB A Series Walkman Video MP3",
"item_code": "H0148VPS1T",
"store_name": "QUEENS MOBILE",
"item_value": 50000.0,
"delivery_option": "customer_store_pickup",
"item_description": "16GB A Series Walkman Video MP3",
"item_topup": 0.0,
"topup_ref": "",
"upfront_fees": 0.0,
"source": "sales-rep",
"accepted_terms": "accepted",
"id": "e87a57de-4fe3-447e-bfdf-89b9a1a6cd4f",
"loan_application_detail_id": "28fcaa6e-6fd3-4caf-9db5-b39cdd8734b3",
"partner_store_id": "61d273cf-6584-4429-af01-7b4dd2ae9f78",
"loan_product_id": "e55e5ec9-13b1-4dbf-ac14-40b482c5d677"
}
}
Update Purchases
PUT /api/v2/purchases/:purchases_id
curl request
curl -i -X PUT 'https://core-v2-multi-country.herokuapp.com/api/v2/purchases'
-H 'Authorization: Bearer <access_token>'
-H 'Content-Type: application/json'
-d '{
"items":[
{
"id":"e87a57de-4fe3-447e-bfdf-89b9a1a6cd4f",
"facility_status":"collected_by_agent"
}
]
}'
JSON request object
{
"items": [
{
"id": "e87a57de-4fe3-447e-bfdf-89b9a1a6cd4f",
"facility_status": "collected_by_agent"
}
]
}
JSON response
{
"apiVersion": "2.0",
"status": 200,
"data": [
{
"id": "e87a57de-4fe3-447e-bfdf-89b9a1a6cd4f",
"facility_status": "collected_by_agent",
"loan_application_detail_id": "28fcaa6e-6fd3-4caf-9db5-b39cdd8734b3",
"partner_store_id": "61d273cf-6584-4429-af01-7b4dd2ae9f78",
"item_value": 50000.0,
"interest_rate": 4.2,
"loan_duration": 12,
"preferred_option": "pick_up",
"facility_plan": 0,
"created_at": "2020-11-25T07:55:27.294Z",
"updated_at": "2020-11-25T08:25:07.318Z",
"item_type": "other",
"item_brand": "16GB A Series Walkman Video MP3",
"item_code": "H0148VPS1T",
"store_name": "QUEENS MOBILE",
"delivery_option": "customer_store_pickup",
"item_description": "16GB A Series Walkman Video MP3",
"item_topup": 0.0,
"topup_ref": "",
"upfront_fees": 0.0,
"source": "sales-rep",
"accepted_terms": "accepted",
"loan_product_id": "e55e5ec9-13b1-4dbf-ac14-40b482c5d677"
}
]
}
Cancel Purchases
DELETE /api/v2/purchases/:purchases_id
curl request
curl -i DELETE 'https://core-v2-multi-country.herokuapp.com/api/v2/purchases/e87a57de-4fe3-447e-bfdf-89b9a1a6cd4f' \
-H 'Authorization: Bearer <access_token>' \
-H "Content-type: application/json"
JSON response
{
"apiVersion": "2.0",
"status": 200,
"data": {
"message": "Item with ID 24d40a7c-6ea5-4195-85d2-eabe4370dbe0 was successfully cancelled"
}
}