Invoice API Pay Now Link


I'm using the API (via the PHP SDK) to create a booking, and then using the booking ID I get back to retrieve the invoice in order to display that invoice on my site.

For the most part that works fine, however when I retrieve the invoice I don't seem to get the 'Pay Now' link like I believe I should.  If I grab the booking ID that my code used and then go back through the Developer Console and retrieve the invoice via /booking/{my booking id}/invoice the Developer Console DOES get the Pay Now link back.

What gives?  Is there some sort of security setting that I'm missing that's causing the Pay Now link to be stripped out when I call the API from my site?


  • A number of API endpoints are affected by the user you're acting on behalf of; from the developer console, this will always be your own logged in user.  When using a server authentication token to access the API, the X-On-Behalf header (or 'account_id' in the SDK library config) will specify the user -- typically you'll have this set to "off" in order to act as a customer. 

    For the invoice templates specifically, the display does change based on whether you're acting as a customer, and this will match what you would see viewing the invoice in an email or from the web, which will follow your e-commerce and layout settings relating to your invoice payments.  If the button isn't showing when acting as a customer, you'll want to check that the option to enable the "Pay Now" link is enabled in the invoice layout (Manage > Layout > Invoice), and that e-commerce is enabled with methods available for the customer to make a payment.

    If you also need to manually construct a payment link, you can do so by combining the customer booking token returned in a booking/{booking_id} call in the following format:
  • Great thanks!  I never got the pay now link to show in the invoice html, but was able to form my own Pay Now link just fine.
Sign In or Register to comment.