Error with Square Checkout API - "The order has expired"

451 Views Asked by At

Getting this error (category: INVALID_REQUEST_ERROR code: ORDER_EXPIRED) from the checkout endpoint when a user clicks through, then comes back days later to pay. This is the endpoint that takes the order information and provides a unique checkout URL for the user.

How long do orders have before they expire? I'm not even clear on what exactly is expiring?

Not much sent over in the post. Trying to determine if I just need to alter the idempotency key "if an order has expired", which seems counterproductive.

$this->_order = ['redirect_url'              => $redirectUrl,
                 'idempotency_key'           => $this->_idempotencyKey,
                 'ask_for_shipping_address'  => false
        ];

$this->_order['order']['reference_id'] = (string) "{$this->getInvoice()->getId()}";
1

There are 1 best solutions below

1
tristansokol On BEST ANSWER

Checkout urls expire in 24 hours. Square is working on updating the documentation to reflect this info.