So how can I update my customer data when there a payment will be charge on cadence.
I’m storing customer_id, card_id, subscription_id and event_id.
I can not see any subscription ID in the response, and I’m not sure event id will changed on every webhook. Please suggest me appropriate solution so I can update customer subscription date on automatic charge.
invoice.payment_made
{
"merchant_id": "031FEV2Q6VMPK",
"location_id": "ES0RJRZYEC39A",
"type": "invoice.payment_made",
"event_id": "891e3589-462f-4215-9b61-f6df2d4432b7",
"created_at": "2020-06-18T18:23:11Z",
"data": {
"type": "invoice",
"id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY",
"object": {
"invoice": {
"id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY",
"version": 3,
"location_id": "ES0RJRZYEC39A",
"order_id": "CAISENgvlJ6jLWAzERDzjyHVybY",
"payment_requests": [
{
"uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355",
"request_type": "BALANCE",
"due_date": "2030-01-24",
"tipping_enabled": false,
"automatic_payment_source": "NONE",
"computed_amount_money": {
"amount": 10000,
"currency": "USD"
},
"total_completed_amount_money": {
"amount": 10000,
"currency": "USD"
}
}
],
"invoice_number": "inv-100",
"title": "Event Planning Services",
"description": "We appreciate your business!",
"delivery_method": "EMAIL",
"status": "PAID",
"timezone": "America/Los_Angeles",
"created_at": "2020-06-18T17:45:13Z",
"updated_at": "2020-06-18T18:23:11Z",
"primary_recipient": {
"customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4",
"given_name": "Amelia",
"family_name": "Earhart",
"email_address": "[email protected]",
"phone_number": "1-212-555-4240"
},
"accepted_payment_methods": {
"card": true,
"square_gift_card": false,
"bank_account": false,
"buy_now_pay_later": false
},
"custom_fields": [
{
"label": "Event Reference Number",
"value": "Ref. #1234",
"placement": "ABOVE_LINE_ITEMS"
},
{
"label": "Terms of Service",
"value": "The terms of service are...",
"placement": "BELOW_LINE_ITEMS"
}
],
"sale_or_service_date": "2030-01-24",
"store_payment_method_enabled": false
}
}
}
}