I stand corrected. I thought it was federal law but apparently not.
From ATF FAQ section:
(B2) From whom may an unlicensed person acquire a firearm under the GCA?
A person may only acquire a firearm within the person’s own State, except that he or she may purchase or otherwise acquire a rifle or shotgun, in person, at a licensee's premises in any State, provided the sale complies with State laws applicable in the State of sale and the State where the purchaser resides. A person may borrow or rent a firearm in any State for temporary use for lawful sporting purposes.
[18 U.S.C. 922(a)(3) and (5), 922(b)(3), 27 CFR 478.29 and 478.30]
And Kansas law:
Chapter 48.--MILITIA, DEFENSE AND PUBLIC SAFETY
Article 19.--SALE AND PURCHASE OF CERTAIN FIREARMS
48-1903. Purchase or receipt of rifle or shotgun in contiguous state by resident of Kansas; restrictions. It is hereby declared to be lawful for a resident of this state to purchase or receive delivery of a rifle or shotgun in a state contiguous to this state, subject to the following restrictions and requirements:
(a) The sale must fully comply with the legal conditions of sale in both such states; and
(b) Prior to the sale or delivery for sale of the rifle or shotgun, the purchaser and the licensee must have complied with all of the requirements of section 922 (c) of the federal gun control act of 1968, applicable to interstate transactions other than at the licensee's business premises.
History: L. 1970, ch. 210, § 3; July 1.
You'll need to check your own state law and the laws of the state in which you want to buy to find out if you can purchase.