"due_date" differs between Request and Response

Not sure this is the right area, but when making an API call to create an invoice, this is my payment request object:

 

These are taken from the Square Developer Dashboard API Logs, and identical except for the sanitized card on file

 

Request:

"payment_requests": [
      {
        "request_type": "BALANCE",
        "due_date": "2024-11-05",
        "automatic_payment_source": "CARD_ON_FILE",
        "card_id": "ccof:FOOBAR"
      }
    ],

Response:

payment_requests": [
      {
        "uid": "SOME-ID",
        "request_type": "BALANCE",
        "due_date": "2024-11-04",
        "tipping_enabled": false,
        "card_id": "ccof:FOOBAR",
        "computed_amount_money": {
          "amount": 7537,
          "currency": "CAD"
        },
        "total_completed_amount_money": {
          "amount": 0,
          "currency": "CAD"
        },
        "automatic_payment_source": "CARD_ON_FILE"
      }
    ],

 

why is the "due_date" the day before in the Response, different than what was requested?

This is causing my "publish" API call to fail with the following error:

 

{"errors":[{"code":"BAD_REQUEST","detail":"Due on date must be on or after scheduled date","field":"invoice.payment_requests","category":"INVALID_REQUEST_ERROR"}]}
495 Views
Message 1 of 2
Report
1 Solution
Alumni

Solution

Hey @sedkodes,

 

Thanks for reaching out to the Community!

 

To assist you better, feel free to check out our Developer Forums to see if your question has been previously asked. You can also visit our Developer Documentation for more detailed information on our APIs.

 

Let us know if you need further assistance!

 

 

 

 

 

 

 

 

View Solution >

456 Views
Message 2 of 2
Report
1 REPLY 1
Alumni

Solution

Hey @sedkodes,

 

Thanks for reaching out to the Community!

 

To assist you better, feel free to check out our Developer Forums to see if your question has been previously asked. You can also visit our Developer Documentation for more detailed information on our APIs.

 

Let us know if you need further assistance!

 

 

 

 

 

 

 

 

457 Views
Message 2 of 2
Report