Search code examples
javascriptnode.jsfacebookfacebook-messenger

Facebook Messenger, Temporary send message failure when sending receipt


I want to send to user my receipt with dummy data.

I use this library which simplifies message sending to Facebook.

The structure of my payload is this:

var payload = {
    template_type: 'receipt',
    recipient_name: '@' + user.name + ' ' + user.surname,
    order_number: (new Date).getTime(),
    currency: 'USD',
    payment_method: 'Наличными',
    order_url: 'http://www.example.com',
    timestamp: (new Date).getTime() + '',
    elements: [
        {
            title: title,
            subtitle: subtitle,
            quantity: 1,
            price: 20,
            currency: 'USD',
            image_url: image_url
        }
    ],
    address: {
        street_1:"Nurly tau",
        street_2:"",
        city:"Almaty",
        postal_code:"050000",
        state:"KZ",
        country:"KZ"
    },
    summary: {
        subtotal: 20,
        shipping_cost: 0,
        total_tax: 0,
        total_cost: 20
    },
    adjustments: []
};

I have just filled receipt fields with simple fake data. Also, Facebook tracks the uniqueness of order_numbers of all sent recepts.

When I try to send this receipt I receive an error message:

{ message: '(#1200) Temporary send message failure. Please try again later',
  type: 'OAuthException',
  code: 1200,
  fbtrace_id: 'BHmHRCEQUC4' }

What does this error mean? Facebook's error messages are so enigmatic?


Solution

  • I had the same problem, after a lot of tries, I figured out that the problem is with the timestamp parameter passed with the JSON payload.

    I have no clue about what it could be, but it worked for me removing that. (Maybe, the timestamp should be for a moment before the API call, I don't know).