hi, i wrote a webhook receiver that receives response from an a API. naturally, the response is in the form of a nested json data.
{
“event”: “subscription.create”,
“data”: {
“domain”: “test”,
“status”: “active”,
“subscription_code”: “Sblabla”,
“amount”: 50000,
“cron_expression”: “0 0 28 * *”,
“next_payment_date”: “2016-05-19T07:00:00.000Z”,
“open_invoice”: “none”,
“createdAt”: “2016-03-20T00:23:24.000Z”,
“plan”: {
“name”: “Monthly retainer”,
“plan_code”: “blabla”,
“description”: “subscription”,
“amount”: 50000,
“interval”: “monthly”,
“send_invoices”: ‘’,
“send_sms”: ‘’,
“currency”: “NGN”
},
“customer”: {
“first_name”: “BoJack”,
“last_name”: “Horseman”,
“email”: “bojack@horsinaround.com”,
“customer_code”: “CUSblbla”,
“phone”: “”,
“metadata”: {},
“risk_action”: “default”
},
“created_at”: “2016-10-01T10:59:59.000Z”
}
}
how do i extract some data and save them into a django model