Closed erkovacs closed 3 years ago
Voucher endpoint created: https://60605b9104b05d0017ba25b2.mockapi.io/api/v1/voucher
Order endpoint created: https://60605b9104b05d0017ba25b2.mockapi.io/api/v1/order
API can be used:
https://60605b9104b05d0017ba25b2.mockapi.io/api/v1/:endpoint
POST /voucher
{
"responseId": "1",
"voucher": "a6b21ef0-f768-4b5b-8457-60a6b2a73a60",
"createdAt": "2021-03-28T10:05:22.086Z",
"success": true,
"phone": "0724123456",
"fax": "",
"county": "Arad",
"locality": "Arad",
"code": "123123",
"street": "Str. Garoafelor",
"number": "3",
"entrance": "2",
"block": "C-6",
"floor": "3",
"apartmentNumber": "21",
"notes": "Test"
}
POST /order
{
"externalOrderId": "1",
"success": true,
"orderId": "37",
"voucher": "a6b21ef0-f768-4b5b-8457-60a6b2a73a60"
}
GET /order?orderId=<order id>
<no params>
It should be a simple rest api:
POST /voucher {address} => initiate session and generate voucher, return voucher POST /orders {order_id, voucher} => create order, return {external_order_id}
External service should determine, on the basis of order id and voucher, if the user is to receive treatment or placebo. At no point will user authenticate, and the provided address and other info will not be linked to them personally.