working on checkout api function