Pay upon receipt

Using the square API, I am able to create my invoices, publish my invoices but I seem to be having a problem getting my dates to work out the way that I want them to. I am usually processing my invoices the day before they are due, 1st or 15th, so processing them on the 14th or last day of the month. I notice that when I manually type in an invoice and I pick the 15th for the scheduled day and the 15th for the charge card on file, it says pay upon receipt. For me to do this when I am processing my invoices through the API, do I set the scheduled date and the due date the same, the 15th?
due date format: 2025-03-15
scheduled date format: 2025-03-15T00:02:45.883Z

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Create and Publish Invoices
Working with Dates
Pay or Refund Invoices

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Yes, you can set both the scheduled date and the due date to the 15th. The scheduled date is when the invoice is sent to the customer and the due date is when the payment is due. If you want the invoice to be paid upon receipt, you can set both dates to be the same. However, please note that the scheduled date should be in the format “YYYY-MM-DDTHH:MM:SS.sssZ” and the due date should be in the format “YYYY-MM-DD”. So for your example, you can set the due date as “2025-03-15” and the scheduled date as “2025-03-15T00:00:00Z”.

This answer was reviewed by @Bryan-Square.

1 Like

Ok, I tried this, since tomorrow is billing. I have the invoice due date set to this: “due_date”: “2025-03-01”, I have the scheduled date set to this: “scheduled_at”: “2025-03-01T00:00:00Z”,
All of my invoices were set as DRAFT, which didn’t make sense to me, so I looked and I received this error.

400 Response
date: Sat, 01 Mar 2025 01:52:41 GMT
transfer-encoding: chunked
content-disposition: inline
square-version: 2024-09-19
vary: Accept
x-frame-options: SAMEORIGIN
connection: keep-alive
content-type: application/json
cache-control: private

{
“errors”: [
{
“code”: “BAD_REQUEST”,
“detail”: “Scheduled date must be in the future”,
“field”: “invoice.scheduled_at”,
“category”: “INVALID_REQUEST_ERROR”
}
]

}

It is stating that the scheduled date must be in the future, is tomorrow, 03-01-2025, not the future? The timestamp that was listed under the error on the Status 400 page was, “2025-02-28 17:52:41 GMT-8”.
But in the error response above, it is saying it is already Mar 1,2025 GMT.
How do I fix this issue? I did what you said to do previously and getting an error from it…

Also, I have tried to login to reply and it gives me a login and says it is logging me in but then when I hit the reply button it just pops back to a login prompt. I even tried the send login link and tried that in a different browser and getting the same result…

Did you account for the timezone? Our API is on UTC time unless you pass in the timezone offset. :slight_smile: