Internal server Error on invoice creation

pablo.pizarro's Avatar


13 Jul, 2018 03:31 PM

Hello GoCoin support

I'm a developer implementing your API for an OTA. After making some succesful tests with the Postman App, I've started to implement on our system, but I've hit a roadblock.

I'm having trouble creating invoices, since whenever I send the callback_url or the redirect_url suplied by my frontend colleagues, the API is giving me a 500 error. I'm suspecting these params have a size limit, even though I have found no mention of this constraint in the docs. Is thatthe case?

This is the payload I send when creating an invoice. i got no trouble creating it without redirect_url or callback_url, or sending the urls:

   "item_description":"Hotel. Nuevo Boston - Madrid",

Thank you for your time.

  1. Support Staff 1 Posted by GoCoin DevTeam on 13 Jul, 2018 04:24 PM

    GoCoin DevTeam's Avatar


    I tested the exact JSON snippet you provided and it worked in my dev environment. We will look through the logs and see if anything shows up there.

  2. Support Staff 2 Posted by GoCoin DevTeam on 13 Jul, 2018 05:02 PM

    GoCoin DevTeam's Avatar

    Hi Pablo

    I have confirmed that the issue is URL string length as you suspected. (Loading db schema in our dev environment does not exactly replicate our staging & production databases due to version changes over time.) Currently our production database will not accept redirect_url or callback_url greater than 255 characters. We will look into increasing that limit, but it probably will not happen until early next week.

  3. 3 Posted by pablo.pizarro on 16 Jul, 2018 01:44 PM

    pablo.pizarro's Avatar

    Thanks for the fast response, we are looking forward to that change.

    I'm not sure if this is the right place to do so, but I've encountered a
    couple more annoyances while implementing.

    First, I haven't found a setting on the control panel to change the
    payout currency to EUR. When creating the invoice, are the received
    exchange rates (spot, inverse_spot) dependent on the payout currency or
    we need to use the spot_rate and the usd_spot_rate to get to our desired
    "eur_spot_rate" equivalent?

    Also, I'm getting a 422 http error when trying to change the split
    values on the payment settings tab.

    Thanks for your time.

    El 13/07/18 a las 19:02, GoCoin DevTeam escribió:

  4. Support Staff 4 Posted by GoCoin DevTeam on 16 Jul, 2018 02:36 PM

    GoCoin DevTeam's Avatar

    In order to use the payout split, you need a fiat payout account set up.

    We changed your payout currency to EUR.

  5. Support Staff 5 Posted by GoCoin DevTeam on 16 Jul, 2018 03:37 PM

    GoCoin DevTeam's Avatar

    The callback_url and redirect_url lengths have been increased. Please test again and let us know how things go.

  6. 6 Posted by pablo.pizarro on 16 Jul, 2018 03:50 PM

    pablo.pizarro's Avatar

    I've created the invoice no problem with the previously invalid urls, so
    thats a success, thanks!

    El 16/07/18 a las 17:37, GoCoin DevTeam escribió:

  7. 7 Posted by pablo.pizarro on 17 Jul, 2018 11:42 AM

    pablo.pizarro's Avatar

    Hello again, I'm back with another question since you are so fast and
    reliable :)

    I'm trying to test my callback_url implementation and I'm having trouble
    making the webhooks work.

    The steps I'm taking are: creating a bill, selecting the currency and
    getting the invoice ready to pay, then before it expires, from the
    invoice page on the dashboard, advanced options, select the
    invoice_payment_received and checking the callback_url is the one I sent
    in the bill creation. Then I click the "Send Webhook" button and watch
    my logs... where nothing happens.

    I've tested my callback_url on Chrome to rule out errors on my app entry
    point, and all works as intended, I just got no payload nor invoice
    obviously. I'm I missing something?

    This is the Chrome dev tools request data when I click the Send Webhook,
    if it helps:

            Request URL:
            Request Method:
            Status Code:
            Remote Address:
            Referrer Policy:
     1. Response Headers
            Tue, 17 Jul 2018 11:37:53 GMT
            1.1 vegur
     2. Request Headers
            application/json, text/plain, */*
            gzip, deflate, br
            _ga=GA1.2.1969361701.1531145575; __utmc=167445672;
            XDEBUG_SESSION=PHPSTORM; __utmb=167445672.9.10.1531823021;
            Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
            Gecko) Chrome/67.0.3396.99 Safari/537.36
     3. Request Payloadview source
             1. {,…}
                 1. callback_url:""
                 2. event_type:"invoice_created"

    Thank you for your time!

    El 16/07/18 a las 17:37, GoCoin DevTeam escribió:

  8. Support Staff 8 Posted by GoCoin DevTeam on 17 Jul, 2018 03:11 PM

    GoCoin DevTeam's Avatar

    Do you have a firewall setup blocking incoming webhooks?

    Our webhooks come from the following IP addresses:

  9. 9 Posted by pablo.pizarro on 23 Jul, 2018 03:19 PM

    pablo.pizarro's Avatar


    I've confirmed with our system administrators that we've got no firewall
    restrictions for those IPs.

    El 17/07/18 a las 17:12, GoCoin DevTeam escribió:

  10. Support Staff 10 Posted by GoCoin DevTeam on 23 Jul, 2018 04:10 PM

    GoCoin DevTeam's Avatar

    Please try using our test callback URL for a test. Post your merchant id in user_defined_8 field. You can add/modify the query string as desired for callback_url.

    "user_defined_8": "c56c20a3-31c9-49e2-ab0c-0231e4b57aff" "callback_url": ""

    The posts should show up here:

  11. 11 Posted by pablo.pizarro on 25 Jul, 2018 09:31 AM

    pablo.pizarro's Avatar

    I've tested with the parameters you suggested, even adding our own
    callback url in the query string and then using the dashboard to send a
    webhook and it seems to work. I'll recheck with our admins about the
    firewall block.

    Thank you for your time!

    El 23/07/18 a las 18:10, GoCoin DevTeam escribió:

  12. Support Staff 12 Posted by GoCoin DevTeam on 25 Jul, 2018 02:36 PM

    GoCoin DevTeam's Avatar

    Another consideration ... are you using a service like Cloudflare?

  13. 13 Posted by pablo.pizarro on 25 Jul, 2018 02:59 PM

    pablo.pizarro's Avatar

    We are using Cloudflare, yes, why?

    El 25/07/18 a las 16:36, GoCoin DevTeam escribió:

  14. Support Staff 14 Posted by GoCoin DevTeam on 25 Jul, 2018 03:05 PM

    GoCoin DevTeam's Avatar

    Depending on settings, Cloudflare may not be relaying the POST.

Discussions are closed to public comments.
If you need help with GoCoin Helpdesk please start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac