POST FulfillmentEvent endpoint can not notify customer when add "happened_at" column in payload

popo-explore
New Member
3 0 0

I want to notify customer with POST FulfillmentEvent endpoint by email ,Everything goes well except when I add happened_at column,I can't receive email , Fulfillment property "notify_customer" has been set to TRUE,Is there anything wrong? If I remove happened_at column , I receive expected email ,See payload below

{
   "event": {
    "status": "out_for_delivery",
    "message":"Picked up",
    "estimated_delivery_at":"2021-06-29T02:09:54+08:00",
    "country":"Canada",
    "address1":"3575 Boul. Saint-Laurent",
    "city":"Montreal",
    "happened_at":"2021-06-28T02:09:54+08:00",
    "province":"QC",
    "created_at":"2021-06-28T02:09:54+08:00",
    "updated_at":"2021-06-28T02:09:54+08:00",
    "latitude":45.5017,
    "longitude":73.5673
  }
}
0 Likes
L_J_K
Shopify Staff
Shopify Staff
143 15 24

Hey @popo-explore 

When I try a POST create request for the Fulfillment to  admin/api/2021-07/orders/{order_id}/fulfillments.json with notify customer:true - it's that stage that my customer receives an email.

{
	"fulfillment": {
		"notify_customer": true,
		"location_id": 12345778,
		"tracking_number": "123456789",
		"tracking_company": "4PX"
	}
}

Then, when I try a POST to  admin/api/2021-04/orders/{order_id}/fulfillments/{fulfillment_id}/events.json with the same call as you, my Fulfillment Event is created 201 ok.

I would follow those steps - it seems to be working ok my side. Let me know if you have any questions!

 

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
0 Likes
popo-explore
New Member
3 0 0

Thanks @L_J_K 

I tried over 20 times  POST to admin/api/2021-04/orders/{order_id}/fulfillments/{fulfillment_id}/events.json  with different fulfillment_id ,payload likes below

{
   "event": {
    "status": "out_for_delivery",
    "message":"Picked up",
    "estimated_delivery_at":"2021-06-30T02:09:59+08:00",
    "country":"Canada",
    "address1":"3575 Boul. Saint-Laurent",
    "city":"Montreal",
    "happened_at":"2021-06-29T13:53:59+08:00",
    "province":"QC",
    "latitude":45.5017,
    "longitude":73.5673
  }
}

Something amazing happened !!! The first 15 times I got email but  others not , then no matter how many times I tried, I got nothing

Is there any rules for receiving email on a same shop at one time , such as time limit or frequency limit , even IP limit ???

Hope to get your reply, thanks !

0 Likes
L_J_K
Shopify Staff
Shopify Staff
143 15 24

Hey @popo-explore 

That sounds strange! But no explicit rules that I'm aware of.

I've noticed sometimes during testing that my test emails sent to my inbox can be auto flagged as spam by my recipient email server say,  If I'm creating a bunch of calls in one go and it's all to the same customer/email.  Although, having said that after a good go at replicating today I receive the email each time when I first post to admin/api/2021-07/orders/{order_id}/fulfillments.json with notify customer:true. 

It might be something you'd want to contact Shopify Technical Support about if it keeps occurring. They may be able to tell in the logs if emails bounced or other reason. Hope that helps!

 

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
0 Likes
popo-explore
New Member
3 0 0

@L_J_K Buy the way ,what's the meaning of "happened_at" which is one of properties about /shipping-and-fulfillment/fulfillmentevent  API,

I post "happened_at" in my payload

1、"happened_at":"2021-07-06T14:03:00+08:00",I got a email

2、"happened_at":"2021-07-05T16:20:00+08:00" , I can't 

And now time is 2021-07-06T15:19:00+08:00 

Why???

What's the rule of happened_at

0 Likes